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 


What type is this value REALLY???

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
relentlesstech
Cheater
Reputation: 1

Joined: 02 Sep 2018
Posts: 44
Location: Rhode Island, USA

PostPosted: Thu Jan 17, 2019 8:15 am    Post subject: What type is this value REALLY??? Reply with quote

Game: Wreckfest (x64)

I am trying to create a 'no damage' script, but the value I am finding for my health is a 4-byte value (Example: 1183749098) - However, once found, and switched to 'float', the value would be a more 'normal' value (Example: 3050.211) - My question are:

1. What kind of conversion is being done to the value from 4-byte to float?

2. How can I create a custom scan type to find these values?

Thank you in advance!

_________________
.: Cheat Engine N00b in Progress :.

I'll earn my avatar someday ...
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1586

PostPosted: Thu Jan 17, 2019 8:28 am    Post subject: Reply with quote

1. no conversion is done, this is how you tell cheat engine to read the value in order to display it.
however, single/double precision floating point values are encoded differently.

2. you dont need a custom scan type, just change the "value type" to float and start scanning.

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
relentlesstech
Cheater
Reputation: 1

Joined: 02 Sep 2018
Posts: 44
Location: Rhode Island, USA

PostPosted: Thu Jan 17, 2019 9:12 am    Post subject: Reply with quote

Let me word this differently - If I search for 'health' via changed/unchanged as a float, none of the results I get are my actual health - The only way I can find it is by doing a 4-byte scan changed/unchanged, then it shows up in the list - Once I add it to my address list, and change to float, the value is 'readable' - This only started being an issue after the latest game update three days ago.

As for no conversion occurring, two lines up from where the actual health value changes, is this:

Code:
cvtdq2ps xmm0,xmm0


I am assuming that is converting the integer to float value, correct?

_________________
.: Cheat Engine N00b in Progress :.

I'll earn my avatar someday ...
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4696

PostPosted: Thu Jan 17, 2019 9:36 am    Post subject: Reply with quote

relentlesstech wrote:
Let me word this differently - If I search for 'health' via changed/unchanged as a float, none of the results I get are my actual health - The only way I can find it is by doing a 4-byte scan changed/unchanged, then it shows up in the list - Once I add it to my address list, and change to float, the value is 'readable' - This only started being an issue after the latest game update three days ago.
PEBKAC.

For better advice, please show actual examples (not values you make up) as well as all the instructions between cvtdq2ps and the write to the address.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1586

PostPosted: Thu Jan 17, 2019 9:37 am    Post subject: Reply with quote

yes correct, but it do covert packed DWORD to packed single-precision floating point.

one thing to note here:
1183749098 is not 3050.211

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
relentlesstech
Cheater
Reputation: 1

Joined: 02 Sep 2018
Posts: 44
Location: Rhode Island, USA

PostPosted: Thu Jan 17, 2019 11:51 am    Post subject: Reply with quote

It took me a while to find the health value again (Could not find a pointer that worked consistently) - The 4-byte health value is '1142292480', which is egual to '600' as float - Searching for '600' as a float value does not list the correct address ...

Here is the disassembly screenshot (Highlighted line is where health is changed):



Image2.jpg
 Description:
Disassembly screenshot
 Filesize:  54.7 KB
 Viewed:  2594 Time(s)

Image2.jpg



_________________
.: Cheat Engine N00b in Progress :.

I'll earn my avatar someday ...
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1586

PostPosted: Thu Jan 17, 2019 1:01 pm    Post subject: Reply with quote

are you sure you are searching properly? because float 600.00 is equal to 1142292480 in base10 form. (so its already encoded)

and i bet you cant search for 600 as 4 bytes, because (as it appears) value is kept inside xmm registers (whether a conversion is made or not) and probably the game reads it as float as well.

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
relentlesstech
Cheater
Reputation: 1

Joined: 02 Sep 2018
Posts: 44
Location: Rhode Island, USA

PostPosted: Thu Jan 17, 2019 1:33 pm    Post subject: Reply with quote

Interestingly enough, I just downgraded to CE v6.8.1, and in 7 scans I had the correct addresses as float - I'm wondering if it was just a glitch in the new version o.O
_________________
.: Cheat Engine N00b in Progress :.

I'll earn my avatar someday ...
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4696

PostPosted: Thu Jan 17, 2019 1:49 pm    Post subject: Reply with quote

The cvtdq2ps instruction is unrelated- xmm0 gets overwritten by the read from the address.

(float)600 reinterpreted as an int is 1142292480.

This works perfectly fine for me using CE 6.8.2. I still think you didn't do the scans properly. Perhaps a rounding error, lag between GUI and value updates, or discrepancies in memory scan options.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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