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 


Getting List of units that exist in game

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

Joined: 10 Apr 2020
Posts: 172

PostPosted: Sat May 30, 2020 10:04 am    Post subject: Getting List of units that exist in game Reply with quote

im learning cheat engine using age of empires 2, an old rts. I have been trying to get just the list of units. Preferably differentiated by type.

I got the pointer of the health of the unit as you suggest in many threads. And as you can see in the screenshot, it shows the HP address, that changes the unit HP. This pointer works for the unit that you have currently selected, so i dont know if this could be a problem? But its good because i get any unit i select hp address etc...

Then the two previous addresses in the pointer, namely the 11B91158, and the 11B90FB0, change according to the unit selected, to similar addresses, i select another unit closeby and it shows this other address everytime i select it: 11BA2B28, and 11BA2980, so i assume these are the units name and object.

I plug them in the data dissector, and they are similar showing the HP, and also other things like the unit coordinates.

I tried to go back to the previous addresses and the initial static address, in this case "empires2.exe"+0033E29C to see if i could find a list of units registered somewhere. But could not find the list of units.

So what should i do to access the list of all my units names? Perhaps should look into Reclass?



unit hp.jpg
 Description:
 Filesize:  210.88 KB
 Viewed:  1407 Time(s)

unit hp.jpg



unit list 2.jpg
 Description:
 Filesize:  48.64 KB
 Viewed:  1407 Time(s)

unit list 2.jpg



unit list 3.jpg
 Description:
 Filesize:  570.55 KB
 Viewed:  1407 Time(s)

unit list 3.jpg



unit list 4.jpg
 Description:
 Filesize:  531.99 KB
 Viewed:  1407 Time(s)

unit list 4.jpg


Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4291

PostPosted: Sat May 30, 2020 11:16 am    Post subject: Reply with quote

That's a looping pointer path. That base address points directly to the unit structure.

Search for pointers to the unit structures (4 byte hex search "11B91158" / "11BA2B28"). For all the results that come up, check to see if they look to be in some sort of container (array, linked list, binary tree...). If none of them look like a container, repeat this process recursively until you find something.

_________________
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
LongBeardedLion
Expert Cheater
Reputation: 0

Joined: 10 Apr 2020
Posts: 172

PostPosted: Sat May 30, 2020 12:17 pm    Post subject: Reply with quote

Thank you ParkourPenguin.

I found a couple of addresses when searching for hex 4 bytes the address of the unit. But i have no idea how do i check if it is in a container (array, binary tree).

Do i have to go to each one of these addresses and check what writes to them? So that then i see what points to them? And try to find the group of addresses of units? Or im just being dumb? And its another way?

I also found another pointer that points to the same health address.

I post some more images that might give a hint of what should be the next approach?



unit hp.jpg
 Description:
 Filesize:  147.36 KB
 Viewed:  1388 Time(s)

unit hp.jpg



unit hp 2.jpg
 Description:
 Filesize:  262.35 KB
 Viewed:  1388 Time(s)

unit hp 2.jpg


Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4291

PostPosted: Sat May 30, 2020 1:20 pm    Post subject: Reply with quote

LongBeardedLion wrote:
But i have no idea how do i check if it is in a container (array, binary tree).
Look at the data structure the pointer is in and find semantic meaning in the other values. Arrays should be a contiguous sequence of elements, linked lists have pointers to the next/previous elements, binary trees have pointers to children and parent nodes, etc.
Perhaps you should learn a lower level language and see how such data structures are implemented. Or learn about basic data structures first- there's plenty of courses uploaded to youtube.

There's no way to guess using any/all of those images if one of those nodes goes through a container. I do see you're still using that useless looping path, however.

_________________
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
LongBeardedLion
Expert Cheater
Reputation: 0

Joined: 10 Apr 2020
Posts: 172

PostPosted: Sun May 31, 2020 8:05 am    Post subject: Reply with quote

Thanks ParkourPenguin.

I thought this would be simple. Apparently is not. Ok i will learn data structures before i come back here again. I heard that ReClass can help with this. What do you think?

What about that useless loop that im still using? What are you referring to?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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