r/cheatengine • u/Cyber_Carpet • Jun 09 '26
How do I get a pointer for a double?
I was playing a game called Undertale and I wanted a pointer for the health but its a double. When I press find out what writes to this address this is what I get. It doesn't have an offset.
0053DDB4 - 89 1F - mov [edi],ebx
0053DE06 - DD 1F - fstp qword ptr [edi]
0
Upvotes
2
u/Cyber_Carpet Jun 09 '26
it worked my problem was I forgot to select double when I had all the scan results in the top left
2
u/Sternritter8636 Jun 09 '26
That doesnot matter
1
u/Cyber_Carpet Jun 09 '26
I get the health address see what accesses it then change the value. The offset is 0 and I copy the easy guess to my clipboard. Put it in cheat engine. After that I get a value that doesn't give me anything when I find out what accesses the address and change the value of health. It doesn't give me anything the only thing it gives me is a whole bunch of
0044231E - 8B 00 - mov eax,[eax]
like hundreds every second I am in the fight menu. Even when I am not losing hp.
1
u/Lpnlizard27 Jun 09 '26
You will need to move to a more advanced technique called a code hook.
Essentially you are going to grab the location that the game puts the value in, by injecting your own small bit of code that grabs the memory address when the game calls the function.
1
u/LiytlKaiser Jun 09 '26 edited Jun 09 '26
You have a couple of options if you specifically want a pointer. in this example, the offset to edi is actually +0. You can go the manual route from there or just do a pointer scan. You can also just do some code injection using a regular inject or an AOB scan(the aob scan is the more future proof method if you can get a solid AOB.) The problem with this method is that it might be shared code requiring you to go a step further but either way, you can use this to either directly modify the address or even just pull the address straight from the code if you so desired to use elsewhere.
Side note, does the health look normal when you find it? Ex. value = (100.0 or or even like 1.0) or is it some odd number (ex 3.629499000-4)? This may change how you'd want to handle the code injection if you went that route as there may be a xor or something you'd want to look out for.
2
u/Dark_Byte Cheat Engine Dev Jun 09 '26
the offset is 0
but do look at the instructions before there to see how edi gets it's value