Creating a cheat table - Health
This page is a sub page of: Creating a cheat table - Full guide
Now after a restart (and game reinstall, it's been a while) This is what my table looks like.
When looking for health I prefer to decrease it with falls so I don't get killed unexpectedly, but mostly we will need to decrease and increase the player health to find the value so make sure to have some Elixirs (first aid kits) to replenish your health. Now let's find a good place to start.
This looks good to me.
So lets start with planing, now some games use integers for health but most, newer, games use floating points. So we don't miss any thing let's use the All scan option, but I tend to change to settings as needed for any scan with type All.
To check the settings, on the Cheat Engine main form click Edit then select settings.
This will open the Cheat Engine settings form.
Now select Scan Options. And check to see that 4 Bytes, Float, and Double are checked.
Then let's start with an unknown initial value scan. Then decrease our health, by jumping off the ledge, and scan for a decreasing value.
Note: Some steps are glossed over, if more details for scaning are need please see:
Now I needed to refill my health after the first jump, so then I scanned for an increasing value, then just keep repeating, with some unchanged value scans to weed done the addresses.
Now with my found addresses down to 66, I fill my health, and start looking for nice round numbers that look good.
So here I have some 4 byte values at 70, floats at 1, and some doubles at 100. Now I am guessing that the floats with values of 1 are just for the displayed health meter, and there really is no good reason to use doubles for player health. So lets freeze the 4 byte values, and test.
Now when I tested my meter decreased, but I was unable to fill it so I am thinking that the health address is one of these. We could even hack the display value just for appearances, but an injection script can set the at just the right time to fix the display issue so let's just keep going for now (but you may want to test or hold on the the rest of the address for later).
So now just like with the player coordinates freeze one at a time tell you find the player health address. Or just set the value below the filled value and see if you can fill your health. And if the values is overwritten then it's not the right one.
Now that we have the player health address, lets see what accesses this address.
Now let's look at some numbers. Here we can see that the player health has an offset of +344 and uses the base address stored in the player coordinates hook.
So just add a new pointer, using the ptrCoordBase from the player coordinates, with an offset of +344.
So now we have the player health, and from here using dissect data structure may help find more values.
Now that we seem to have a good base address and some values, try to find the Mana address your self.
Hint: It is in the same structure as health, oxygen, and coordinates.
So time for some real fun, on to the hooks and hacks.