public int GetPointerAddress(int baseAddress, int[] offsets)
{
int bytesRead = 0;
byte[] newAddrBytes = new byte[4];
Program.ReadProcessMemory((int)tyexeHandle, baseAddress, newAddrBytes, 4, ref bytesRead);
int addr = BitConverter.ToInt32(newAddrBytes, 0);
foreach(int i in offsets)
{
if (i != offsets[offsets.Length - 1])
{
bytesRead = 0;
byte[] newAddr = new byte[4];
Program.ReadProcessMemory((int)tyexeHandle, baseAddress + 1, newAddr, 4, ref bytesRead);
addr = BitConverter.ToInt32(newAddrBytes, 0);
}
}
return addr + offsets[offsets.Length - 1];
}
public int GetPointerAddress(int baseAddress, int[] offsets)
{
int bytesRead = 0;
byte[] newAddrBytes = new byte[4];
Program.ReadProcessMemory((int)tyexeHandle, baseAddress, newAddrBytes, 4, ref bytesRead);
int addr = BitConverter.ToInt32(newAddrBytes, 0);
foreach(int i in offsets)
{
if (i != offsets[offsets.Length - 1])
{
bytesRead = 0;
byte[] newAddr = new byte[4];
Program.ReadProcessMemory((int)tyexeHandle, baseAddress + 1, newAddr, 4, ref bytesRead);
addr = BitConverter.ToInt32(newAddrBytes, 0);
}
}
return addr + offsets[offsets.Length - 1];
}