Hallo,
ich habe angefange mich ein wenig mit memory reading zu beschäftigen und nutze dazu die nomadmem, bzw eine abwandlung "pointer.au3".
darin enthalten die funktion _memorygetbaseaddress :
Spoiler anzeigen
;===================================================================================================
; Function........: _MemoryGetBaseAddress($ah_Handle, $iHD)
;
; Description.....: Reads the 'Allocation Base' from the open process.
;
; Parameter(s)....: $ah_Handle - An array containing the Dll handle and the handle of the open
; process as returned by _MemoryOpen().
; $iHD - Return type:
; |0 = Hex (Default)
; |1 = Dec
;
; Requirement(s)..: A valid process ID.
;
; Return Value(s).: On Success - Returns the 'allocation Base' address and sets @Error to 0.
; On Failure - Returns 0 and sets @Error to:
; |1 = Invalid $ah_Handle.
; |2 = Failed to find correct allocation address.
; |3 = Failed to read from the specified process.
;
; Author(s).......: Nomad. Szhlopp.
; URL.............: http://www.autoitscript.com/forum/index.php?showtopic=78834
; Note(s).........: Go to Www.CheatEngine.org for the latest version of CheatEngine.
;===================================================================================================
Func _MemoryGetBaseAddress($ah_Handle, $iHexDec = 0)
Local $iv_Address = 0x00100000
Local $v_Buffer = DllStructCreate('dword;dword;dword;dword;dword;dword;dword')
Local $vData
Local $vType
If Not IsArray($ah_Handle) Then
SetError(1)
Return 0
EndIf
DllCall($ah_Handle[0], 'int', 'VirtualQueryEx', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer))
If Not @Error Then
$vData = Hex(DllStructGetData($v_Buffer, 2))
$vType = Hex(DllStructGetData($v_Buffer, 3))
While $vType <> "00000080"
DllCall($ah_Handle[0], 'int', 'VirtualQueryEx', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer))
$vData = Hex(DllStructGetData($v_Buffer, 2))
$vType = Hex(DllStructGetData($v_Buffer, 3))
If Hex($iv_Address) = "01000000" Then ExitLoop
$iv_Address += 65536
WEnd
If $vType = "00000080" Then
SetError(0)
If $iHexDec = 1 Then
Return Dec($vData)
Else
Return $vData
EndIf
Else
SetError(2)
Return 0
EndIf
Else
SetError(3)
Return 0
EndIf
EndFunc ;==>_MemoryGetBaseAddress
Alles anzeigen
und so wie ich das verstehe benötigt man ja diese funktion um bei einem neustart des prozesses immer die richtige baseadress und von dort aus pointer zu finden.
Zu meinem Problem: die funktion gibt bei mir immer 0 zurück und setzt den @error auf 2 also "Failed to find correct allocation address." Ich habe dazu auch schon viel rumgegoogelt, allerdings ohne erfolg. Meist wurde als fehlerquelle probleme zwischen 32 und 64 bit OS und andwendungen genannt.
Kann es sein dass man für mein system (win7 64) eine andere funktion benötigt? Die funktion selbst arbeitet ja mit dlls und davon habe ich leider keine ahnung, sonst könnte ich mir bestimmt eine eigene funktion bauen.
Bevor die Frage nach meinem skript kommt, ich habe eigentlich keins da sich das problem über alle prozesse die ich versucht habe zieht (explorer.exe, firefox.exe, die exe eines von mir geschriebenen programms)
habe bereits versucht die pid für das _memoryopen selbst einzugeben oder ber Processexists, zu suchen. Jetzt hoffe ich mal ihr wisst mehr als google =)