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 


Is it possible to set a symbol to set to edi,eax, etc. ?

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

Joined: 07 Nov 2013
Posts: 32

PostPosted: Wed Jun 11, 2014 8:54 am    Post subject: Is it possible to set a symbol to set to edi,eax, etc. ? Reply with quote

Basicly I want to know if I can make an asm script that then sets example x to be its EDI register?

Working with an address there is hard to aobscan, since it changes doing gameplay and the pattern is quite similar to other places in the code.

Code:

[ENABLE]
alloc(newmem,2048)
alloc(x, 16)
label(returnhere)
label(originalcode)
label(exit)

registersymbol(x)

newmem:
x:
readmem(edi, 16)

originalcode:
fadd dword ptr [edi+4C]
fstp dword ptr [edi+4C]

exit:
jmp returnhere

"game.exe"+16F20B:
jmp newmem
nop
returnhere:
 
[DISABLE]
dealloc(newmem)
dealloc(x, 16)
unregistersymbol(x)
"game.exe"+16F20B:
fadd dword ptr [edi+4C]
fstp dword ptr [edi+4C]
//Alt: db D8 47 4C D9 5F 4C


I know this doesn't work, but should give a basic understanding of what I'm trying to do.
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Wed Jun 11, 2014 9:08 am    Post subject: Reply with quote

Closest thing without using a debugger to periodically set x:
Code:
[ENABLE]
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
label(LastKnownEDIValue)
registersymbol(LastKnownEDIValue)

newmem:
 mov dword [LastKnownEDIValue],edi //save EDI at address LastKnownEDIValue

 originalcode:
 fadd dword ptr [edi+4C]
 fstp dword ptr [edi+4C]

 exit:
 jmp returnhere
LastKnownEDIValue:
dd 0 //dd reserves 4 bytes (edi is 4 bytes long, not 16)

"game.exe"+16F20B:
jmp newmem
nop
returnhere:
   
[DISABLE]
dealloc(newmem)
unregistersymbol(LastKnownEDIValue)

"game.exe"+16F20B:
fadd dword ptr [edi+4C]
fstp dword ptr [edi+4C]
//Alt: db D8 47 4C D9 5F 4C
Activate this, then click "add address manually" and type LastKnownEDIValue in the box. The newly created record will contain the value edi had when it entered your code, so basically whatever you access with that fstp dword ptr [edi+4C] can be accessed with a pointer with its base at LastKnownEDIValue and an offset of 4C.
_________________
DO NOT PM me if you want help on making/fixing/using a hack.
Back to top
View user's profile Send private message
Qvintus
Cheater
Reputation: 0

Joined: 07 Nov 2013
Posts: 32

PostPosted: Wed Jun 11, 2014 9:41 am    Post subject: Reply with quote

Thanks a lot ! Some reason doesn't get the correct address, seems to get the newmem address with an offset of 23.

I believe it's because edi hasn't been set to the correct address at this point.
Apart from that you've helped me understand how to get/set an address.

Nevermind I misunderstood you. This works perfectly!
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