C# How to Read Multiple Pointers Value with Vamemory. Dll
I Have a Base Address and Few Pointers That I Need to Read the Value off Them Using Vamemory. Dll on C#. I Have Done It This Way: Vamemory Vam = New...
I have a base address and few pointers that I need to read the Value off them using VAMemory.dll on C#.
I have done it this way:
VAMemory vam = new VAMemory(process);
int LocalPlayer = vam.ReadInt32((IntPtr)0x00EE231C);
int address = vam.ReadInt32((IntPtr)(LocalPlayer + 0x30));
address = vam.ReadInt32((IntPtr)(address + 0x0));
address = vam.ReadInt32((IntPtr)(address + 0x1BC));
address = vam.ReadInt32((IntPtr)(address + 0x178));
address = vam.ReadInt32((IntPtr)(address + 0x0));
address = address + 0x4;
int value = vam.ReadInt32((IntPtr)address);
Console.WriteLine(" value: " + value);
But it's not working. I have checked few solutions here on StackOverflow but still can't find a valid solution. I can read the value very well using Cheat Engine so the pointers aren't invalid. Please help me.
1 Answer
If I'm interpreting this correctly, you have a base address and some offsets. A pointer is offset from an address.
You call IntPtr.Add(address, offset) to add an offset to each computed pointer.
private int GetPointerValue(Int32 baseAddress, int[] offsetArr)
{
IntPtr pointer = IntPtr.Add((IntPtr)vam.ReadInt32(baseAddress), offsetArr[0]);
for (int i = 1; i < offsetArr.Length; i++)
{
pointer = IntPtr.Add((IntPtr)vam.ReadInt32(pointer), offsetArr[i]);
}
return vam.ReadInt32(pointer);
}
private Int32 baseAddress = 0xEE231C;
private var offsetArr = new int[]{ 0x30, 0x0, 0x1BC, 0x178, 0x0, 0x4 };
Console.WriteLine(" value: " + GetPointerValue(baseAddress, offsetArr));