There is an address in which the string is stored in UTF-16. The question is how to read it normally in the char array using ReadProcessMemory? I tried this:

char buffer[100]; ReadProcessMemory(phandle, (void*)address, &buffer, 20, NULL); cout << buffer; 

Instead of the word "probably," I was given the following character set: "25 @> OB =>".

  • Yes, but you it as ASCII ... - Harry
  • 2
    If this is UTF-16, then it is necessary to read it into the wchar_t array (on Windows) and output wcout. On Linux, read into the char16_t array and convert to UTF-8, and only then output to cout - Artemy Vysotsky
  • To count in wchar_t it is enough just to replace char with wchar_t? I tried it and through wcout nothing was output at all. Online decoder defined encoding as ASCII 8BIT => UTF 16LE. - lolka lolkovich
  • Try WCHAR and swprintf instead of char and cout. - Vladimir Martyanov

0