Below is code from C++ file i'm trying to convert to C#:
ReadProcessMemory (pD2, (VOID *)0x6FBCC1E0, &addr, sizeof(addr), &read);
ReadProcessMemory (pD2, (VOID *)addr, playerUnit, sizeof(playerUnit), &read);
This is my code:
byte playerUnit = new byte;
byte bMemory = new byte;
ReadProcessMemory(pD2.Handle, (IntPtr)0x6FBCC1E0, bMemory, sizeof(byte), out ptrReaded);
ReadProcessMemory(pD2.Handle, (IntPtr)bMemory, playerUnit, sizeof(byte), out ptrReaded);
In the C++ code, I can see that the information read from "0x6FBCC1E0" is stored in "addr." I've been able to write that much, but now I'm stuck.
Next, In the C++ code he reads from "addr" and stores the newly collected info "playerUnit." I cannot get this to work, "bMemory" throws errors and when I try to do stuff like, "bMemory," nothing gets read.
So, what would I do to get the second line of my code to read correctly