 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Homtaro How do I cheat?
Reputation: 0
Joined: 02 Apr 2022 Posts: 5
|
Posted: Sat Apr 02, 2022 5:26 pm Post subject: Damage multiplier script [South Park Stick Of Truth] |
|
|
So i barely found damage calculation opcode (at least i think so), but it is odd.
It looks like this:
| Code: | | subss xmm0,[ebp-18] |
I got used to something like! or | Code: | | movss xmm6,[rsp+40] | So i got stuck there, because i dont know what to do with [ebp-18] (it is damage, i changed it for my temporary float value and health decreased by the amount that float was containing, also i noticed that somewhere there is xmm3 which also is damage with double value type. I didn`t find it anywhere in opcodes so I guess it doesn`t matter). I think that should be relatively easy to solve, but it seems to me that I wasted all of my braincells to find opcode. Any help will be appreciated!
|
|
| Back to top |
|
 |
TsTg Master Cheater
Reputation: 5
Joined: 12 Dec 2012 Posts: 340 Location: Somewhere....
|
Posted: Sat Apr 02, 2022 8:42 pm Post subject: |
|
|
there are multiple ways to do it:
-you can directly modify the [ebp-18] before the subss xmm0 line is executed, using
| Code: | mov [ebp-18],0
subss xmm0,[ebp-18] |
-or since xmm0 points to current health, you can also NOP that instruction, which will prevent the subtraction of the damage value
-as for the xmm3 register, you can try overwrite it the same way as above, but using
-another way is to locate a instruction like mov [ebp-18],something, and modify that to be a zero
|
|
| Back to top |
|
 |
Homtaro How do I cheat?
Reputation: 0
Joined: 02 Apr 2022 Posts: 5
|
Posted: Sun Apr 03, 2022 2:26 am Post subject: |
|
|
| TsTg wrote: | there are multiple ways to do it:
-you can directly modify the [ebp-18] before the subss xmm0 line is executed, using
| Code: | mov [ebp-18],0
subss xmm0,[ebp-18] |
-or since xmm0 points to current health, you can also NOP that instruction, which will prevent the subtraction of the damage value
-as for the xmm3 register, you can try overwrite it the same way as above, but using
-another way is to locate a instruction like mov [ebp-18],something, and modify that to be a zero |
But how do I multiply [ebp-18]?
I tried | Code: | push eax
mov eax,[ebp-18]
imul eax,2
mov [ebp-18],eax
pop eax
subss xmm0,[ebp-18] |
But something goes wrong on multiplication stage, value gets messy, probably because of []. Even shr or shl dont work.
|
|
| Back to top |
|
 |
TheyCallMeTim13 Wiki Contributor
Reputation: 51
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Sun Apr 03, 2022 3:06 am Post subject: |
|
|
| Code: | sub esp,4
mov [esp],(float)2
fld dword ptr [ebp-18]
fmul dword ptr [esp]
fstp dword ptr [ebp-18]
add esp,4
subss xmm0,[ebp-18] |
_________________
|
|
| Back to top |
|
 |
TsTg Master Cheater
Reputation: 5
Joined: 12 Dec 2012 Posts: 340 Location: Somewhere....
|
Posted: Sun Apr 03, 2022 3:06 am Post subject: |
|
|
| Homtaro wrote: |
But how do I multiply [ebp-18]?
I tried | Code: | push eax
mov eax,[ebp-18]
imul eax,2
mov [ebp-18],eax
pop eax
subss xmm0,[ebp-18] |
But something goes wrong on multiplication stage, value gets messy, probably because of []. Even shr or shl dont work. |
basically it get messy because the imul instruction treats the given numbers as integers, not float, so we use the fmul instruction instead.
in that case, [ebp-18] is already a float value, so we just convert a integer value of 2 into a float, then do the multiplication as stated by TheyCallMeTim13 above.
Last edited by TsTg on Sun Apr 03, 2022 3:35 am; edited 3 times in total |
|
| Back to top |
|
 |
Homtaro How do I cheat?
Reputation: 0
Joined: 02 Apr 2022 Posts: 5
|
Posted: Sun Apr 03, 2022 3:22 am Post subject: |
|
|
| Thx you very much! Now it works. Also appreciate explanation of how that works.
|
|
| 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
|
|