Sign in to follow this  
Followers 0
E1M1

Why I can't read process memory?

4 posts in this topic

#1 ·  Posted (edited)

I am trying to read 1 bite from process memory but I fail.

#Include <WinAPI.au3>

Dim $pBuffer,$iRead = 1
$hprocess = _WinAPI_OpenProcess(0x0010, False, @AutoItPID)
_WinAPI_ReadProcessMemory($hprocess, 0x08000000, $pBuffer, 1,$iRead)
msgbox(0,0,$pBuffer)

it says in message box:

_WinAPI_ReadProcessMemory: Only part of a ReadProcessMemory or WriteProcessMemory request was completed.

Edited by E1M1

edited

Share this post


Link to post
Share on other sites



anyone


edited

Share this post


Link to post
Share on other sites

Personally I always just use PROCESS_ALL_ACCESS parameter in OpenProcess, because it always works. Your issue is that you're not treating the $pBuffer parameter in ReadProcessMemory as an AutoIt DllStruct.

$pBuf = DllStructCreate("byte")
$iRead = 0
$hProc = _WinAPI_OpenProcess(0x1F0FFF, False, @AutoItPID) //0x1F0FFF = PROCESS_ALL_ACCESS

_WinAPI_ReadProcessMemory($hProc, 0x0800000, DllStructGetPtr($pBuf), DllStructGetSize($pBuf), $iRead)

MsgBox(0, "", DllStructGetData($pBuf, 1))

Hope it helps!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

still not working

I just found it's impossible. (I used CE and found that every time $var value chenges it's address chenges too)

I just wanted to make method to read $var value from other running exe.

Edited by E1M1

edited

Share this post


Link to post
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
Sign in to follow this  
Followers 0