View previous topic :: View next topic |
Author |
Message |
Artem111 How do I cheat? Reputation: 0
Joined: 01 Jun 2018 Posts: 2
|
Posted: Fri Jun 01, 2018 8:19 am Post subject: Multiplying a Float Before Storing It |
|
|
Let's say I have something like
Code: | fstp dword ptr [esi+0000019C]
jmp return |
How do I get it to multiply the float value by 5 before it stores it?
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Fri Jun 01, 2018 2:44 pm Post subject: |
|
|
iirc this will work Code: | push (float)5
fmul dword ptr [esp]
add esp, 4 // add rsp, 8? I think x64 always does 8 byte push not 4...
fstp dword ptr [esi+0000019C]
jmp return |
You can't just say fmul 5 unfortunately, you have to store the value you want to multiply by somewhere, in the code above you just push it on the stack, read from the stack, and then remove the value from the stack (pop would be easier if x64 does always do 8 byte pushes but it'd require having a register you don't mind overwriting)
_________________
|
|
Back to top |
|
|
Artem111 How do I cheat? Reputation: 0
Joined: 01 Jun 2018 Posts: 2
|
Posted: Sat Jun 02, 2018 8:05 am Post subject: |
|
|
FreeER wrote: | iirc this will work Code: | push (float)5
fmul dword ptr [esp]
add esp, 4 // add rsp, 8? I think x64 always does 8 byte push not 4...
fstp dword ptr [esi+0000019C]
jmp return |
You can't just say fmul 5 unfortunately, you have to store the value you want to multiply by somewhere, in the code above you just push it on the stack, read from the stack, and then remove the value from the stack (pop would be easier if x64 does always do 8 byte pushes but it'd require having a register you don't mind overwriting) |
It does work but it doesn't seem to do what I wanted it to do.
Is doing that on the player speed address a bad way to move faster?
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Sat Jun 02, 2018 8:19 am Post subject: |
|
|
Would work in some games fine, apparently not in that one /shrug
_________________
|
|
Back to top |
|
|
|