Pointers and offsets
Hello comm,
I've been trying to create a hack for a long time and now that I begin to understand the concepts which are required I find myself in a road block
.
I already succeeded to find the pointer and its offsets for what I'm trying to accomplish.
Image
So if I understand correctly, "0x007CE020" points to "0x5193BD6C" and then we must add the offset to the adress that the pointer points at.
I think the problem is in the code, i'm using this function to read the memory:
And I'm using it like this:
The value that I receive is "1824363345" not the expected "0x5193BD6C". Is the received value the decimal value of "0x5193BD6C"?
If so, how can I convert an hexadecimal value as byte array to int so I can add the offset?
Thanks in advance
I've been trying to create a hack for a long time and now that I begin to understand the concepts which are required I find myself in a road block
.I already succeeded to find the pointer and its offsets for what I'm trying to accomplish.
Image
So if I understand correctly, "0x007CE020" points to "0x5193BD6C" and then we must add the offset to the adress that the pointer points at.
I think the problem is in the code, i'm using this function to read the memory:
Code:
public static byte[] ReadMemory(Process process, int address, int numOfBytes, out int bytesRead)
{
IntPtr hProc = OpenProcess(ProcessAccessFlags.All, false, process.Id);
byte[] buffer = new byte[numOfBytes];
ReadProcessMemory(hProc, new IntPtr(address), buffer, numOfBytes, out bytesRead);
return buffer;
}
Code:
Process process12 = Process.GetProcessesByName("PROCESS_NAME").FirstOrDefault();
//Get Adress to change from pointer
int bytesRead;
//int bytesWritten;
byte[] addr = Memory.ReadMemory(process12, 0x007CE020, 4, out bytesRead);
Array.Reverse(addr); //Converting to Big Endian
lb.Items.Add(BitConverter.ToInt32(addr, 0)); //Checking the value
If so, how can I convert an hexadecimal value as byte array to int so I can add the offset?
Thanks in advance



