Hey there. I have memory read functions which you may find useful.
I have been using them in order to get floating point and integer values from a game I have been automating, but I am sure you can also use it.
I make a directory called lib under AHK and toss these in there as .ahk files of their function and I can use them in all my scripts *Does require AHK to be ran as administrator on windows 7 unless AUC is off in order to work*
ReadMemory(MADDRESS,PROGRAM)
{
winget, pid, PID, %PROGRAM%
VarSetCapacity(MVALUE,4,0)
ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", pid, "UInt")
DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)
Loop 4
result += *(&MVALUE + A_Index-1) << 8*(A_Index-1)
return, result
}
ReadMemoryFloat(MADDRESS,PROGRAM)
{
winget, pid, PID, %PROGRAM%
VarSetCapacity(MVALUE,4,0)
ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", pid, "UInt")
DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)
FP := NumGet(&MVALUE,0,"float")
return, FP
}
I hope they help you, for me I find them invaluable.
Here is an example of the code I use them in:
valueX:=ReadMemoryFloat(0x00724560,"Censored")
valueY:=ReadMemoryFloat(0x00724564,"Censored")
valueZ:=ReadMemoryFloat(0x00724568,"Censored")
valueSteps:=ReadMemoryFloat(0x0072456C,"Censored")
valueDirection:=ReadMemory(0x0072455C,"Censored")