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 


[C++] Freeze thread

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Spooted
How do I cheat?
Reputation: 0

Joined: 01 Dec 2012
Posts: 4

PostPosted: Sat Dec 01, 2012 11:25 am    Post subject: [C++] Freeze thread Reply with quote

I want to freeze a thread the Cheat Engine way and not using SuspendThread function.
Can anyone tell me how does Cheat Engine freezes the thread?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sat Dec 01, 2012 11:36 am    Post subject: Reply with quote

What do you mean with "freeze a thread"
Do you mean ce's rightclick on a thread and choosing "Freeze thread"? (That one uses SuspendThread)

Or do you mean one the debugger when a breaking breakpoint is hit and the state is shown waiting to continue?

If that, it depends on the debugger interface you use.
With the windows debugger interface, when a breakpoint is hit windows will freeze the whole application and then send a message to the debugger asking it what to do. (WaitForDebugEvent/ContinueDebugEvent)

With the veh debugger when an exception has hit, and it's a breakpoint type of exception it will send the data to cheat engine and then it'll wait for it to return with the data on how to continue using an event object

With the kernelmode debugger when the breakpoint interrupt gets fired it will put the data in a buffer, tell cheat engine that data is waiting, and then waits till cheat engine has handled it and told it how to continue.

So, in the first case it's basically just a suspendThread that windows does, in the other two cases the application itself enters into a wait state waiting for cheat engine specifically

If you meant something else, just ask, or look through ce's sourcecode

_________________
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
Spooted
How do I cheat?
Reputation: 0

Joined: 01 Dec 2012
Posts: 4

PostPosted: Sat Dec 01, 2012 11:42 am    Post subject: Reply with quote

First of all, thanks for replying, it means a lot.

I meant the one in:
View -> ThreadList -> Freeze

Are you sure it uses SuspendThread? Because when I simply use SuspendThread it doesn't work like it does in Cheat Engine.

Thanks again for the fast reply, Spooted.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sat Dec 01, 2012 11:45 am    Post subject: Reply with quote

Yes, it opens the thread with "THREAD_SUSPEND_RESUME" and then calls suspendThread on that handle

http://code.google.com/p/cheat-engine/source/browse/trunk/Cheat%20Engine/frmThreadlistunit.pas#187 (the no debugger case)

_________________
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
Spooted
How do I cheat?
Reputation: 0

Joined: 01 Dec 2012
Posts: 4

PostPosted: Sat Dec 01, 2012 1:07 pm    Post subject: Reply with quote

Thank you very much.
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