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 


Dealing with dynamically allocated pointers

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
ulysse31
Master Cheater
Reputation: 2

Joined: 19 Mar 2015
Posts: 324
Location: Paris

PostPosted: Tue Apr 21, 2015 4:49 pm    Post subject: Dealing with dynamically allocated pointers Reply with quote

Hi,
As title states, I require guidance on this matter, here is the code that writes to my mouse coordonates Y axis in a game :

01123195 - 89 07 - mov [edi],eax

obviously holds the value pointing to my mouse coordonate.
I want to automatically retrieve this value.
So far i wrote a code that executes after mov [edi),eax :
mov [0204B7E9),edi

// sorry about the ) but my bracket key just bailed on me.

then i retrieve the value of edi from 0204B7E9 with my c++ program and i update my c++ pointer with it however, I'd like if there is a more efficient way to do so, even if it is complicated / hard / time consuming, I don't mind.
Thx
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Apr 21, 2015 6:28 pm    Post subject: Reply with quote

That is the normal way I save dynamic addresses.
How more efficient can it be than to just set the value to the address? Smile

Unless, of course, 0204B7E9 wasn't the address of your C++ variable.
Back to top
View user's profile Send private message
ulysse31
Master Cheater
Reputation: 2

Joined: 19 Mar 2015
Posts: 324
Location: Paris

PostPosted: Wed Apr 22, 2015 2:47 pm    Post subject: Reply with quote

Well,
I was looking for a way to maybe pattern scan dinamically allocated variable.

I'm a novice so sometimes i discover new things i hadn't thought existed and I wish I'd known earlier.

Either way.. When the code accesses hundreds of variable, how do you retrieve your adress then ?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Wed Apr 22, 2015 6:05 pm    Post subject: Reply with quote

You need to examine all of the registers and pray a certain set are unique only when your address is accessed.

Or, trace the code back to another function that is hopefully specific to your variable.

You can also find specific values at the pointer which are specific to the structure being pointed at.
For example, structure points to unit ID which is always 0 for the player.

Possibly find another value inside your pointer which is only accessed by code related to your structure.
For example, the health value is read in order to display some health bar to the screen.
That code is only used on the player, since NPC health isn't displayed on your HUD.
So, compare if your player structure points to a health structure, you can compare the address of the health structure accessed by the HUD display with the health structure at the offset of your original pointer.
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