Any small tips please for the Cheat Engine? Can't find the money variable, tried with "Exact Value" and all "Value Type" didn't got it.
I figured out how the values are represented in memory, using money as an example. It turns out that a custom floating-point representation is being used, which is why we CAN'T identify it easily. Now that we understand this, we can use memory search tools, like Cheat Engine, to search for these values in memory. Details are below:
Custom Floating-Point Representation (its not standard IEEE)
Sign Bit: Bit 31
Exponent Bits: Bits 30 to 20 (11 bits)
Mantissa Bits: Bits 19 to 0 (20 bits)
Formula:
Value = (−1)^Sign * 2^(Exponent−1023) * (1+Mantissa)
Explanation:
Sign Bit: Determines the sign of the value (0 = positive, 1 = negative).
Exponent: The exponent is stored with a bias of 1023, so to get the actual exponent, subtract 1023 from the stored exponent value.
Mantissa: The mantissa is the fractional part of the number, which is normalized by adding a leading 1 (implied by the format).
My trial and error examples:
Mem Value : SEEE EEEE EEEE MMMM MMMM MMMM MMMM MMMM : Value in game
1073741824 : 0100 0000 0000 0000 0000 0000 0000 0000 : 2
1074266112 : 0100 0000 0000 1000 0000 0000 0000 0000 : 3
0134742016 : 0000 1000 0000 1000 0000 0000 0000 0000 : 5.67865049360052 E-270
0001572864 : 0000 0000 0001 1000 0000 0000 0000 0000 : 3.3376107877608 E-308
0001056768 : 0000 0000 0001 0000 0010 0000 0000 0000 : 2.23235724802679 E-308
1074798592 : 0100 0000 0001 0000 0010 0000 0000 0000 : 4.03125
1074794496 : 0100 0000 0001 0000 0001 0000 0000 0000 : 4.015625
1080037376 : 0100 0000 0110 0000 0001 0000 0000 0000 : 128.5
1080041472 : 0100 0000 0110 0000 0010 0000 0000 0000 : 129
1080057856 : 0100 0000 0110 0000 0110 0000 0000 0000 : 131
1080090624 : 0100 0000 0110 0000 1110 0000 0000 0000 : 135
1080147968 : 0100 0000 0110 0001 1100 0000 0000 0000 : 142
1080279040 : 0100 0000 0110 0011 1100 0000 0000 0000 : 158
1080541184 : 0100 0000 0110 0111 1100 0000 0000 0000 : 190
1080098816 : 0100 0000 0110 0001 0000 0000 0000 0000 : 136
1080213504 : 0100 0000 0110 0010 1100 0000 0000 0000 : 150
1080377344 : 0100 0000 0110 0101 0100 0000 0000 0000 : 170
1080541184 : 0100 0000 0110 0111 1100 0000 0000 0000 : 190
1087176704 : 0100 0000 1100 1101 0000 0000 0000 0000 : 14848
1090021888 : 0100 0000 1111 1000 0110 1010 0000 0000 : 100000
Sample computation:
For 1090021888, the bits are: 0100 0000 1111 1000 0110 1010 0000 0000
Step 1: Extract the Sign, Exponent, and Mantissa
From the 32-bit binary representation:
0100 0000 1111 1000 0110 1010 0000 0000
Sign Bit: The first bit is 0, so the sign is positive.
Exponent Bits: Bits 30 to 20 are 100 0000 1111 (binary), which corresponds to 1039 in decimal.
Mantissa Bits: Bits 19 to 0 are 1000 0110 1010 0000 0000, which corresponds to the fractional part.
Step 2: Apply the Formula
Now, we apply the formula:
1. Sign:
The sign bit is 0, so the sign is positive: (-1)^0 = +1
2. Exponent:
The exponent value is 1039 (from the 11 exponent bits).
The exponent bias is 1023 (because we're using a custom format that seems to be based on double-precision's exponent bias).
The actual exponent is: 1039 − 1023 = 16
3. Mantissa:
The mantissa is represented by the 20 bits:
Mantissa Bits = 10000110101000000000 (binary)
In decimal, this is:
0.10000110101000000000 (binary) = (normalized as a fraction)
So, the mantissa in the formula is: 1+0.53125 = 1.53125
Step 3: Calculate the Final Value
Now, we can calculate the value using the formula:
Value = (+1) * 2^16 * 1.53125 = 100000
Final Answer:
Thus, the value represented by 1090021888 is 100,000.
Summary:
Binary Representation: 0100 0000 1111 1000 0110 1010 0000 0000
Sign: +1 (positive)
Exponent: 1039 - 1023 = 16
Mantissa: 1.53125 (derived from the mantissa bits)
Final Value: 100,000
So to find the value 100,000 in the game, you need to search for 1090021888 in memory.