江
江上游者
Unregistered / Unconfirmed
GUEST, unregistred user!
原代码;
procedure TForm1.Button2Click(Sender: TObject);
var
hwnd:cardinal;
pidword;
hProcess:cardinal;
x:string;
Num: cardinal;
i:integer;
s:string;
lpBufferByte;
nSize: DWORD;
lpNumberOfBytesRead: DWORD;
begin
setlength(X,$10);
setlength(X1,$100);
hwnd := FindWindow(nil,'程序名');
if hwnd = 0 then
Exit;
GetWindowThreadProcessId (hwnd, @pid);
hProcess := OpenProcess(PROCESS_ALL_ACCESS, false, pid);
nSize:=$4;
lpBuffer:=AllocMem(nSize);
If hProcess <> 0 Then
begin
if not ReadProcessMemory(hprocess,Pointer($1015334),@x,$12,num) then
begin
label1.Caption := string(@x); //
for i:=$00800001 to $00800020 do
begin
ReadProcessMemory(
hprocess,
Pointer(i),
lpBuffer,
nSize,
num
);
s:=s+intTohex(lpBuffer^,2)+' ';
//读取内容
if (i mod 16) =0 then
begin
Memo1.Lines.Add(s); //
s:=' ';
end;
//格式化输出
end
end
else //2
showmessage('读数失败...!');
end
else //1
showmessage('未启动程序');
CloseHandle(hProcess);
end;
问题:
使用ReadProcessMemory:
1)在ReadProcessMemory(hprocess,Pointer($1015334),@x,$12,num)中,怎么修改Pointer($1015334)中的$1015334数字,label1.Caption := string(@x)的结果都是同一个字.
2)在for i:=$00800001 to $00800020 do
begin
ReadProcessMemory(
hprocess,
Pointer(i),
lpBuffer,
nSize,
num
);
s:=s+intTohex(lpBuffer^,2)+' ';
//读取内容
if (i mod 16) =0 then
begin
Memo1.Lines.Add(s); //
s:=' ';
end;
中,如何修改Pointer(i)中的i值,读出的值是地址值,不能搜索内存内容.
procedure TForm1.Button2Click(Sender: TObject);
var
hwnd:cardinal;
pidword;
hProcess:cardinal;
x:string;
Num: cardinal;
i:integer;
s:string;
lpBufferByte;
nSize: DWORD;
lpNumberOfBytesRead: DWORD;
begin
setlength(X,$10);
setlength(X1,$100);
hwnd := FindWindow(nil,'程序名');
if hwnd = 0 then
Exit;
GetWindowThreadProcessId (hwnd, @pid);
hProcess := OpenProcess(PROCESS_ALL_ACCESS, false, pid);
nSize:=$4;
lpBuffer:=AllocMem(nSize);
If hProcess <> 0 Then
begin
if not ReadProcessMemory(hprocess,Pointer($1015334),@x,$12,num) then
begin
label1.Caption := string(@x); //
for i:=$00800001 to $00800020 do
begin
ReadProcessMemory(
hprocess,
Pointer(i),
lpBuffer,
nSize,
num
);
s:=s+intTohex(lpBuffer^,2)+' ';
//读取内容
if (i mod 16) =0 then
begin
Memo1.Lines.Add(s); //
s:=' ';
end;
//格式化输出
end
end
else //2
showmessage('读数失败...!');
end
else //1
showmessage('未启动程序');
CloseHandle(hProcess);
end;
问题:
使用ReadProcessMemory:
1)在ReadProcessMemory(hprocess,Pointer($1015334),@x,$12,num)中,怎么修改Pointer($1015334)中的$1015334数字,label1.Caption := string(@x)的结果都是同一个字.
2)在for i:=$00800001 to $00800020 do
begin
ReadProcessMemory(
hprocess,
Pointer(i),
lpBuffer,
nSize,
num
);
s:=s+intTohex(lpBuffer^,2)+' ';
//读取内容
if (i mod 16) =0 then
begin
Memo1.Lines.Add(s); //
s:=' ';
end;
中,如何修改Pointer(i)中的i值,读出的值是地址值,不能搜索内存内容.