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 


how do pointers work?

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

Joined: 05 Nov 2014
Posts: 130

PostPosted: Fri Aug 07, 2015 3:24 pm    Post subject: how do pointers work? Reply with quote

I know what they do and how to find them, but how do they work?

I am currently thinking that they work like this:
"Cube.exe"+003691C8 (example)
- first of all the process name so it knows where to start in the memory (cube.exe in this case)
- right behind some hex idk what it does (+003691C8 in this case)
- then the offsets which determine how many bits go to ahead from this point to find the specific address

Is this correct or did I understand that wrong?
In case it's correct, what's the purpose of multiple offsets?
In case I'm wrong, how do they work?
also what are those hex numbers behind the process name?

I found tons of threads and tutorials explaining what pointers are and how to find them, but none that explains how they work...
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Aug 07, 2015 3:44 pm    Post subject: Reply with quote

"Cube.exe" is the base address of the game, as you said.
003691C8 is a hex value added on to the base game address.
The total gives you another memory address containing some value.
That value happens to be another game address, usually a structure of some sort.
The next offset is added to that value to take you to a corresponding variable within that structure.
That variable could be yet another game address which is added to yet another offset.
Back to top
View user's profile Send private message
LastExceed
Expert Cheater
Reputation: 1

Joined: 05 Nov 2014
Posts: 130

PostPosted: Fri Aug 07, 2015 3:46 pm    Post subject: Reply with quote

Zanzer wrote:
"Cube.exe" is the base address of the game, as you said.
003691C8 is a hex value added on to the base game address.
The total gives you another memory address containing some value.
That value happens to be another game address, usually a structure of some sort.
The next offset is added to that value to take you to a corresponding variable within that structure.
That variable could be yet another game address which is added to yet another offset.


wait, so basically the hex behind the base address is also just some sort of offset? i'm confused
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Aug 07, 2015 4:40 pm    Post subject: Reply with quote

That is correct.

[[Cube.exe+003691C8]+64]+8
Base address of Cube.exe plus 0x003691C8 = Address 1
Value at Address 1 plus 0x64 = Address 2
Value at Address 2 plus 0x8 = Address 3
Back to top
View user's profile Send private message
LastExceed
Expert Cheater
Reputation: 1

Joined: 05 Nov 2014
Posts: 130

PostPosted: Fri Aug 07, 2015 4:41 pm    Post subject: Reply with quote

Zanzer wrote:
That is correct.

[Cube.exe+003691C8]+64]+8
Base address of Cube.exe plus 0x003691C8 = Address 1
Value at Address 1 plus 0x64 = Address 2
Value at Address 2 plus 0x8 = Address 3


and using multiple offsets is just for bringing structure into the system? because I realized that instead of e.g. 4 offsets you can use 1 big offset...
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Aug 07, 2015 5:00 pm    Post subject: Reply with quote

You can add any number to the base game address and reach your current address.
However, if that's not an actual game structure, it's not going to find the correct address when you restart the game.

Using my previous numbers as an example:
Cube.exe+003691C8 may point to a game structure for the HUD.
Part of that structure, at offset 64, is the address to the player structure.
Then inside that structure, at offset 8, is the player's current health address.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25785
Location: The netherlands

PostPosted: Fri Aug 07, 2015 5:27 pm    Post subject: Reply with quote

Quote:

and using multiple offsets is just for bringing structure into the system?

No, not at all.

[[Cube.exe+003691C8]+64]+8 is not the same as Cube.exe+003691C8+64+8

To use it:
Read the 4/8 byte value at Cube.exe+003691C8
Add 0x64 to that value and call it B
Read the 4/8 byte value at the address B represents
Add 0x8 to that value and call it C

C now contain the address you're interested in


And as always: http://forum.cheatengine.org/viewtopic.php?t=422516 and http://forum.cheatengine.org/viewtopic.php?p=5280115#5280115

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
gameplayer
Advanced Cheater
Reputation: 2

Joined: 26 Jun 2011
Posts: 97
Location: Vietnam

PostPosted: Fri Aug 07, 2015 8:49 pm    Post subject: Reply with quote

One of the most important problems the game must care about is the memory management. The game will allocate some memory to run and part of it is used for non-gaming purposes. Even the memory which is used for gaming purposes usually can't be allocated consecutively, i.e the game has several separated memory areas physically. So the programmers need to mark all dynamic allocated memory areas by the pointers. The memory is used for may purposes, so it must be divided into many parts. For example, some of them may be used for background settings, game settings, calculations, data storage. In addition, the game commonly has a complex system of units. Each unit may be constructed by one big structure. However, some information of that unit possibly changes during game play. Therefore, the game dynamically allocates the new memory area for each of the units. Since the many memory areas can not be followed the desirable order, many offsets must be used to link many addresses that seem to be unrelated.
P.S: I can't explain more details because of my bad English.
Back to top
View user's profile Send private message
LastExceed
Expert Cheater
Reputation: 1

Joined: 05 Nov 2014
Posts: 130

PostPosted: Sat Aug 08, 2015 2:52 am    Post subject: Reply with quote

Dark Byte wrote:
Quote:

and using multiple offsets is just for bringing structure into the system?

No, not at all.

[[Cube.exe+003691C8]+64]+8 is not the same as Cube.exe+003691C8+64+8

To use it:
Read the 4/8 byte value at Cube.exe+003691C8
Add 0x64 to that value and call it B
Read the 4/8 byte value at the address B represents
Add 0x8 to that value and call it C

C now contain the address you're interested in


And as always: http://forum.cheatengine.org/viewtopic.php?t=422516 and http://forum.cheatengine.org/viewtopic.php?p=5280115#5280115


thank you DB, short and simple as always. Also thanks for those links, I was looking for them but couldn't find them between all those pointer finding guides.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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