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 


disabling injection modifies original byte code

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

Joined: 09 Apr 2015
Posts: 3

PostPosted: Tue Mar 07, 2017 2:34 pm    Post subject: disabling injection modifies original byte code Reply with quote

I made an injection using the auto assembler and the templates "Cheat Table framework code" and "Code injection". Note that I did not change a single thing in the script to reproduce this behavior.

The bytes at the injection point are originally:

3B CA 7C 0B 7F 04
cmp ecx,edx
jl mygame.exe+address
jg mygame.exe+otheraddress

Without executing I add the script to the table. I then enable the script and disable it again. Disabling causes the original code to be put back at the injection point as per template definition. While the instructions are the same as before enabling the script, the byte code has changed to:

39 D1 7C 0B 7F 04

Note how the first two bytes have changed.

So the game works just like it did before the injection, but the byte code has changed. What's the most elegant way to restore the original byte code? I figure I could just do it using mov (once I get it to work that way) but maybe there's some solution that looks better using auto assembler features?

I'd tell you why I want to know this, but I'm afraid you'd try to convince me of just not doing it instead of helping me out. Very Happy
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Tue Mar 07, 2017 2:51 pm    Post subject: Reply with quote

That's because some assembler instructions can be coded in different ways although achieving the exact same effect (i.e. that's also the case when subtracting two certain registers).

To prevent that, just comment the instructions and input the originalbytes like this
Code:
[DISABLE]
dealloc(newmem)
"Game.exe"+12345:
//cmp ecx,edx
//jl mygame.exe+address
//jg mygame.exe+otheraddress
db 3B CA 7C 0B 7F 04
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