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 


Auto Assembler script on instruction w/ literal address?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
tkx
Newbie cheater
Reputation: 0

Joined: 28 Jul 2010
Posts: 14

PostPosted: Tue May 03, 2016 1:20 am    Post subject: Auto Assembler script on instruction w/ literal address? Reply with quote

Hello,

In the game I'm trying to hack, the address that stores in-game time is only shown as a literal value in the assembly (changes every load and isn't static).

I have this code to help me find that address:

Code:

[ENABLE]
label(timeHook)
registersymbol(timeHook)

aobscan(_timeAddress, 8B 85 F8 FB FF FF 89 45 EC A1 * * * * B9 64 00 00 00)
_timeAddress+A:
timeHook:

[DISABLE]


However I want to make a different script to stop time through a code cave by filling replacing this line with NOPs (where 00###### is the address that stores time):
Code:

83 05 ######00 0A     - add dword ptr [00######],0A


This is my code so far:
Code:

[ENABLE]
aobscan(_plusTenAddr, 83 05 * * * * 0A A1 * * * * 8D)
label(plusTenAddr)
registersymbol(plusTenAddr)

_plusTenAddr:
plusTenAddr:
db 90 90 90 90 90 90 90

[DISABLE]
plusTenAddr:
add dword ptr [timeHook],0A

I wanted the [DISABLE] part to fill in the literal time address (the value of my timeHook variable) so it can function as normal, but the [timeHook] fills it in with the address of timeHook (as expected).

My question is what can I do to fill in the literal address on disable, so it goes back to
add dword ptr [00######],0A?
Back to top
View user's profile Send private message
Cake-san
Grandmaster Cheater
Reputation: 8

Joined: 18 Dec 2014
Posts: 541
Location: Semenanjung

PostPosted: Tue May 03, 2016 1:38 am    Post subject: Reply with quote

Code:

[ENABLE]
aobscan(plusTenAddr, 83 05 * * * * 0A A1 * * * * 8D)
registersymbol(plusTenAddr)
alloc(_temp,7)
registersymbol(_temp)
_temp:
readmem(plusTenAddr,7)

plusTenAddr:
db 90 90 90 90 90 90 90

[DISABLE]
plusTenAddr:
readmem(_temp,7)
dealloc(_temp)
unregistersymbol(plusTenAddr)
unregistersymbol(_temp)


or

Code:

[ENABLE]
label(timeHook)
registersymbol(timeHook)

aobscan(_timeAddress, 8B 85 F8 FB FF FF 89 45 EC A1 * * * * B9 64 00 00 00)
[_timeAddress+A]:
timeHook:

[DISABLE]
unregistersymbol(timeHook)


Code:

[ENABLE]
aobscan(_plusTenAddr, 83 05 * * * * 0A A1 * * * * 8D)
label(plusTenAddr)
registersymbol(plusTenAddr)

_plusTenAddr:
plusTenAddr:
db 90 90 90 90 90 90 90

[DISABLE]
plusTenAddr:
add dword ptr [timeHook],0A

_________________
...
Back to top
View user's profile Send private message
tkx
Newbie cheater
Reputation: 0

Joined: 28 Jul 2010
Posts: 14

PostPosted: Tue May 03, 2016 10:33 pm    Post subject: Reply with quote

Awesome, thanks Cake-san!

I used the first one which looks to be a clean way to return the code to its original state.
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