当前位置: 移动技术网 > 网络运营>安全>企业安全 > 教初学者如何把执行文件内存中的DLL的代码全部保存下来

教初学者如何把执行文件内存中的DLL的代码全部保存下来

2019年05月25日  | 移动技术网网络运营  | 我要评论
有时,有些软件有保护,看不到他程序内部是怎么一个样,如果想简单的把他的内存保存下来! 我写了一个简单的函数,调用一下就可以把DLL和EXE的内存里的信息全部导到文件里!到时再... 08-10-08
有时,有些软件有保护,看不到他程序内部是怎么一个样,如果想简单的把他的内存保存下来!
我写了一个简单的函数,调用一下就可以把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;

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网