感谢您的阅读,如何去在外部应用程序收听范围内存地址和回声结果与ReadProcessMemory
我与一个在线游戏乱搞我玩,教我一些关于进行ReadProcess API。
我正在尝试游戏聊天室并将其显示在我的应用程序中。使用应用程序,我能够搜索并找到需要的数据的内存地址,但遇到了一些困难。
这里是我使用从进程的内存中读取的代码:
Dim ProcessToReadFrom As Process = Process.GetProcessesByName("MyGameName")(0)
'Pass the process to a new instance of our NativeMemoryReader class
Dim MemoryReader As New NativeMemoryReader(ProcessToReadFrom)
Dim address_to_read As Integer = Convert.ToInt32("006e3218", 16)
'Read 400 bytes from some address in the process
Dim MemoryBytes() As Byte = MemoryReader.ReadMemory(New IntPtr(address_to_read), 400)
MsgBox("ascii: " & System.Text.Encoding.ASCII.GetString(MemoryBytes).Trim())
MemoryReader.Dispose()
它使用MemoryReader类如下所示:http://www.vbforums.com/showthread.php?p=3819578
使用此代码,我可以拉一条线每次聊天,这里是我的问题
- 数据分布在许多地址从(006E3218-006E6B46),什么是从这个范围内获得所有数据的最佳方式是什么?
非常感谢您花时间阅读本文!
此致希望,
史蒂夫
您是否尝试Dim MemoryBytes()As Byte = MemoryReader.ReadMemory(New IntPtr(address_to_read),14638)?它应该读你提到的整个区域。 – IvanH
你好Ivan,谢谢你的回复,我确实尝试过,但它只是返回一行,就像我之前说过的那样。我可以做到这一点,如果我手动添加所有的地址,并在所有这些地址上使用ReadMemory功能,但是,这显然非常缓慢并且不适合聊天屏幕。我不知道为什么它没有阅读所有的聊天记录,只有第一行,我甚至没有尝试过.Trim并得到了相同的结果。有任何想法吗? – Nookster