I'm learning memory reading with AutoIt. My current problem is that when I want to read an address it only gives back 0s.
Here is my code:
#include "C:\Program Files (x86)\AutoIt3\Plugins\NomadMemory.au3"
$ID = _MemoryOpen(0x00000650)
$Address = 0x1AAFD6ECEC8
While 1
MemoryTest()
WEnd
Func MemoryTest()
$Test = _MemoryRead($Address,$ID)
Sleep(1000)
ConsoleWrite('Current address value: ' & $Test & @LF)
EndFunc
_MemoryClose($ID)
The output is:
Current address value: 0
Current address value: 0
Current address value: 0
Current address value: 0
Current address value: 0
Current address value: 0
Current address value: 0
...
The address in unchanged meanwhile (it's 3315), I've double-checked it with Cheat Engine.
What could be the problem?
Both _MemoryOpen()
and _MemoryRead()
returns 0 on failure. From NomadMemory.au3
:
; Return Value(s): On Success - Returns an array containing the Dll handle and an
; open handle to the specified process.
; On Failure - Returns 0
; @Error - 0 = No error.
; 1 = Invalid $iv_Pid.
; 2 = Failed to open Kernel32.dll.
; 3 = Failed to open the specified process.
; Return Value(s): On Success - Returns the value located at the specified address.
; On Failure - Returns 0
; @Error - 0 = No error.
; 1 = Invalid $ah_Handle.
; 2 = $sv_Type was not a string.
; 3 = $sv_Type is an unknown data type.
; 4 = Failed to allocate the memory needed for the DllStructure.
; 5 = Error allocating memory for $sv_Type.
; 6 = Failed to read from the specified process.
You should check your @Error
value after you call each of the functions.
User contributions licensed under CC BY-SA 3.0