Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Damage multiplier script [South Park Stick Of Truth]

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Homtaro
How do I cheat?
Reputation: 0

Joined: 02 Apr 2022
Posts: 5

PostPosted: Sat Apr 02, 2022 5:26 pm    Post subject: Damage multiplier script [South Park Stick Of Truth] Reply with quote

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!
Code:
add ax,si
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
View user's profile Send private message
TsTg
Master Cheater
Reputation: 5

Joined: 12 Dec 2012
Posts: 340
Location: Somewhere....

PostPosted: Sat Apr 02, 2022 8:42 pm    Post subject: Reply with quote

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
Code:
xorps xmm3,xmm3


-another way is to locate a instruction like mov [ebp-18],something, and modify that to be a zero
Back to top
View user's profile Send private message
Homtaro
How do I cheat?
Reputation: 0

Joined: 02 Apr 2022
Posts: 5

PostPosted: Sun Apr 03, 2022 2:26 am    Post subject: Reply with quote

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
Code:
xorps xmm3,xmm3


-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
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 51

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Sun Apr 03, 2022 3:06 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
TsTg
Master Cheater
Reputation: 5

Joined: 12 Dec 2012
Posts: 340
Location: Somewhere....

PostPosted: Sun Apr 03, 2022 3:06 am    Post subject: Reply with quote

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
View user's profile Send private message
Homtaro
How do I cheat?
Reputation: 0

Joined: 02 Apr 2022
Posts: 5

PostPosted: Sun Apr 03, 2022 3:22 am    Post subject: Reply with quote

Thx you very much! Now it works. Also appreciate explanation of how that works.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites