我写了一个简单的函数,调用一下就可以把dll和exe的内存里的信息全部导到文件里!到时再慢慢查吧! uses
tlhelp32;
procedure getdllmemtofile;
var
pid: dword;
hand: thandle;
lppe: tmoduleentry32;
found: boolean;
file111: tfilestream;
dd, add1, add2, index: dword;
begin
hand := createtoolhelp32snapshot(th32cs_snapmodule, getcurrentprocessid);
lppe.dwsize := sizeof(lppe);
found := module32first(hand, lppe);
while found do
begin
file111 := tfilestream.create('debug\' extractfilename(lppe.szexepath), $ffff); add1 := dword(lppe.modbaseaddr);
add2 := add1 lppe.modbasesize;
index := dword(lppe.modbaseaddr);
while true do
begin
dd := pdword(index)^;
file111.writebuffer(dd, 4);
inc(index, 4);
if index >= add2 - 4 then break;
end; file111.destroy; found := module32next(hand, lppe);
end;
closehandle(hand); // 释放快照句柄
end;
您可能感兴趣的文章:
如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!
网友评论