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 to get address units that are created in the 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: 173

PostPosted: Thu Apr 23, 2020 12:45 pm    Post subject: How to get address units that are created in the game? Reply with quote

Im learning how to reverse engineer with Age of Empires. And old RTS.
I have already learned lots of cool things.

But im stuck in a step. It seems i cant get pointers to specific units. Because they are created in game.

So it seems their addresses are created and are non existent at first.

So how am i going to get a pointer for them? Seems quite hard.

Following my noob intuition. I think the way to go would be, to get to the pointer of whatever it is that creates units. Or whatever it is that registers the new units.

Then make a script that registers these addresses. And then reorganizes them. And finds the other important addresses. Like unit hp. Etc...

Can anyone help me with this pls?
Back to top
View user's profile Send private message
happyTugs
Cheater
Reputation: 0

Joined: 23 Apr 2020
Posts: 26

PostPosted: Mon Apr 27, 2020 6:15 am    Post subject: How to get address units that are created in the game? Reply with quote

Quote:
Because they are created in game.

You are correct.
Every time you spawn a unit, you instantiate an object(i.e the unit) from a class(i.e Archer, Solider, Warrior,etc.).
Therefore, it's difficult to find pointers to these units since these objects are presumably destroyed when they die, or when you restart the game.
Quote:
So how am i going to get a pointer for them? Seems quite hard.

Instead of finding pointers, try to find the instruction, or opcode, that accesses the value of interest.
Afterwards, make a script from there.

_________________
This is a block of text that can be added to posts you make. There is a 300 character limit
Back to top
View user's profile Send private message
LongBeardedLion
Expert Cheater
Reputation: 0

Joined: 10 Apr 2020
Posts: 173

PostPosted: Mon Apr 27, 2020 11:34 am    Post subject: Reply with quote

Thanks.

So for example if i want to make a script that accesses all the Archers that i have selected.

I need to first find the pointer for the type of unit: Archers.

And then somehow automate a script so that it gets all the archers created? By searching for them and storing them in an array?

I tried doing this but it seems that the creation of units. Meaning the address that they are assigned to is completely random, and follows no pattern. So i cant predict the offset of the unit.

Sounds extremelly complex.

Or the solution has more to do with Ultimap ? Or code filter?

There is another messy alternative, that is. I found the pointer that accesses the selected unit. Meaning if any selected unit. Will give me its position in that pointer.

So what i can do is. Code a script even if outside of cheat engine. With lets say AHK. And make it so that when i fire the script. It goes through all the units i have selected and gets all their addresses. Its messy and not the best route. But its still an alternative.

The best thing would be. To be able to get the address of every single archer right at the spot and time they are created. Without so much complications.

Pls help me.
Back to top
View user's profile Send private message
happyTugs
Cheater
Reputation: 0

Joined: 23 Apr 2020
Posts: 26

PostPosted: Mon Apr 27, 2020 7:07 pm    Post subject: Reply with quote

Quote:
I need to first find the pointer for the type of unit: Archers.
I think there's a misconception here. A pointer references a location in memory. I think you meant to say the instructions, or opcodes, that pertain to the units themselves whether it be health, or their stats in general.
Quote:
Meaning the address that they are assigned to is completely random, and follows no pattern. So i cant predict the offset of the unit.
These addresses are random as they are dynamic addresses and will change every time you restart the game.

Alternatively, if you can't find those values, then perhaps modify your resources, construction, research, etc. instead, which ultimately allows you to make such units.

_________________
This is a block of text that can be added to posts you make. There is a 300 character limit
Back to top
View user's profile Send private message
LongBeardedLion
Expert Cheater
Reputation: 0

Joined: 10 Apr 2020
Posts: 173

PostPosted: Mon Apr 27, 2020 11:59 pm    Post subject: Reply with quote

>Alternatively, if you can't find those values, then perhaps modify your resources, construction, research, etc. instead, which ultimately allows you to make such units.


That sounds like a job for Function Hacker? Or with cheat engine, Ultimap. But Ultimap does not work in my laptop Sad.

What else can i do?
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: Tue Apr 28, 2020 2:07 am    Post subject: Reply with quote

Find the code that accesses a unit (doesn't have to be a write)
Then hook there to get the addresses of all units in the game

You'll have to find a way to distinguish between unit types and team. Use dissect data and compare structure for that

Also, selection is usually a pointer or pointer array. You can use a pointerscan for that and once you've found some pointers, see what happens when you adjust one of the offsets

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