Reading memory from process (PID)
Hi,
been working all night on this without getting it to work. Need some help if anyone knows what might be wrong.
It's quite big main source so I dont want to paste it all right now.
After use OpenProcess(...)
i do ReadProcessMemory(hProcess, &baseaddr, buffer, PAGESIZE, 0)..
i try this on a simple notepad.exe process. what i want to do is to read the bytes (or text if you prefer) from that process.
PID: 3104, Handle: 0000000000000040
i know pid's and handles change each time one runs or restarts computer or applications in background. i try the correct pid in my example, but i get error message each time. LastError shows this:
Quote:
Error: Only part of a ReadProcessMemory or WriteProcessMemory request was completed.
I tried to change the UAC to HighestPossible in the Visual C++ Express properties for the Linker->Manifest properties.
The compiler and linker is set to 64-bit. And notepad runs in 64-bit after looking it in the Task Manager.
Also i want to know where in memory to search for the program's virtual address space.
Code:
HANDLE hProcess = OpenProcess(PROCESS_VM_READ, FALSE, entry.th32ProcessID);
i've tried PROCESS_ALL_ACCESS too, even though i dont think its necessary. it gives the same error anyway.
the process is open while doing this:
Code:
if (ReadProcessMemory(hProcess, &baseaddr, buffer, PAGESIZE, 0) != 0)
{
//success!
}
else
{
//fails
//here i do LastError routine..
}
what might be causing this?
Quote:
Error: Only part of a ReadProcessMemory or WriteProcessMemory request was completed.
what else should I do?
anyone have any suggestions?