[Tutorial]Pointers and offsets part 2 - Double pointers (CE)
Posted: Fri Dec 11, 2009 6:46 pm
Since this is a frequently asked about topic, I decided to make a short tutorial. If you haven't already, you must first read part 1 that thoroughly explains the method that will be used again here. There are other methods around, but it is quickest, easiest, and almost always works.
First, let me explain what a double pointer is. It is a pointer that points to a pointer that points to a value. Sounds confusing, doesn't it? To simplify, you just need to repeat the process you've already done to get a pointer to what you've already found. That's it.
In this example, we have found the player's HP (which is currently 125) and resides at the address 0x3F408C68. After looking up the pointer to it (as per tutorial part 1 shows), we find that 0x20248844 + 0x8 points to 0x3F408C68. When we found the pointer (0x20248844), you probably noticed it was not showing as green in Cheat Engine - meaning it is not static.
Restarting the game, changing maps, or any other assortment of things could cause our pointer (0x20248844 + 0x8) to become invalid and point to something other than our player's HP. To get around this, we need to make a static pointer chain. This is simple enough. First, manually add 0x20248844 to Cheat Engine's address list (by clicking the button just above and to the right of the address list at the bottom of the window). Next, you'll find what points to it by following exactly the same method that tutorial 1 outlined.
Now, we should find the offset 0x4 and address (which is static!) 0x0040201C. That's all there is to it. Now, whenever we restart the game/change maps/etc., 0x0040201C + 0x4 will always point to <some changing address>, and <some changing address> + 0x8 points to our HP.
The below example is taken from Runes of Magic. The static pointer in this case is 0x00901990 + 0x58C, which points to 0x0424E58C. 0x0424E58C + 2CC points to 0x15712ACC. 0x15712ACC contains our player's HP: 305.
First, let me explain what a double pointer is. It is a pointer that points to a pointer that points to a value. Sounds confusing, doesn't it? To simplify, you just need to repeat the process you've already done to get a pointer to what you've already found. That's it.
In this example, we have found the player's HP (which is currently 125) and resides at the address 0x3F408C68. After looking up the pointer to it (as per tutorial part 1 shows), we find that 0x20248844 + 0x8 points to 0x3F408C68. When we found the pointer (0x20248844), you probably noticed it was not showing as green in Cheat Engine - meaning it is not static.
Restarting the game, changing maps, or any other assortment of things could cause our pointer (0x20248844 + 0x8) to become invalid and point to something other than our player's HP. To get around this, we need to make a static pointer chain. This is simple enough. First, manually add 0x20248844 to Cheat Engine's address list (by clicking the button just above and to the right of the address list at the bottom of the window). Next, you'll find what points to it by following exactly the same method that tutorial 1 outlined.
Now, we should find the offset 0x4 and address (which is static!) 0x0040201C. That's all there is to it. Now, whenever we restart the game/change maps/etc., 0x0040201C + 0x4 will always point to <some changing address>, and <some changing address> + 0x8 points to our HP.
The below example is taken from Runes of Magic. The static pointer in this case is 0x00901990 + 0x58C, which points to 0x0424E58C. 0x0424E58C + 2CC points to 0x15712ACC. 0x15712ACC contains our player's HP: 305.