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 


Help me understanding subroutine (asm)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
z13swee
Newbie cheater
Reputation: 0

Joined: 12 Mar 2017
Posts: 12

PostPosted: Sun Oct 22, 2017 9:16 pm    Post subject: Help me understanding subroutine (asm) Reply with quote

So i are in search for the base address of the players health in this game. I think i have found the subroutine for takeing damage.
This code in the image is run every time players takes a hit. And if i replace the subss instruction with codes that does nothing, no health is taken from player.

I guess the health is a float? is that common? becuse movss,subss are float number instruction i read somewhere.. and xmm0 is a 128bit register commonly used for float, i also read somewhere.. Smile

This subroutine is changing 3 bytes i memory ( found in ecx register when pop'ed ), but what i cant figure out is how those 3 bytes converts to the players health ingame?

Becuse when the 3 bytes are: 99 189 74 then ingame health is 11..

And when the 3 byts are: 196 234 31 is 31 ingame..

How does it caculate that?



asmSub.png
 Description:
 Filesize:  15.92 KB
 Viewed:  984 Time(s)

asmSub.png


Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 120

Joined: 09 Jun 2013
Posts: 3260

PostPosted: Sun Oct 22, 2017 10:07 pm    Post subject: Reply with quote

The game is encrypting the value with:
Code:
xor E30671AC

Your address is 4 bytes long, not 3. Yes, it is a float.
I can't make any sense out of the 3 bytes you posted.

Float 31 in hex notation is 41F80000.
XOR with E30671AC and get A2FE71AC.

If you switch your health address to display as hex,
paste A2FE71AC in and you should now have 31 health.
Back to top
View user's profile Send private message
z13swee
Newbie cheater
Reputation: 0

Joined: 12 Mar 2017
Posts: 12

PostPosted: Mon Oct 23, 2017 12:00 pm    Post subject: Reply with quote

Thank you for answering.

I did put A2FE71AC in the 4 bytes, and i then got 3100 health ingame. wich is great Very Happy

I hafto look into how float hex notaion works Smile
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