I was trying to hack my first game, and i chose a game called recettear and i wanted to create an xp multiplier code but i couldn't do that because CE would throw an error in the lines that i edited and i don't know why. Here's the original code:
When i try to save to current cheat table it gives me the Can't compile error, now i checked what dword ptr means since it was something i've never seen in the tutorial series that i watched i think i understood what it means and i think it was the problem so i removed it and it still didn't work, how do i fix this?
[ENABLE]
// Ideally, you'll want to use an AOB injection so that the location can be found with subsequent restarts of the game.
alloc(newmem,2048)
alloc(Multiplier,4) // You didn't allocate any bytes for your stored value
label(returnhere)
label(originalcode)
label(exit)
registersymbol(Multiplier)
Multiplier:
dd 0
newmem:
push ebx
mov ebx,[Multiplier]
imul ebx, 0A
pop ebx
originalcode:
add dword ptr [edi+44],ebx
push 02
exit:
jmp returnhere
"recettear.exe"+8CD61:
jmp newmem
nop
returnhere:
[DISABLE]
dealloc(Multiplier) // Important to deallocate the allocated memory
dealloc(newmem)
If you add an address manually to the table with the address: Multiplier, you should be able to set the value to one of your choosing.
[ENABLE]
// Ideally, you'll want to use an AOB injection so that the location can be found with subsequent restarts of the game.
alloc(newmem,2048)
alloc(Multiplier,4) // You didn't allocate any bytes for your stored value
label(returnhere)
label(originalcode)
label(exit)
registersymbol(Multiplier)
Multiplier:
dd 0
newmem:
push ebx
mov ebx,[Multiplier]
imul ebx, 0A
pop ebx
originalcode:
add dword ptr [edi+44],ebx
push 02
exit:
jmp returnhere
"recettear.exe"+8CD61:
jmp newmem
nop
returnhere:
[DISABLE]
dealloc(Multiplier) // Important to deallocate the allocated memory
dealloc(newmem)
If you add an address manually to the table with the address: Multiplier, you should be able to set the value to one of your choosing.
That worked as intended thanks, i perfectly understand what you did there it makes sense but why didn't my version of the code not work do you have any clue? Note: When i first wrote the code i didn't forget to allocate the 4 bytes so it has nothing to do with that.
That worked as intended thanks, i perfectly understand what you did there it makes sense but why didn't my version of the code not work do you have any clue? Note: When i first wrote the code i didn't forget to allocate the 4 bytes so it has nothing to do with that.
You're welcome . It's to my understanding that the imul instruction requires more instructions than a single line to actually compute the arithmetic, so we use a register to hold the calculated sum and then move that value to the intended place.