Alternative to _MemoryRead/Write for 64bit

04/05/2012 08:54 ExO-HaCkZ#1
Is there any alternative method for memory read/write on 64bit systems??i tried nomadmemory but no value is being returned and its not 64bit safe..:confused:

here is the code that i want to be 64bit compatible

Quote:
Func _GetValue($Address)

$OpenProcess = _MemOpen(0x38, False, $PID)

$byte1 = _MemRead($OpenProcess, $Address, 1)
$Address = $Address + 1
$byte2 = _MemRead($OpenProcess, $Address, 1)
$Address = $Address + 1
$byte3 = _MemRead($OpenProcess, $Address, 1)
$Address = $Address + 1
$byte4 = _MemRead($OpenProcess, $Address, 1)
$Address = $Address + 1
$byte5 = _MemRead($OpenProcess, $Address, 1)

$hex1 = Hex($byte1)
$hex2 = Hex($byte2)
$hex3 = Hex($byte3)
$hex4 = Hex($byte4)
$hex5 = Hex($byte5)

$dec1 = Dec($hex1)
$dec2 = Dec($hex2)
$dec3 = Dec($hex3)
$dec4 = Dec($hex4)
$dec5 = Dec($hex5)

$myStr = Chr($dec1)&Chr($dec2)&Chr($dec3)&Chr($dec4)&Chr($d ec5)

_MemClose($OpenProcess)

Return $myStr

EndFunc
any help/suggestion is greatly appreciated..:)
04/05/2012 16:50 K1ramoX#2
Yeah, _WinAPI_ReadProcessMemory() and _WinAPI_WriteProcessMemory() ;<
04/05/2012 17:10 jacky919#3
Quote:
Originally Posted by Applecode View Post
Yeah, _WinAPI_ReadProcessMemory() and _WinAPI_WriteProcessMemory() ;<
Vergleich mal die Implementierungen von _MemoryRead und _WinAPI_ReadProcessMemory.
Dabei wird dir folgendes ganz besonders auffallen:
_WinAPI_ReadProcessMemory:
PHP Code:
Local $aResult = DllCall("kernel32.dll", "bool", "ReadProcessMemory", "handle", $hProcess, _
            
"ptr", $pBaseAddress, "ptr", $pBuffer, "ulong_ptr", $iSize, "ulong_ptr*", 0) 
_MemoryRead:
PHP Code:
DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '') 
04/05/2012 19:13 ExO-HaCkZ#4
Quote:
Originally Posted by Applecode View Post
Yeah, _WinAPI_ReadProcessMemory() and _WinAPI_WriteProcessMemory() ;<
Quote:
Originally Posted by jacky919 View Post
Vergleich mal die Implementierungen von _MemoryRead und _WinAPI_ReadProcessMemory.
Dabei wird dir folgendes ganz besonders auffallen:
_WinAPI_ReadProcessMemory:
PHP Code:
Local $aResult = DllCall("kernel32.dll", "bool", "ReadProcessMemory", "handle", $hProcess, _
            
"ptr", $pBaseAddress, "ptr", $pBuffer, "ulong_ptr", $iSize, "ulong_ptr*", 0) 
_MemoryRead:
PHP Code:
DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '') 
wew,that works..
thanks for the info and your time. :handsdown: