Jump to content
Sign in to follow this  
hendrikhe

WinAPI.au3, memory reading

Recommended Posts

hendrikhe

I am still trying to read my memory,I searched on forum for some scripts and found soemthing interesting about WinAPI.au3.

But I have some questions, it isnt working fine.

Well thats my little script:

CODE
#Include <WinAPI.au3>

Dim $procHwnd = _WinAPI_OpenProcess($PROCESS_ALL_ACCESS, False, ProcessExists("Tutorial.exe"))

Dim $pBuffer = DllStructCreate("byte[256]"), $iRead = 0

_WinAPI_ReadProcessMemory($procHwnd, 0x00D027BC, DllStructGetPtr($pBuffer), 256, $iRead)

; convert the unicode text(as it turned out to be stored as) to normal text and display it

MsgBox(0, "Data Read", BinaryToString(Binary(DllStructGetData($pBuffer, 1)), 2))

0x00D027BC is the actual address that I am trying to read and Tutorial.exe is the process I am testing a bit. I am using

WinAPI.au3 because NomadMemory is blocked my HackShield and I hope WinAPI can handle it. But first off all I would be happy if this little script works.

Running the script like that results in an error: $PROCESS_ALL_ACCESS undeclared Global variable, $PROCESS_ALL_ACCESS used before declaration

In another script he replaced $PROCESS_ALL_ACCESS with BitOR(0x0400, 0x0010):

CODE
#Include <WinAPI.au3>

Dim $procHwnd = _WinAPI_OpenProcess(BitOR(0x0400, 0x0010), False, ProcessExists("Tutorial.exe"))

Dim $pBuffer = DllStructCreate("byte[256]"), $iRead = 0

_WinAPI_ReadProcessMemory($procHwnd, 0x00D027BC, DllStructGetPtr($pBuffer), 256, $iRead)

; convert the unicode text(as it turned out to be stored as) to normal text and display it

MsgBox(0, "Data Read", BinaryToString(Binary(DllStructGetData($pBuffer, 1)), 2))

Well its a bit strange instead to show 85 (the current value) in the message box it shows: U

80 (the current value), in the message box it shows: P

etc

How to fix it?

Edited by hendrikhe

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  

×