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 to set a breakpoint on a newly created thread?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
nexnex
Newbie cheater
Reputation: 0

Joined: 22 Jun 2019
Posts: 13

PostPosted: Mon Jun 24, 2019 11:40 am    Post subject: How to set a breakpoint on a newly created thread? Reply with quote

Let's say I'm spawning a thread to run AA script using createThread.
If I set a breakpoint on a line in that script before spawning a thread it won't work.

Code:
createThread(script)
script:
xor eax,eax // set bp, spawn a thread


I've been advised to use following trick to bypass it:
Add infinite loop to a script, spawn a thread, place bp inside the loop.
What allows it to work is the fact that we place bp after spawning a thread.

Code:
script_debug:
mov ecx,#1000
call Sleep
jmp script_debug // place bp here and replace with nop to allow it to exit the loop
jmp script


I wonder if there is other simpler way to do it.
Back to top
View user's profile Send private message
nexnex
Newbie cheater
Reputation: 0

Joined: 22 Jun 2019
Posts: 13

PostPosted: Tue Jun 25, 2019 11:23 pm    Post subject: Reply with quote

Nobody has similar problem? Or everybody do the same thing?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 473

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

PostPosted: Wed Jun 26, 2019 12:27 am    Post subject: Reply with quote

Use a software breakpoint
_________________
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
nexnex
Newbie cheater
Reputation: 0

Joined: 22 Jun 2019
Posts: 13

PostPosted: Wed Jun 26, 2019 2:40 pm    Post subject: Reply with quote

Guess who feels stupid now. Thank you!
I'm still not sure why hardware bp does not work in a new thread.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 473

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

PostPosted: Wed Jun 26, 2019 2:50 pm    Post subject: Reply with quote

If using VEH debug the setting of the breakpoints happens after the thread has started execution
_________________
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
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