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 


Same command, different bytecode get generated

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

Joined: 10 Jan 2015
Posts: 4

PostPosted: Sat Jan 10, 2015 9:50 pm    Post subject: Same command, different bytecode get generated Reply with quote

I've traced down a problem in a script to the DISABLE section generating different bytecode for the same commands. Specifically:

Code:
== Original Code==
crawl.exe+4B21B5- A3 10470F01           - mov [crawl.pcre_malloc+25504C],eax

== After Enabling ==
_takedamage - E9 46DEF502           - jmp 03810000

= After Disabling ==
crawl.exe+4B21B5 - 89 05 10470F01        - mov [crawl.pcre_malloc+25504C],eax


This causes two problems; the replacement code is one byte longer so partially overwrites the next code, and the AOB scan can not re-enable the cheat because the code is now different.


The relevant disable code is

Code:

_takedamage:
mov [crawl.pcre_malloc+25504C],eax
unregistersymbol(_takedamage)


So my questions are

    Why is different bytecode bing generated; is A3 some legacy MOV command that inplies eax?
    Is there a way to have the disable section just apply the original bytes instead of compiling instructions, so I can just feed it "A3 10470F01" instead of "mov [crawl.pcre_malloc+25504C],eax"?
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Sat Jan 10, 2015 10:06 pm    Post subject: Reply with quote

Delete the code and use the commented (alt) DB version. It's added to the template by default.
_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 467

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

PostPosted: Sun Jan 11, 2015 4:27 am    Post subject: Reply with quote

db a3 10 47 0f 01

what ce version do you use?

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

Joined: 10 Jan 2015
Posts: 4

PostPosted: Sun Jan 11, 2015 5:04 am    Post subject: Reply with quote

Dark Byte wrote:
db a3 10 47 0f 01

what ce version do you use?


6.4 64Bit.

Geri wrote:
Delete the code and use the commented (alt) DB version. It's added to the template by default.


Perfect; exact syntax needed was

Code:
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
_takedamage:
//mov [crawl.pcre_malloc+25504C],eax
db A3 10 47 0F 01
unregistersymbol(_takedamage)


I'd previously tried and left the "alt:" in, but db is actually the assembler command to declare a static byte so it all makes sense now.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 221

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sun Jan 11, 2015 9:02 am    Post subject: Reply with quote

http://www.jaist.ac.jp/iscenter-new/mpc/altix/altixdata/opt/intel/vtune/doc/users_guide/mergedProjects/analyzer_ec/mergedProjects/reference_olh/mergedProjects/instructions/instruct32_hh/vc177.htm


Code:
A3     |  MOV moffs32*,EAX   |   Move EAX to (seg:offset)
89 /r  |  MOV r/m32,r32      |   Move r32 to r/m32

_________________
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