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 


Need help finding pointer of array.

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

Joined: 18 Mar 2009
Posts: 106

PostPosted: Wed Mar 29, 2023 12:02 pm    Post subject: Need help finding pointer of array. Reply with quote

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
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 137

Joined: 06 Jul 2014
Posts: 4250

PostPosted: Wed Mar 29, 2023 3:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
rain-13
Expert Cheater
Reputation: 0

Joined: 18 Mar 2009
Posts: 106

PostPosted: Wed Mar 29, 2023 6:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 137

Joined: 06 Jul 2014
Posts: 4250

PostPosted: Wed Mar 29, 2023 8:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
rain-13
Expert Cheater
Reputation: 0

Joined: 18 Mar 2009
Posts: 106

PostPosted: Thu Mar 30, 2023 12:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 137

Joined: 06 Jul 2014
Posts: 4250

PostPosted: Thu Mar 30, 2023 2:10 pm    Post subject: Reply with quote

`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
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