function ReadPlayerName (hProcess, data: DWord): string;
var
i, rw: DWord;
ch: WideChar;
wch: array [0 .. 255] of WideChar;
str: string;
begin
i:= 0;
repeat
ReadProcessMemory (hProcess, ptr (data),@ch,2,rw);
data:= data +2;
wch [i]:= ch;
inc (i);
until
(Ord (ch) = 0) or (i>= 255);
i:= 0;
str:='';
repeat
str:= str + wch [i];
inc (i);
until
wch [i]='';
result:= str;
end;
...
var
hp2,hpmax2,mp2,mpmax2,nama: integer;
whp2,whpmax2,wmp2,wmpmax2,nob2,wnama2: dword;
begin
ReadProcessMemory (hProses, Pointer($b29184), @wnama, sizeof
(wnama),NoB);
//ReadProcessMemory (hProses, Pointer($1c), @wnama, sizeof(wnama),
NoB);
ReadProcessMemory (hProses, Pointer($34), @wnama, sizeof(wnama),
NoB);
ReadProcessMemory(hProses, Pointer($638), @nama, sizeof(nama), NoB);
label6.Caption:=ReadPlayerName(hproses,wnama);
( I just got a character like this = 깤 ¡)
how to get the character's name correctly
thanks for the help
var
i, rw: DWord;
ch: WideChar;
wch: array [0 .. 255] of WideChar;
str: string;
begin
i:= 0;
repeat
ReadProcessMemory (hProcess, ptr (data),@ch,2,rw);
data:= data +2;
wch [i]:= ch;
inc (i);
until
(Ord (ch) = 0) or (i>= 255);
i:= 0;
str:='';
repeat
str:= str + wch [i];
inc (i);
until
wch [i]='';
result:= str;
end;
...
var
hp2,hpmax2,mp2,mpmax2,nama: integer;
whp2,whpmax2,wmp2,wmpmax2,nob2,wnama2: dword;
begin
ReadProcessMemory (hProses, Pointer($b29184), @wnama, sizeof
(wnama),NoB);
//ReadProcessMemory (hProses, Pointer($1c), @wnama, sizeof(wnama),
NoB);
ReadProcessMemory (hProses, Pointer($34), @wnama, sizeof(wnama),
NoB);
ReadProcessMemory(hProses, Pointer($638), @nama, sizeof(nama), NoB);
label6.Caption:=ReadPlayerName(hproses,wnama);
( I just got a character like this = 깤 ¡)
how to get the character's name correctly
thanks for the help