In case anyone needs it :
This is what I wrote some time ago for reading chat messages from array :
Very messy code, and I know that typecasting widestring to string is not safe at all, but I couldnt be arsed to fix it back then. Just dumping this here.
Indx is the current chat index (The counter that counts even though you cleared your log), length is the length of the message you wish to copy / 2 (unicode).
Hope this helps a bit, cheers...
This is what I wrote some time ago for reading chat messages from array :
Code:
function TPWChat.GetMessage(Indx: Integer; length: Integer): string;
var
written: cardinal;
eax: cardinal;
indexcalc: cardinal;
Str: array [0 .. 240] of Widechar;
begin
if Indx < 199 then
begin
indexcalc := (((Indx - 1) * $1C) + $18);
ReadProcessMemory(Pidhandle, ptr(chatbase), @eax, sizeof(eax), written);
ReadProcessMemory(Pidhandle, ptr(eax + indexcalc), @eax,
sizeof(eax), written);
ReadProcessMemory(Pidhandle, ptr(eax + $0), @Str, length, written);
Result := Str;
end;
if Indx >= 199 then
begin
ReadProcessMemory(Pidhandle, ptr(chatbase), @eax, sizeof(eax), written);
ReadProcessMemory(Pidhandle, ptr(eax + $15B0), @eax, sizeof(eax), written);
ReadProcessMemory(Pidhandle, ptr(eax + $0), @Str, length, written);
Result := Str;
end;
end;
Indx is the current chat index (The counter that counts even though you cleared your log), length is the length of the message you wish to copy / 2 (unicode).
Hope this helps a bit, cheers...