Answer the question
In order to leave comments, you need to log in
Why can't I read c++ process memory?
HANDLE hProcess= OpenProcess(PROCESS_ALL_ACCESS, false, dwPID);
if (hProcess)
{
SYSTEM_INFO si;
GetSystemInfo(&si);
auto minAplAdr = si.lpMinimumApplicationAddress;
long num = (INT32)minAplAdr;
MEMORY_BASIC_INFORMATION info;
BYTE* Buf = new BYTE[61440];
ReadProcessMemory(hProcess, 0, Buf, (unsigned long)20, (unsigned long*)20);
std::cout << Buf;
}
CloseHandle(hProcess);
Answer the question
In order to leave comments, you need to log in
BOOL WINAPI ReadProcessMemory(
_In_ HANDLE hProcess,
_In_ LPCVOID lpBaseAddress,
_Out_ LPVOID lpBuffer,
_In_ SIZE_T nSize,
_Out_ SIZE_T *lpNumberOfBytesRead
);
SIZE_T bytesRead;
ReadProcessMemory(hProcess, 0, Buf, (unsigned long)20, &bytesRead);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question