|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Attack Cheater Reputation: 0
Joined: 21 Mar 2011 Posts: 46 Location: Canada
|
Posted: Mon Feb 02, 2015 11:42 am Post subject: Is this AA script alright? |
|
|
So I am messing around with Jet Set Radio and the game is simple for me to work on the basics. I have found the "ammo" address. Going from there, I want to stop it from decreasing. The pointer goes rather random outside of levels and seems to (sometimes) crash the game if frozen between levels.
It is decreased in three different instances (for some reason), always using the same code. Two are triggered by different target sizes, the third seems to be rarely triggered.
So I wrote this script, but I don't know if there is a better, more efficient way of doing this?
Code: | [ENABLE]
alloc(newmem,1024)
label(originalcode)
label(exit)
label(returnhere)
label(_can0)
registersymbol(_can0)
aobscan(can0,FF 8E C8 03 00 00 56)
label(_can1)
registersymbol(_can1)
aobscan(can1,FF 8E C8 03 00 00 57)
label(_can2)
registersymbol(_can2)
aobscan(can2,FF 8E C8 03 00 00 83)
newmem:
nop
originalcode:
//dec [esi+000003C8]
exit:
jmp returnhere
can0:
_can0:
jmp newmem
nop
can1:
_can1:
jmp newmem
nop
can2:
_can2:
jmp newmem
nop
returnhere:
[DISABLE]
dealloc(newmem)
_can0:
db FF 8E C8 03 00 00
_can1:
db FF 8E C8 03 00 00
_can2:
db FF 8E C8 03 00 00
unregistersymbol(_can0)
unregistersymbol(_can1)
unregistersymbol(_can2) |
Help is always appreciated. |
|
Back to top |
|
|
panraven Grandmaster Cheater Reputation: 55
Joined: 01 Oct 2008 Posts: 942
|
Posted: Mon Feb 02, 2015 12:37 pm Post subject: |
|
|
Your only return one address, just after _can2,
So code cave from _can0 and _can1 also return to _can2, likely cause error behavior.
Try replace Code: | (1)jmp newmem
...
(2)jmp returnhere |
with
Code: | (1)call newmem
...
(2)ret |
As long as the ESP register is not referenced inside the code cave, it should be ok.
Or, if the codes save are not shared, you have to use seperated returnhere/newmem label (eg.newmem1, returnhere1 etc.)
If the modification is short enough, code cave may not necessary. the modification can be in place.
Code: | label(_can0)
registersymbol(_can0)
aobscan(can0,FF 8E C8 03 00 00 56)
can0:
db 90 90 90 90 90 90 // 90 -- nop in assembler
registersymbol(_can1)
aobscan(can1,FF 8E C8 03 00 00 57)
can1:
db 90 90 90 90 90 90
registersymbol(_can2)
aobscan(can2,FF 8E C8 03 00 00 83)
can2:
db 90 90 90 90 90 90 |
Last edited by panraven on Mon Feb 02, 2015 12:45 pm; edited 2 times in total |
|
Back to top |
|
|
Attack Cheater Reputation: 0
Joined: 21 Mar 2011 Posts: 46 Location: Canada
|
Posted: Mon Feb 02, 2015 12:41 pm Post subject: |
|
|
That was pretty fast. I've actually improved on it already. That said, your input makes so much sense and will be useful down the road. I was causing an infinite loop on certain in game actions. I'm super tired as I decided to mess with this instead of sleep...
Code: | [ENABLE]
aobscan(can0,FF 8E C8 03 00 00 56)
registersymbol(can0)
aobscan(can1,FF 8E C8 03 00 00 57)
registersymbol(can1)
aobscan(can2,FF 8E C8 03 00 00 83)
registersymbol(can2)
can0:
db 90 90 90 90 90 90
can1:
db 90 90 90 90 90 90
can2:
db 90 90 90 90 90 90
[DISABLE]
can0:
db FF 8E C8 03 00 00
unregistersymbol(can0)
can1:
db FF 8E C8 03 00 00
unregistersymbol(can1)
can2:
db FF 8E C8 03 00 00
unregistersymbol(can2) |
|
|
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
|
|