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 


How a recurring BP is implemented?

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

Joined: 27 Sep 2012
Posts: 38

PostPosted: Mon Jan 15, 2018 12:38 am    Post subject: How a recurring BP is implemented? Reply with quote

I'm trying to understand how this debugger works in case I set a BP and the program being debugged keeps hitting it every time it comes to it. If you use int3 then after a BP is hit and all scripts are processed you need to decrement EIP and restore the first byte of the command from 0xCC to the original and let the program run, right? How do you go from there and reset the BP?

Thank you!
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Mon Jan 15, 2018 1:28 am    Post subject: Reply with quote

I'm not going to pretend I actually know but... CE is open source: https://github.com/cheat-engine/cheat-engine/tree/master/Cheat%20Engine

I'd assume debugeventhandler.pas and debughelper.pas would be the most relevant.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Mon Jan 15, 2018 3:11 am    Post subject: Reply with quote

normally CE uses hardware breakpoints (so not CC) and uses the Resume Flag in EFlags to skip the breakpoint (win vista and later)

but when CE does use a software breakpoint (cc) , or win xp, it removes the breakpoint, sets the Trap Flag in eflags so it breaks on the next instruction and on that next instructionbreak put the breakpoint back and continue running (Note that with software breakpoints it can theoretically happen that the same code is executed by multiple threads, and that in the time between removing the breakpoint, the single step, and restoring the breakpoint, the code can have been executed by a different cpu)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
toffler
Cheater
Reputation: 0

Joined: 27 Sep 2012
Posts: 38

PostPosted: Mon Jan 15, 2018 7:44 am    Post subject: Reply with quote

Idea Idea Idea Thank you!
Back to top
View user's profile Send private message
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