View previous topic :: View next topic |
Author |
Message |
rain-13 Expert Cheater
Reputation: 0
Joined: 18 Mar 2009 Posts: 101
|
Posted: Wed Mar 29, 2023 12:02 pm Post subject: Need help finding pointer of array. |
|
|
Hi!
I am not exactly sure but I think I have array of arrays of objects. Here is a picture.
First address points to some array whose first member (+4 offset) some object. In tn this case this object is car in GTA 1 and offset f7 points to car's damage. For some other car the idea is the same - the first offset from bottom is still +4 but initial address is different.
How do I find the pointer to that array itself? Cheat Engine tells me this:
But when I search game memory for 000E0750 then I get 0 results. But also when I try to Add Address Manually and type 000E0750 then it also shows question marks so 000E0750 doesn't seem to be base pointer either.
How do I find base pointer of this array?
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 128
Joined: 06 Jul 2014 Posts: 4079
|
Posted: Wed Mar 29, 2023 3:14 pm Post subject: |
|
|
The array is static. There is no base pointer to the array.
If you're trying to find your car in particular, maybe try finding a different pointer path or search for the array index of your car (e.g. eax = 0xD29)
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
rain-13 Expert Cheater
Reputation: 0
Joined: 18 Mar 2009 Posts: 101
|
Posted: Wed Mar 29, 2023 6:12 pm Post subject: |
|
|
But what does 000E0750 mean then?
And what do you mean by array is static? I mean if I restart game then the first element of array can still be at different location? For example if before array there is some dynamic memory allocation that affects where array is created?
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 128
Joined: 06 Jul 2014 Posts: 4079
|
Posted: Wed Mar 29, 2023 8:12 pm Post subject: |
|
|
It's an automated guess made by CE. If there is a pointer to the address being accessed, the pointer's value is probably the guess made by CE. In this case, there's little reason to have a pointer to that address since it's static. Also it looks like CE guessed wrong...
"The array is static" means the array is stored in the exe (i.e. at game.exe+E0750). Every time you launch the game, the array will always be stored at that address.
Elements of a data structure can be added to that data structure in an indeterminate / random order. Just because the array is static doesn't mean anything for the stuff stored in the array. e.g. maybe whenever the game randomly spawns in a car, it gets a spot in the array. Since spawning cars is random, the index of its pointer in this array is effectively random as well.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
rain-13 Expert Cheater
Reputation: 0
Joined: 18 Mar 2009 Posts: 101
|
Posted: Thu Mar 30, 2023 12:13 pm Post subject: |
|
|
Tnx.
Should I then expect that game.exe+E0750 is always first element of array (i.e array[0])?
In my case even if I use it as normal 4 byte in it's still ??? instead of value. So that guess is just total garbage?
In my last screenshot, do I understand correctly that eax is the index of array? Specially since it's eax*4? So to get array[0] I should just substract D29*4 from currently found pointer?
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 128
Joined: 06 Jul 2014 Posts: 4079
|
Posted: Thu Mar 30, 2023 2:10 pm Post subject: |
|
|
`game.exe+E0750` is the first element of the array: index 0. `game.exe+E0750+D29*4` is the element at index 3369 (0xD29).
I don't know why some elements might be invalid. There's an infinite number of possible causes. Maybe when the game despawns a car, it sets the element to null. Maybe the array stores a pointer to a union and it doesn't just store cars. Maybe the elements are bigger than a single pointer (`shl eax,7` / `add eax,ecx` are interesting).
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
|