0

I am attempting to write a small script with cheat engine to avoid the damage registration while keeping it for enemies, but I'm running into trouble. The code that avoids updating health after taking damage works properly, but if I include the cmp and jne lines it always jumps to the original code:

[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here

cmp [edi+B08],1 // this is not passing
jne originalcode

add [esi+48],500
jmp exit

originalcode:

movsd [esi+48],xmm1


exit:
jmp returnhere

"noita.exe"+589231:
jmp newmem
returnhere:


 
 
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"noita.exe"+589231:
db F2 0F 11 4E 48
//movsd [esi+48],xmm1

I got the value of [edi+B08] from this scan which I may be using improperly:

The initial scan to find memory address and value

I scanned the different addresses to find an offset that I could use and [EDI+B08] seems like it would work (could compare it against 1 to isolate my health from enemies health). However, it is not passing the cmp [edi+B08],1 \

If anyone has any idea why this isn't working I would be very appreciative.

DevFish
  • 11
  • 6
  • Please post your code as text, not as a screen shot. – Nate Eldredge Mar 24 '23 at 05:39
  • 1
    What size is the data at [edi+B08] (byte, word, dword)? `cmp mem, imm` is ambiguous as to operand size, and your assembler may default to the wrong one. – Nate Eldredge Mar 24 '23 at 05:42
  • How are you detecting that the jump is taken? – Nate Eldredge Mar 24 '23 at 05:43
  • The purpose of the `jne` seems to be to skip over the `add [esi+48], 500` (which is also ambiguous as to size). But the next instruction executed is `movsd [esi+48], xmm1` which is just going to overwrite the value you modified. So I am not sure what you're meaning to accomplish here. – Nate Eldredge Mar 24 '23 at 05:45
  • @NateEldredge Thank you very much, added the code in the post and fixed the silly mistake by adding a jmp exit statement. The first jump is supposed to occur if [edi+B08] is equal to 1, because for the enemies that value should be zero. Also, I'm not sure what the data type is, I'll try to find it. – DevFish Mar 24 '23 at 06:16

0 Answers0