Reputation: 77
I was trying to read a memory from explorer.exe. With a program process hacker I found that on the address 0xfa07f8
this string is stored: \??\C:\Program Files\Process Hacker 2\ProcessHacker.exe
When I try to read the string of this address, I get only the first character of the string back. The '\' char. How can I read the whole string?
char buffer[255] = { 0 };
unsigned addr = 0xfa07f8;
if (ReadProcessMemory(proc, (LPVOID)addr, &buffer, sizeof(buffer), NULL))
{
MessageBoxA(NULL, buffer, NULL, NULL);
}
Upvotes: 0
Views: 486
Reputation: 2450
You are reading wide characters from the process memory. MessageBoxA
is for displaying "narrow" characters.
To display wide characters, use MessageBoxW
.
Upvotes: 2