I'm using the ReadProcessMemory
function to read the content of an external running app, I have a memory address which points to a PChar(UNICODE). I'm wondering which is the proper way to get that value back to a string variable?
Now i'm using this code, but is not working
var
c : char;
repeat
if not ReadProcessMemory(ph, Address, @c, sizeof(c), BytesRead) then
raise exception.create(syserrormessage(getlasterror));
result:=result+c;
Address:=pointer(integer(address)+sizeof(c));
until (c=#0#0) or (BytesRead<>sizeof(c));
This error is raised
Only part of a ReadProcessMemory or WriteProcessMemory request was completed