Link to home
Start Free TrialLog in
Avatar of Netlink2
Netlink2

asked on

ReadProcessMemory only returning one byte

Hi, I have the following C# code. It's meant to return an Integer, but it only returns 256 at the most.
It appears that I'm missing the next byte.
Does anybody have any ideas?

Thanks
byte[] buffer = new byte[200];
fixed (byte* cptr = &buffer[0])
{
int x = 0;
int* xptr = &x;
IntPtr hProcess = OpenProcess(PROCESS_VM_READ, false, p[0].Id);
bool result = ReadProcessMemory(hProcess, baseAddress, cptr, 8, null);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of MedievalWarrior
MedievalWarrior
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial