#include <Container.au3>
#include <WinAPI.au3>
$oContainer = _Container_Open("storage", 0)
$pid = Int(_Container_GetProperty($oContainer, "pid"))
$ptr = Ptr(_Container_GetProperty($oContainer, "ptr"))
$struct = Read_Pointer_FromProcessMemory($pid, $ptr, "int var1;uint var2")
ConsoleWrite(VarGetType($struct) & ":" & @error & ":" & DllStructGetData($struct, "var1") & @LF)
Func Read_Pointer_FromProcessMemory($ProcessID, $Pointer, $StructTag)
Local $iSYNCHRONIZE = (0x00100000), $iSTANDARD_RIGHTS_REQUIRED = (0x000F0000)
Local $iPROCESS_ALL_ACCESS = ($iSTANDARD_RIGHTS_REQUIRED + $iSYNCHRONIZE + 0xFFF)
Local $hProcess, $Struct, $StructPtr, $StructSize, $iRead
$hProcess = _WinAPI_OpenProcess($iPROCESS_ALL_ACCESS, False, $ProcessID)
If @error Then Return SetError(@error, 1, $Struct)
$Struct = DllStructCreate($StructTag)
$StructSize = DllStructGetSize($Struct)
$StructPtr = DllStructGetPtr($Struct)
_WinAPI_ReadProcessMemory($hProcess, $Pointer, $StructPtr, $StructSize, $iRead)
Return SetError(@error, $iRead, $Struct)
EndFunc