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 does stealth edit deal with relative jumps

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

Joined: 09 Aug 2014
Posts: 2

PostPosted: Sat Aug 09, 2014 9:28 pm    Post subject: How does stealth edit deal with relative jumps Reply with quote

Hi,

I have a (general technical, not directly plugin related) question about the Stealth Edit plugin (I can't post links, but first on google).

My understanding of the plugin is as follows:
- User activates hack which writes to game memory
- Stealth Edit marks particular game memory page as non executable and makes executable copy
- On vectored exception (because of DEP), swaps returns from exception to copied memory

How does:
- The control flow get back to regular memory if it flows off the edges of the copied memory?
- What about relative call instructions in the copied memory?
- What about RIP-relative addressed reads and writes?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sun Aug 10, 2014 2:52 am    Post subject: Reply with quote

Quote:

- The control flow get back to regular memory if it flows off the edges of the copied memory?

The stack will hold the return address. Eventually it'll encounter a ret that will cause it to return (can take multiple ret's)

Quote:

- What about relative call instructions in the copied memory?

Relative call instructions always point to an address inside the module it originates from. So if a relative jump happens in the copied memory, the destination will be in the copy at the proper relative location. (That is why the whole code section of a module is copied)

Quote:

- What about RIP-relative addressed reads and writes?

It doesn't. That's why stealthedit does not work on 64-bit targets.
For that you still need to use the old manual method of finding all integrity check routines and change their read pointer to the copy and do your changes in the original

There is also the alternate option of letting cheat engine rewrite a single page, so relative instructions get redirected to the original, with a non executable stub before and after it, but that isn't always perfect (short jumps can be messy as they could point to an instruction that overlaps the boundary of a page marked nx and normal, so the best solution would be to fully rewrite the code section)

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

Joined: 09 Aug 2014
Posts: 2

PostPosted: Tue Aug 12, 2014 8:18 am    Post subject: Reply with quote

Dark Byte wrote:
<snip>

Thanks.
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 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