 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Bunny_Wabbit Newbie cheater
Reputation: 0
Joined: 23 Sep 2017 Posts: 23 Location: United Kingdom
|
Posted: Sat Jan 29, 2022 7:30 pm Post subject: Can someone remind me how the code in this script works? |
|
|
So I've been looking for Cheat Engine trainers for the current patch of Streets of Rage 4, and I found a table that ColonelRVH made that enabled infinite health, infinite star specials and what not. The thing is, I don't want to complete cheat at this game, but to train myself to get better at a specific stage by gradually reducing the amount of health starts with, or reducing the amount of damage that dealt by enemies.
So I was wondering if it's possible to amend this script, to make it so that rather than have unlimited health, just have twice as much health to start with, or three times as much. I haven't coded scripts in ages but the 'nop' makes me wonder if that's just nulling the damage enemies deal.
| Code: | aobscanmodule(Get_HP_AOB,SOR4.exe,8B 53 38 89 50 14) // should be unique
alloc(newmem,$1000,"SOR4.exe"+43653A)
label(code)
label(return)
newmem:
mov [rbx+38],640000
code:
mov edx,[rbx+38]
mov [rax+14],edx
jmp return
Get_HP_AOB:
jmp newmem
nop
return:
registersymbol(Get_HP_AOB)
[DISABLE]
Get_HP_AOB:
db 8B 53 38 89 50 14
unregistersymbol(Get_HP_AOB)
dealloc(newmem) |
I just can't remember how to use code well enough and I was hoping someone here could perhaps understand it well enough to know what I'd have to amend to make it so rather than have unlimited health, I just have twice or three times as much.
Thanks in advance guys.
Edit: It's worth noting that the game completely crashes if I attach the debugger when clicking "Find out what accesses this address".
|
|
| Back to top |
|
 |
Frouk Grandmaster Cheater
Reputation: 6
Joined: 22 Jun 2021 Posts: 528
|
|
| Back to top |
|
 |
Bunny_Wabbit Newbie cheater
Reputation: 0
Joined: 23 Sep 2017 Posts: 23 Location: United Kingdom
|
Posted: Sun Jan 30, 2022 4:03 am Post subject: |
|
|
Haha I'm sorry but where did you get the idea that Streets of Rage 4 was online? You can play cooperatively or compete on a leaderboard but the vast majority of people are there for the single player.
|
|
| Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1072 Location: 0x90
|
Posted: Sun Jan 30, 2022 7:44 am Post subject: Re: Can someone remind me how the code in this script works? |
|
|
| Bunny_Wabbit wrote: | So I've been looking for Cheat Engine trainers for the current patch of Streets of Rage 4, and I found a table that ColonelRVH made that enabled infinite health, infinite star specials and what not. The thing is, I don't want to complete cheat at this game, but to train myself to get better at a specific stage by gradually reducing the amount of health starts with, or reducing the amount of damage that dealt by enemies.
So I was wondering if it's possible to amend this script, to make it so that rather than have unlimited health, just have twice as much health to start with, or three times as much. I haven't coded scripts in ages but the 'nop' makes me wonder if that's just nulling the damage enemies deal.
| Code: | aobscanmodule(Get_HP_AOB,SOR4.exe,8B 53 38 89 50 14) // should be unique
alloc(newmem,$1000,"SOR4.exe"+43653A)
label(code)
label(return)
newmem:
mov [rbx+38],640000
code:
mov edx,[rbx+38]
mov [rax+14],edx
jmp return
Get_HP_AOB:
jmp newmem
nop
return:
registersymbol(Get_HP_AOB)
[DISABLE]
Get_HP_AOB:
db 8B 53 38 89 50 14
unregistersymbol(Get_HP_AOB)
dealloc(newmem) |
I just can't remember how to use code well enough and I was hoping someone here could perhaps understand it well enough to know what I'd have to amend to make it so rather than have unlimited health, I just have twice or three times as much.
Thanks in advance guys.
Edit: It's worth noting that the game completely crashes if I attach the debugger when clicking "Find out what accesses this address". |
AOB injection scripts consistently execute the code every time the game accesses that particular function.
|
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 155
Joined: 06 Jul 2014 Posts: 4775
|
Posted: Sun Jan 30, 2022 2:13 pm Post subject: |
|
|
The nop instruction is just there for padding. The jmp instruction takes up 5 bytes, but there were 6 bytes there originally. The nop makes up for the 1 byte not overwritten such that the return label is placed at the correct address.
rbx+38 looks interesting. Look at what addresses that instruction accesses- if this script really changes as much as you say it does, that instruction likely accesses many addresses. If you only want to change a few, you might need to differentiate them from other addresses. See step 9 of the CE tutorial for more information.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4196
|
Posted: Sun Jan 30, 2022 7:29 pm Post subject: |
|
|
| Code: | | mov [rbx+38],640000 |
This is the only code that is doing anything in your script. It is moving 6,553,600 (640000 Hex) into whatever address holds your health value (and many others, probably). If you want to change the amount, simply change the 640000 to something smaller.
That being said, as already mentioned, this code is getting executed all of the time, so your health and other values will never change unless you change your script to allow for that. One simple approach would be to add a switch that only executes this command once, on demand.
I would really recommend completing the CE tutorial, as suggested, since it will help you to develop a better understanding.
|
|
| 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
|
|