|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
tkx Newbie cheater Reputation: 0
Joined: 28 Jul 2010 Posts: 14
|
Posted: Tue May 03, 2016 1:20 am Post subject: Auto Assembler script on instruction w/ literal address? |
|
|
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 |
|
|
Cake-san Grandmaster Cheater Reputation: 8
Joined: 18 Dec 2014 Posts: 541 Location: Semenanjung
|
Posted: Tue May 03, 2016 1:38 am Post subject: |
|
|
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 |
|
|
tkx Newbie cheater Reputation: 0
Joined: 28 Jul 2010 Posts: 14
|
Posted: Tue May 03, 2016 10:33 pm Post subject: |
|
|
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 |
|
|
|
|
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
|
|