Memory 用AHK读取程序存储器

Memory 用AHK读取程序存储器,memory,autohotkey,memory-address,Memory,Autohotkey,Memory Address,所以我正在开发一个程序,从游戏中读取值(Mitos.is:The game)。 这与 你有一个尺寸(质量),我想得到质量,这是一个程序,而不是像Agar.io这样的在线游戏 我发现了这个自动热键脚本: #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common e

所以我正在开发一个程序,从游戏中读取值(Mitos.is:The game)。 这与

你有一个尺寸(质量),我想得到质量,这是一个程序,而不是像Agar.io这样的在线游戏

我发现了这个自动热键脚本:

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


ReadMemory(MADDRESS=0,PROGRAM="",BYTES=4)
{
   Static OLDPROC, ProcessHandle
   VarSetCapacity(MVALUE, BYTES,0)
   If PROGRAM != %OLDPROC%
   {
      WinGet, pid, pid, % OLDPROC := PROGRAM
      ProcessHandle := ( ProcessHandle ? 0*(closed:=DllCall("CloseHandle"
      ,"UInt",ProcessHandle)) : 0 )+(pid ? DllCall("OpenProcess"
      ,"Int",16,"Int",0,"UInt",pid) : 0)
   }
   If (ProcessHandle) && DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Str",MVALUE,"UInt",BYTES,"UInt *",0)
   {    Loop % BYTES
            Result += *(&MVALUE + A_Index-1) << 8*(A_Index-1)
        Return Result
    }
   return !ProcessHandle ? "Handle Closed:" closed : "Fail"
}


mass := ReadMemory(Address here, "Mitos.is: The Game")

MsgBox, %mass%
#NoEnv;推荐用于性能和与未来自动热键版本的兼容性。
; #警告;启用警告以帮助检测常见错误。
发送模式输入;由于其优越的速度和可靠性,建议用于新脚本。
SetWorkingDir%A_ScriptDir%;确保起始目录一致。
ReadMemory(MADDRESS=0,PROGRAM=”,字节=4)
{
静态OLDPROC,ProcessHandle
VarSetCapacity(MVALUE,字节,0)
如果程序!=%OLDPROC%
{
WinGet,pid,pid,%OLDPROC:=程序
ProcessHandle:=(ProcessHandle?0*(关闭:=DllCall(“关闭句柄”)
,“UInt”,ProcessHandle):0)+(pid?DllCall(“OpenProcess”
,“Int”,16,“Int”,0,“UInt”,pid:0)
}
If(ProcessHandle)和&DllCall(“ReadProcessMemory”,“UInt”,ProcessHandle,“UInt”,MADDRESS,“Str”,MVALUE,“UInt”,BYTES,“UInt*”,0)
{Loop%字节

Result+=*(&MVALUE+A_Index-1)检查地址是否在重新启动游戏后更改,或者不重新启动游戏只需运行脚本而不重新启动,并且您尚未定义字节,因此请尝试以下操作:

        ReadMemory(MADDRESS=0, PROGRAM="", BYTES=4 )
mass := ReadMemory("0x123456", "Mitos.is: The Game", "4") 

“程序”应为正确的窗口标题使用spy获得正确的窗口标题,地址必须为十六进制值,即“0x15B29DD0”,我不知道你的作弊引擎是如何读取程序内存地址的。

重新启动游戏后,如果地址发生变化,请检查地址,或者不要重新启动游戏,只需运行脚本而不重新启动,并且你还没有定义字节,请尝试以下操作

        ReadMemory(MADDRESS=0, PROGRAM="", BYTES=4 )
mass := ReadMemory("0x123456", "Mitos.is: The Game", "4") 

“程序”应该是正确的窗口标题使用spy获得正确的窗口标题,地址必须是十六进制值,即“0x15B29DD0”,我不知道作弊引擎如何读取程序内存地址。

Bump,有人有想法吗?16个视图1个向上投票,没有评论或回复:(Bump,有人有想法吗?16个视图1个向上投票,没有评论或回复:(