Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[DELPHI-7]Debug Registers Hack

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
tanjiajun_34
Grandmaster Cheater
Reputation: 0

Joined: 16 Feb 2006
Posts: 786
Location: Singapore

PostPosted: Sat Apr 18, 2009 8:07 pm    Post subject: [DELPHI-7]Debug Registers Hack Reply with quote

I know you have to use WriteProcessMemory() But how to script it?
Let's say i got an address "00400000" i wan to make it EAX=0,2,3 or even change it to ZF [X] [X]....How do i do it? I searched but no avail. I hope you guys can teach me...+REP
Back to top
View user's profile Send private message
sphere90
Grandmaster Cheater
Reputation: 0

Joined: 24 Jun 2006
Posts: 912

PostPosted: Sat Apr 18, 2009 9:01 pm    Post subject: Re: [DELPHI-7]Debug Registers Hack Reply with quote

tanjiajun_34 wrote:
I know you have to use WriteProcessMemory() But how to script it?
Let's say i got an address "00400000" i wan to make it EAX=0,2,3 or even change it to ZF [X] [X]....How do i do it? I searched but no avail. I hope you guys can teach me...+REP

You don't need WPM to use debug registers. Look at CE's source code or here.

In short, set DR0 - DR3 of a thread using SetContextThread. You need to set the debug condition in DR7 as well. Then, hook the interrupt handler for int1 to include register modifying routines.

If you are talking about software breakpoints (int3), you need WPM because you need to write the int3 opcode at the address that you want to break. But to handle that interrupt, you need to attach a debugger to the process. Then you can modify the registers easily using SetContextThread.

EDIT: Thanks dnsi0 for pointing out my mistake.

_________________
Give a hungry man a fish and he'll be full for a day. Teach a hungry man how to fish and he'll be full for the rest of his life.


Last edited by sphere90 on Tue Apr 21, 2009 1:00 am; edited 1 time in total
Back to top
View user's profile Send private message
tanjiajun_34
Grandmaster Cheater
Reputation: 0

Joined: 16 Feb 2006
Posts: 786
Location: Singapore

PostPosted: Sat Apr 18, 2009 9:30 pm    Post subject: Reply with quote

wow that's difficult...got any alternative
Back to top
View user's profile Send private message
sphere90
Grandmaster Cheater
Reputation: 0

Joined: 24 Jun 2006
Posts: 912

PostPosted: Sat Apr 18, 2009 10:31 pm    Post subject: Reply with quote

tanjiajun_34 wrote:
wow that's difficult...got any alternative

How is it difficult when it's already available in CE's source code? Unless you don't know anything about windows internal.

_________________
Give a hungry man a fish and he'll be full for a day. Teach a hungry man how to fish and he'll be full for the rest of his life.
Back to top
View user's profile Send private message
tanjiajun_34
Grandmaster Cheater
Reputation: 0

Joined: 16 Feb 2006
Posts: 786
Location: Singapore

PostPosted: Mon Apr 20, 2009 4:20 am    Post subject: Reply with quote

i know some but i just wanna know the coding..hahas..i think i read still +rep
Back to top
View user's profile Send private message
zd601
How do I cheat?
Reputation: 0

Joined: 08 Nov 2008
Posts: 4

PostPosted: Mon Apr 20, 2009 9:23 am    Post subject: Re: [DELPHI-7]Debug Registers Hack Reply with quote

sphere90 wrote:
tanjiajun_34 wrote:
I know you have to use WriteProcessMemory() But how to script it?
Let's say i got an address "00400000" i wan to make it EAX=0,2,3 or even change it to ZF [X] [X]....How do i do it? I searched but no avail. I hope you guys can teach me...+REP

You don't need WPM to use debug registers. Look at CE's source code or

In short, set dr0 - dr3 of a thread using SetContextThread. You need to set the debug condition in dr7 as well. Then, hook the interrupt handler for int0 to include register modifying routines.

If you are talking about software breakpoints (int3), you need WPM because you need to write the int3 opcode at the address that you want to break. But to handle that interrupt, you need to attach a debugger to the process. Then you can modify the registers easily using SetContextThread.


I make a program using MLE's driver and dll to implement hardware breakpoint at a specific address. But i found i must lauch MLE first then close it, and run my program and it will be effect. If i don't run MLE and run my program directly, it will not take effect. Why?
PS: my target is MapleStory with NProtect.
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Mon Apr 20, 2009 8:04 pm    Post subject: Re: [DELPHI-7]Debug Registers Hack Reply with quote

sphere90 wrote:
tanjiajun_34 wrote:
I know you have to use WriteProcessMemory() But how to script it?
Let's say i got an address "00400000" i wan to make it EAX=0,2,3 or even change it to ZF [X] [X]....How do i do it? I searched but no avail. I hope you guys can teach me...+REP

You don't need WPM to use debug registers. Look at CE's source code or here.

In short, set dr0 - dr3 of a thread using SetContextThread. You need to set the debug condition in dr7 as well. Then, hook the interrupt handler for int0 to include register modifying routines.

If you are talking about software breakpoints (int3), you need WPM because you need to write the int3 opcode at the address that you want to break. But to handle that interrupt, you need to attach a debugger to the process. Then you can modify the registers easily using SetContextThread.


Uh... Isn't it int1... ???
Back to top
View user's profile Send private message
sphere90
Grandmaster Cheater
Reputation: 0

Joined: 24 Jun 2006
Posts: 912

PostPosted: Mon Apr 20, 2009 9:14 pm    Post subject: Re: [DELPHI-7]Debug Registers Hack Reply with quote

zd601 wrote:
I make a program using MLE's driver and dll to implement hardware breakpoint at a specific address. But i found i must lauch MLE first then close it, and run my program and it will be effect. If i don't run MLE and run my program directly, it will not take effect. Why?
PS: my target is MapleStory with NProtect.

Running MLE loads the driver. That's why if you don't run it, the driver doesn't get loaded and your program doesn't work. One way to fix it is to load MLE's driver manually in your program before trying to set breakpoints.

dnsi0 wrote:
Uh... Isn't it int1... ???

Opps. My bad. Should be int1.

_________________
Give a hungry man a fish and he'll be full for a day. Teach a hungry man how to fish and he'll be full for the rest of his life.
Back to top
View user's profile Send private message
zd601
How do I cheat?
Reputation: 0

Joined: 08 Nov 2008
Posts: 4

PostPosted: Tue Apr 21, 2009 1:16 am    Post subject: Re: [DELPHI-7]Debug Registers Hack Reply with quote

sphere90 wrote:
zd601 wrote:
I make a program using MLE's driver and dll to implement hardware breakpoint at a specific address. But i found i must lauch MLE first then close it, and run my program and it will be effect. If i don't run MLE and run my program directly, it will not take effect. Why?
PS: my target is MapleStory with NProtect.

Running MLE loads the driver. That's why if you don't run it, the driver doesn't get loaded and your program doesn't work. One way to fix it is to load MLE's driver manually in your program before trying to set breakpoints.
.

Thanks for your reply.
My program will load the dll when it boots and i have read the dbk32 source and found the dll will load the driver when LoadLibrary.
I have searched CEF and found a guy have the same issue with me but no one can figure out the reason.

BTW, sphere90 , could you pls post a sample of hook int1 handler to insert our own process of changing register? Can this be done in userspace?
Back to top
View user's profile Send private message
sphere90
Grandmaster Cheater
Reputation: 0

Joined: 24 Jun 2006
Posts: 912

PostPosted: Tue Apr 21, 2009 1:46 am    Post subject: Re: [DELPHI-7]Debug Registers Hack Reply with quote

zd601 wrote:
BTW, sphere90 , could you pls post a sample of hook int1 handler to insert our own process of changing register? Can this be done in userspace?

It's not possible do it in usermode. Here's a file from CE's source. It describes how int1 and int3 handlers are hooked and what the hooks do.



The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.


_________________
Give a hungry man a fish and he'll be full for a day. Teach a hungry man how to fish and he'll be full for the rest of his life.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites