Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

ReadMemory function


  • Please log in to reply
109 replies to this topic
Ice_Tea
  • Members
  • 131 posts
  • Last active: Aug 25 2010 11:11 AM
  • Joined: 12 Jan 2008

Hi Guest,

A funny example you gave me there. Kind of interesting, but not useful to read string from the memory of other running processes.

Regards,

David

(AHK stores variables in Char[arrays] afaik)
Yes it does help, The only difference is that u'll have to define the length of the string, or simply search for the NULL terminator.

A simple way is reading the address 2byte by 2byte. and simply run Chr(Returned Value) and build a sentence out of that. if you're searching for strings in ahk, simply parse through each character (2byte) 1by1 until you find Char(0), it is best to detect it by searching for Asc(0) (The initial return value).

If you need help you could prolly contact me but that may be hard as I have my mind set on other stuff atm...
Posted Image

David Andersen
  • Members
  • 140 posts
  • Last active: Jun 28 2011 04:54 PM
  • Joined: 15 Jul 2005
Hi,

As I mentioned...

I attempted to incrementally retrieve one megabyte, though it is very inefficient and took more than two seconds (this was to retrieve the same 10 chars 100000 times, not searching or anything), which is too much for me.


Thanks for trying to help, though.

Handy Man
  • Guests
  • Last active:
  • Joined: --
I am trying to read the memory from warcraft 3, all I get is zero. Why would this happen? Please help.

David Andersen
  • Members
  • 140 posts
  • Last active: Jun 28 2011 04:54 PM
  • Joined: 15 Jul 2005
I think you need to describe the problem with more details, to get a good answer, though you can try using WinHex(.com) to see what you should have gotten.

Handy Man
  • Guests
  • Last active:
  • Joined: --

I think you need to describe the problem with more details, to get a good answer, though you can try using WinHex(.com) to see what you should have gotten.


Well, I am trying to read the value of 0045CB8C in warcraft III, I can and have done it with WinHex and Cheat Engine, but I just can't do it with AHK, I get null all the time.

David Andersen
  • Members
  • 140 posts
  • Last active: Jun 28 2011 04:54 PM
  • Joined: 15 Jul 2005
Please post your program.

MasterFocus
  • Moderators
  • 4323 posts
  • Last active: Jan 28 2016 01:38 AM
  • Joined: 08 Apr 2009
You probably need a offset.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Antonio França -- git.io -- github.com -- ahk4.net -- sites.google.com -- ahkscript.org

Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.


peanutym
  • Members
  • 62 posts
  • Last active: Apr 18 2014 01:42 AM
  • Joined: 12 Jun 2007
So using this, i get a handle closed error. Here is my code that i am using.
Also using the read memory function that VxE posted

WinActivate, AION Client
WinGet, active_id, ID, A

SetFormat, IntegerFast, hex
PlayerXOffset = 0x8E6940
PlayerXCoord := PlayerXOffset + active_id

value:=ReadMemory(%PlayerXCoord%, %active_id%)

MsgBox, Player Coord is %PlayerXCoord% and PlayerXOffset is %PlayerXOffset% and active id is %active_id% the value is %value%

I know that the actual values that i want is in the game.dll not the aion client. So maybe that is my issue? But again i dont know how to point the read memory function to a specific DLL just yet either.

Any help is appreciated.

florinn
  • Members
  • 45 posts
  • Last active: Feb 13 2014 04:49 AM
  • Joined: 01 Mar 2010
Hello
As posted http://www.autohotke...pic.php?t=57070 here, I also want to change the value of a address in a application.
When I search for the value that I want to change with Cheat Engine, it returns ~ 13 addresses. They will change next time I restart the application.
I tried to find the pointer so that ReadMemory will access the same address, with no success.
- Is there a function that can be called to search for a value from a specific application, and change that value into a desired value in all returning addresses at once?
- Is there a function that can find a pointer of a address?
Any help is appreciated as well.

porrasnick
  • Members
  • 166 posts
  • Last active: Mar 09 2011 09:27 AM
  • Joined: 30 Jan 2010
I have a multi-level pointer that i need to keep track of while my script is running, is there any way to do this with ReadMemory?

MasterFocus
  • Moderators
  • 4323 posts
  • Last active: Jan 28 2016 01:38 AM
  • Joined: 08 Apr 2009
Yes. You'd need to have one or more offsets.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Antonio França -- git.io -- github.com -- ahk4.net -- sites.google.com -- ahkscript.org

Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.


porrasnick
  • Members
  • 166 posts
  • Last active: Mar 09 2011 09:27 AM
  • Joined: 30 Jan 2010
Can you explain how to do that please?

MasterFocus
  • Moderators
  • 4323 posts
  • Last active: Jan 28 2016 01:38 AM
  • Joined: 08 Apr 2009
Something like this:
Program := "program.exe"
Address := 0xDE78B5
Offset := 0x518
Value := ReadMemory( Address+Offset , Program )

; Repeat the following 3 lines as necessary
Address := Value
Offset := 0x162 ; this will probably change
Value := ReadMemory( Address+Offset , Program )
Don't forget to debug your code so you can see if you'll have to use SetFormat.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Antonio França -- git.io -- github.com -- ahk4.net -- sites.google.com -- ahkscript.org

Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.


Look in German Forum
  • Guests
  • Last active:
  • Joined: --
In the German Forum is a Libary from the User RaptorOne,
in that libary is the Read-WriteProcessMemory in different kinds.

http://de.autohotkey...opic.php?t=6903
take a look

sry for my google translate english

porrasnick
  • Members
  • 166 posts
  • Last active: Mar 09 2011 09:27 AM
  • Joined: 30 Jan 2010
Thanks, I think I could use ReadProcessMemoryBigOffset but I don't know how.

Can someone help me?

The pointer looks like this in CheatEngine:
Posted Image

The box that is cut off says this inside: MapleStory.exe+004955C8

I'm also not sure how i'm supposed to deal with trying to find the base address of MapleStory.exe with my script.

I hope you guys can help.