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 


Question about Remote Threads

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
mgostIH
Expert Cheater
Reputation: 3

Joined: 01 Jan 2016
Posts: 159

PostPosted: Sat Jan 09, 2016 11:30 am    Post subject: Question about Remote Threads Reply with quote

So, I was testing new ways for developing hacks that runs without having an external process opened.
I thought about creating remote threads on some allocated memory in which an asm script would do all the "magic".

I have no problem at coding asm x86 or using windows APIs, but I have no clue on how to stop a thread safely without stopping it externally.
Debugging it with Cheat Engine breakpoints would always lead to a crash, and using ret and the end of the script was doing a fine job of "closing" the thread.

I wondered about how this was happening, so I programmed a little script for testing it out and I saw the ret was going to start this procedure:
Code:
push eax
call dword ptr [kernel32.dll+10704]   { ->ntdll.RtlExitUserThread }


I was wondering, is this something Cheat Engine automatically sets?
If not, do I have to set some specific parameters using CreateRemoteThread() from Windows.h or do i have to hardcode it inside the asm script?

I hope for a complete answer. Thanks.

_________________
Do you need to ask me something? Feel free to join my discord server at: https://discord.gg/At4VZXA or ask me something in my YouTube channel: https://www.youtube.com/c/mgostIH
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sat Jan 09, 2016 12:12 pm    Post subject: Reply with quote

this happens with CreateRemoteThread()

You just have to make sure that your stack pointer (ESP/RSP ) is exactly the same as when the thread started when ret is called (and the return address hasn't been tampered with)

_________________
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
mgostIH
Expert Cheater
Reputation: 3

Joined: 01 Jan 2016
Posts: 159

PostPosted: Sat Jan 09, 2016 1:12 pm    Post subject: Reply with quote

Dark Byte wrote:
this happens with CreateRemoteThread()

You just have to make sure that your stack pointer (ESP/RSP ) is exactly the same as when the thread started when ret is called (and the return address hasn't been tampered with)


Oh, thanks a lot! I couldn't find this info elsewhere.
Anyway, is debugging created remote threadst possible? Every time I try it seems to crash my game.

_________________
Do you need to ask me something? Feel free to join my discord server at: https://discord.gg/At4VZXA or ask me something in my YouTube channel: https://www.youtube.com/c/mgostIH
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sat Jan 09, 2016 4:09 pm    Post subject: Reply with quote

yes. use the windows debugger as that is the only one that can set a breakpoint on newly created threads

then just set a breakpoint and create the thread

_________________
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 -> General Gamehacking 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