I'm writing a class for memory editing, but I'm stuck with multi lvl pointers.
What I have so far :
Code:
//API Declaration :
[DllImport("kernel32.dll")]
static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAdress, byte[] lpBuffer, uint iSize,out uint lpNumberOfBytesRead);
[DllImport("kernel32.dll")] // Overload for ptr
static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAdress, out IntPtr lpBuffer, uint iSize, out uint lpNumberOfBytesRead);
//........
public int Readlvl1Pointer(IntPtr adress)
{
uint bytesRead;
byte[] _Value = new byte[4];
ReadProcessMemory(_targetProcessHandle, adress, _Value, (uint)IntPtr.Size, out bytesRead);
int ptrVal = BitConverter.ToInt32(_Value, 0);
IntPtr ptr = (IntPtr)ptrVal;
ReadProcessMemory(_targetProcessHandle, adress, _Value, (uint)IntPtr.Size, out bytesRead);
return BitConverter.ToInt32(_Value, 0); // This function is working fine
}
private IntPtr ReadPointer(IntPtr adress)
{
IntPtr tempPTR;
uint NumberOfBytesRead;
ReadProcessMemory(_targetProcessHandle, adress, out tempPTR, (uint)IntPtr.Size, out NumberOfBytesRead);
return tempPTR;
}
public IntPtr FollowPointer(IntPtr adress, ulong[] Offsets) // To get the final adress
{
IntPtr ptr = ReadPointer(adress);
for (int i = 0; i < Offsets.Length; i++)
{
ptr = ReadPointer(new IntPtr(ptr + Offsets[i])); // error here, can't add IntPtr to IntPtr
}
return ptr;
}
And I want to use like that (outside the class) :
Code:
IntPtr finalAdress = m.FollowPointer((IntPtr)0x0631390, {0xC,0x14,0}); // Don't know why I always have to convert here
m.WriteInteger(finalAdress,[new value here]);
It returns a certain value, which is not the same as the value showed in CE (but it still the exact same adress).
And it change only when I use my WriteInteger function.
[S][T]Level 18 GE5+multi servers 04/30/2013 - Browsergames Trading - 11 Replies Great Accounts
Sell or Trade for GA5 (Global America 5)Post offers below
Global Europe 5
lvl18 just under 1 bill ep
ship:goliath has diminisher
8 iris
1 apis
1 havoc
multi level pointers 07/03/2012 - AutoIt - 50 Replies i have searched googled and so on and i cant figure out any of this shit.
my pointer is with other offsets
<?xml version="1.0"?>
<CheatTable>
<CheatEntries>
<CheatEntry>