function ReadMemoryResult(Addr: cardinal
Len: Integer): string;
var
hl, hr: THandle;
buf: array[0..256] of byte;
readNum: cardinal;
I: Integer;
T: dword;
sResult: string;
begin
hl := FindWindow('Afx:400000:0:10011:0:0', '【魔域】');
GetWindowThreadProcessID(hl, hr);
hl := OpenProcess(PROCESS_VM_READ, false, hr);
ReadProcessMemory(hl, Pointer(addr), @buf, 256, T);
for I := 0 to 256 do
begin
if buf = 0 then
break;
if sResult = '' then
sResult := IntToHex(buf, 2)
else
sResult := sResult + ' ' + IntToHex(buf, 2);
end;
Result := sResult;
end;
function TransMemoryStr(sInput: string): string;
var
t: string;
begin
while sInput <> '' do
begin
t := t + chr(strtoint('$' + copy(sInput, 1, 2)));
delete(sInput, 1, 3);
end;
Result := t;
end;
调用部分,不过你拿过去可能要做稍微的改动