感謝您的閱讀,如何去在外部應用程序收聽範圍內存地址和回聲結果與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