Code: Select all
ReadMemory(MADDRESS,PROGRAM,byte := 4)
{
pid := WingetID("ahk_id" PROGRAM)
VarSetCapacity(MVALUE,4,0) ;<<<< error
ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", pid, "UInt")
DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)
Loop (byte)
result += *(&MVALUE + A_Index-1) << 8*(A_Index-1) ;<<<<< error
return, result
}