I have tried to do some cheats on some emulators (PCSX2 and Dolphine), some cheats are easy to do those that only concern the character used. Cheats that have common values such as the Hp of the playable character and that of the enemies crash the emulator or make both enemies and allies immortal.
For example this code crashes the game:
[ENABLE]
aobscan(INJECT,10 0F 38 F1 7C 33 08 8D) // should be unique
alloc(newmem,$1000,INJECT)
label(code)
label(return)
newmem:
//Offset 210 my (float)2 enemy (float)4.600602988E-41
cmp [rbx+210],(float)2
jne code
nop 6
jmp return
code:
movbe [rbx+rsi+08],edi
jmp return
INJECT+01:
jmp newmem
nop
return:
registersymbol(INJECT)
[DISABLE]
INJECT+01:
db 0F 38 F1 7C 33 08
unregistersymbol(INJECT)
dealloc(newmem)
What do I have to do to make this type of code work?
Thx for the help
How to compare values in emulators?
- SilverRabbit90
- Table Makers
- Posts: 214
- Joined: Fri Jan 15, 2021 12:01 am
- Reputation: 191
-
- Expert Cheater
- Posts: 293
- Joined: Sat Mar 04, 2017 7:28 am
- Reputation: 236
Re: How to compare values in emulators?
your comparison can come across null or invalid value which crash the game. either find a better spot to check or make sure [rbx+210] contain valid value that can be used to compare at all time. (float)4.600602988E-41 usually an indication for bad spot to check.
- SilverRabbit90
- Table Makers
- Posts: 214
- Joined: Fri Jan 15, 2021 12:01 am
- Reputation: 191
Re: How to compare values in emulators?
Ok thanks I'll try to look for an Offset with better values, this thing is making me crazy finding the correct values in the correct offsets in a normal PC game is quite easy and fast, in an emulator it is all the more tedious.
In any case, wasn't the comparison I made wrong? For example, do I have to write something like?
cmp [rsi+210],(float)2
Maybe i have to use rsi instead of rbx...
In any case, wasn't the comparison I made wrong? For example, do I have to write something like?
cmp [rsi+210],(float)2
Maybe i have to use rsi instead of rbx...
- SilverRabbit90
- Table Makers
- Posts: 214
- Joined: Fri Jan 15, 2021 12:01 am
- Reputation: 191
Re: How to compare values in emulators?
I solved with something like this:TheByteSize wrote: ↑Thu Sep 30, 2021 1:38 amyour comparison can come across null or invalid value which crash the game. either find a better spot to check or make sure [rbx+210] contain valid value that can be used to compare at all time. (float)4.600602988E-41 usually an indication for bad spot to check.
[ENABLE]
aobscan(INJECT,10 0F 38 F1 7C 33 08 8D) // should be unique
alloc(newmem,$1000,INJECT)
label(code)
label(return)
newmem:
//Offset 10 my C8000000 enemy A0000000
//Offset 40 my 09000000 enemy 1A000000
//Offset 6C my 0 enemy (int)2348812288
//Offset 23C my 'ib_spideywrestlestealth' enemy ???
//Offset 320 my 0 enemy 32831
//Offset 340 my #14421180 enemy #00000000
//Offset 3A0 my (int)1354156800 enemy 0
//Offset 47D my 128 enemy 0
//Offset 714 my #01000000 enemy 00000000
//Offset 3A0 my (int)1354156800 enemy 0
//Offset EA0 my D1B35DBF enemy 00000000
cmp [rbx+rsi+6C],0
jne code
nop
nop
nop
nop
nop
nop
jmp return
code:
movbe [rbx+rsi+08],edi
jmp return
INJECT+01:
jmp newmem
nop
return:
registersymbol(INJECT)
[DISABLE]
INJECT+01:
db 0F 38 F1 7C 33 08
unregistersymbol(INJECT)
dealloc(newmem)
It was simpler than I thought XD
-
- Expert Cheater
- Posts: 852
- Joined: Fri Oct 12, 2018 10:25 pm
- Reputation: 896
Re: How to compare values in emulators?
You don't need all those 'nop' there though. 'Nop' means 'do nothing', so you're telling it to 'do nothing' 6 times instead of just not having anything there, which would pretty much be the same as doing nothing.SilverRabbit90 wrote: ↑Thu Sep 30, 2021 4:09 pmcmp [rbx+rsi+6C],0
jne code
nop
nop
nop
nop
nop
nop
jmp return
code:
movbe [rbx+rsi+08],edi
jmp return
- SilverRabbit90
- Table Makers
- Posts: 214
- Joined: Fri Jan 15, 2021 12:01 am
- Reputation: 191
Re: How to compare values in emulators?
GreenHouse wrote: ↑Thu Sep 30, 2021 6:29 pmYou don't need all those 'nop' there though. 'Nop' means 'do nothing', so you're telling it to 'do nothing' 6 times instead of just not having anything there, which would pretty much be the same as doing nothing.SilverRabbit90 wrote: ↑Thu Sep 30, 2021 4:09 pmcmp [rbx+rsi+6C],0
jne code
nop
nop
nop
nop
nop
nop
jmp return
code:
movbe [rbx+rsi+08],edi
jmp return
Yes, I know thanks, if you want you can also write like this:
cmp [rbx + rsi + 6C], 0
jne code
nop 6
jmp return
I had written to better understand XD
-
- Expert Cheater
- Posts: 852
- Joined: Fri Oct 12, 2018 10:25 pm
- Reputation: 896
Re: How to compare values in emulators?
Well, it's still the same thing I said, you don't need to add 'nop 6' to do nothing. It's just adding unnecessary extra bytes that don't do anything.SilverRabbit90 wrote: ↑Thu Sep 30, 2021 9:35 pmYes, I know thanks, if you want you can also write like this:
cmp [rbx + rsi + 6C], 0
jne code
nop 6
jmp return
I had written to better understand XD
- SilverRabbit90
- Table Makers
- Posts: 214
- Joined: Fri Jan 15, 2021 12:01 am
- Reputation: 191
Re: How to compare values in emulators?
GreenHouse wrote: ↑Fri Oct 01, 2021 6:26 amWell, it's still the same thing I said, you don't need to add 'nop 6' to do nothing. It's just adding unnecessary extra bytes that don't do anything.SilverRabbit90 wrote: ↑Thu Sep 30, 2021 9:35 pmYes, I know thanks, if you want you can also write like this:
cmp [rbx + rsi + 6C], 0
jne code
nop 6
jmp return
I had written to better understand XD
I really did not know this, thanks you taught me something useful **
Who is online
Users browsing this forum: No registered users