我想在C#中製作一個內存掃描器。我聽說我需要API函數WriteProcessMemory
和ReadProcessMemory
。用C寫一個內存掃描器#
我打電話給他們:
[DllImport("kernel32.dll")]
public static extern bool ReadProcessMemory(
IntPtr hProcess,
IntPtr lpBaseAddress,
byte[] lpBuffer,
UInt32 nSize,
ref UInt32 lpNumberOfBytesRead
);
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool WriteProcessMemory(
IntPtr hProcess,
IntPtr lpBaseAddress,
byte[] lpBuffer,
uint nSize,
out UIntPtr lpNumberOfBytesWritten);
所有內存掃描儀我在谷歌發現是很難理解的例子。我讀過很多文章,說要找到值addr,你需要在任何內存字節搜索。現在我需要讓程序打開從內存中讀取和寫入的過程。
我可以使用GetProcessByName
嗎?
簡答:是的。長答案:是的。 – 2011-12-31 18:06:52
[閱讀並嘗試瞭解此項目的來源](http://www.codeproject.com/KB/cs/sojaner_memory_scanner.aspx) – 2011-12-31 18:09:46