我有代碼從內存中讀取一個值,當內存地址指向一個靜態的4字節值時,但我試圖訪問一個4字節的值在動態位置,因此需要先搜索指針,然後再次搜索以獲取4字節值。C#ReadProcessMemory - 訪問/讀指針
下面是我應該返回指針的地址,但它只是輸出0的代碼...
bAddr = (IntPtr)0x0017C370; // Base address to find the Pointer (Currently: 0x00267A50)
ReadProcessMemory(hProc, bAddr, buffer, 4, out bytesRW);
output = BitConverter.ToInt32(buffer, 0);
txtOutput.Text = output.ToString();
我看工作作爲僞代碼:
bAddr = (IntPtr)0x0017C370; // Base address to find the Pointer (Currently: 0x00267A50)
ReadProcessMemory(hProc, bAddr, buffer, 4, out bytesRW);
output = BitConverter.ToInt32(buffer, 0);
bAddr = (IntPtr)output; // Should now contain the address 0x00267A50
ReadProcessMemory(hProc, bAddr, buffer, 4, out bytesRW);
output = BitConverter.ToInt32(buffer, 0);
txtOutput.Text = output.ToString();
任何人都可以擺脫任何關於我需要做的事情來找到一個地址,然後搜索該地址找到一個值?
ReadProcessMemory返回什麼?它可能只是失敗,在這種情況下'GetLastError'可能會有一些亮點。 – 2012-04-01 17:38:27