atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Fri Mar 16, 2012 12:41 pm Post subject: |
|
|
You can do something like this to read multilevel pointers:
| Code: |
Int32 baseAddress = 0x005853B0;
byte[] btBuffer = new byte[4];
IntPtr lpOutStorage = IntPtr.Zero;
Int32[] offsetList = new Int32[] { 0xC, 0x14, 0x0, 0x18 };
ReadProcessMemory(p.Handle, new IntPtr(baseAddress), btBuffer, (uint)btBuffer.Length, ref lpOutStorage);
for (UInt32 x = 0; x < (offsetList.Length - 1); x++)
{
baseAddress = BitConverter.ToInt32(btBuffer, 0) + offsetList[x];
ReadProcessMemory(p.Handle, new IntPtr(baseAddress), btBuffer, (uint)btBuffer.Length, ref lpOutStorage);
}
baseAddress = BitConverter.ToInt32(btBuffer, 0) + offsetList[offsetList.Length - 1];
float result = 0.0f;
byte[] btResult = new byte[Marshal.SizeOf(result)];
ReadProcessMemory(p.Handle, new IntPtr(baseAddress), btResult, (uint)btResult.Length, ref lpOutStorage);
result = BitConverter.ToSingle(btResult, 0);
|
You can find the process using:
| Code: |
Process p = (from proc in Process.GetProcesses()
where proc.ProcessName.ToLower() == "tutorial-i386"
select proc).SingleOrDefault();
|
Change the process name with yours.
_________________
- Retired. |
|