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 


Debug registers

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

Joined: 22 Mar 2006
Posts: 926
Location: detroit

PostPosted: Sun Aug 26, 2007 6:30 pm    Post subject: Debug registers Reply with quote

Dark Byte...debug registers are used a lot...but I've never seen you really explain how they work and how you did it in CE. Could you explain it a little please?
_________________
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 475

Joined: 09 May 2003
Posts: 25987
Location: The netherlands

PostPosted: Sun Aug 26, 2007 7:53 pm    Post subject: Reply with quote

what are debug regs:
Debug registers are special cpu registers that can cause a interrupt 1 interrupt to fire on a special condition. You can set that condition with debug registers.
You can set it to raise that interrupt on a execution of some code
On a write of a specific address
and on a read/write of a specific address
(there is no read only possibility, so use you brains when looking at the instruction that accessed it)

You can even let it raise a interrupt 1 when the debug registwers are being read or written to. But ce 5.3 doesn't make use of that function.
And in the past you could set debug registers so global, so they would work for all tasks, but since the early pentium cpu's that functionality got removed

How does ce (ab)use them:
Cheat Engine can set those debug registers for you. Rightclick the address in the list and it'll set the proper debug register states so it raises that interrupt on a read or write. (assuming you've configured ce to use debug registers, default, except vista)
The change registers at address option does the same, it configures the debug registers to raise the interrupt on execution of the specified address. Then it can edit the registers and continue as if nothing ever happened.

CE has 2 methods of catching interrupt 1's using the normal windows api:
Interrupt 1 gets passed to the normal windows handler, that one checks if there is a debugport , if so , pause the process and send the event to the debugger (ce) and there I can handle it. (if not raise a exception, and if not handled by the application terminate)

Interrupt 1 gets captured by ce's device driver, there it's checked if the interrupt 1 actually belongs to the target process and if it was caused by ce, and if so, handle it internally in the driver and quickly exit, not letting windows know a interrupt ever happened. If it wasn't caused by ce it just calls the original handler of windows to let it do it's course


Hope that explains it better

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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