| View previous topic :: View next topic |
| Author |
Message |
ulysse31 Master Cheater
Reputation: 2
Joined: 19 Mar 2015 Posts: 324 Location: Paris
|
Posted: Tue Apr 21, 2015 4:49 pm Post subject: Dealing with dynamically allocated pointers |
|
|
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 |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Tue Apr 21, 2015 6:28 pm Post subject: |
|
|
That is the normal way I save dynamic addresses.
How more efficient can it be than to just set the value to the address?
Unless, of course, 0204B7E9 wasn't the address of your C++ variable.
|
|
| Back to top |
|
 |
ulysse31 Master Cheater
Reputation: 2
Joined: 19 Mar 2015 Posts: 324 Location: Paris
|
Posted: Wed Apr 22, 2015 2:47 pm Post subject: |
|
|
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 |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Wed Apr 22, 2015 6:05 pm Post subject: |
|
|
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 |
|
 |
|