Jump to content

Program - Reading Memory - Value


Recommended Posts

Hi,

basically i'm trying to get a value from a program via memory reading and was wondering if you could help me out... i have searched alot for a few days and i can't seem to find my answer so i thought it would be best to ask here, anyway here is the current code with not 100% understanding but i understand most.

Func HP()
$hpaddress = 0x008E45FB
$pid = ProcessExists("Program.exe")
$Open = _MemoryOpen($pid)
$HPValue = _MemoryRead($hpaddress, $pid)
EndFunc

Here is my code i have written by researching around etc.

basically the $hpaddress is the value which i'm trying to get (yes, it is a static pointer not a DMA pointer which i learnt about and yes when i restart the program and load it up the static pointer is still the same).

$pid basically focuses on that program for $open which opens it in order to read it (as i have read you can't read without opening)

$HPValue is to read the memory from the $pid (program)

The current code doesn't work for me but basically what i was hoping for was a GUI button which when clicked would retrieve the value and display it in a GUI label, as the code currently gets all that i think is needed but i am unsure of a few things which are;

1. Static Pointer -> DMA Pointer -> Value (sometimes multi-pointers which there are in this case)

basically can i get autoit to read directly from the static pointer? or would i need to somehow put code in which reads from static pointer and gets the DMA pointer so it can then display the value (i.e would you need autoit to know the DMA pointer after static to get the value or can you just use the static).

2. Offsets

I understand that when a program is changed or updated that the static pointer can change, but you can use an offset (or the program uses the offset) in order for it to move around but to still have the same data structure within the program in order for it to find each other etc (and makes it easier)

And i'm guessing i would need to include the offset aswell, but i'm also unsure how to do that (i can find the offset, it's just the coding part).

Thank you for reading, and thank you if you consider helping me out by replying.

P.S I have #include <NomadMemory.au3 incase you were wondering.

Edited by Learning1
Link to comment
Share on other sites

3. _MemoryReadBaseAddress

This i have seen in some autoit programs which are including in reading the memory, but i do not understand it's purpose and what even baseaddress means/does :/

thanks again, i couldn't edit my previous post after editing it twice so i thought i should add it in the reply.

Link to comment
Share on other sites

A pointer is 4 bytes in memory that contains the address of either another pointer, or a value(if it's a static pointer).

An offset is used with pointers that doesn't point directly to the value you're after(it might point to a section of data, but your value is located at data section+10 byte, so the offset would be 10, or 0xA in hex).

Think of offsets as the house number, and pointers as the Street address. You know the value you want lives at the street pointed to by the Pointer, and in the house with the Offset number.(if that makes sense :D)

It would be good if you could provide what program you're making this for(would be easier to provide an example).

Link to comment
Share on other sites

A pointer is 4 bytes in memory that contains the address of either another pointer, or a value(if it's a static pointer).

An offset is used with pointers that doesn't point directly to the value you're after(it might point to a section of data, but your value is located at data section+10 byte, so the offset would be 10, or 0xA in hex).

Think of offsets as the house number, and pointers as the Street address. You know the value you want lives at the street pointed to by the Pointer, and in the house with the Offset number.(if that makes sense :D)

It would be good if you could provide what program you're making this for(would be easier to provide an example).

Thank for explaining it in a clear way, it's nice to see an example so i can think of it in a different way which is alot better and which i understand more... the program is a game but i'd rather do it myself after your explaination which was enough for me to continue on this point.

Link to comment
Share on other sites

Thank for explaining it in a clear way, it's nice to see an example so i can think of it in a different way which is alot better and which i understand more... the program is a game but i'd rather do it myself after your explaination which was enough for me to continue on this point.

That '_BaseAddress' is something I wrote... You can find a fully working example of alot of the memory editing stuff in my sig =)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...