取dll所有输出函数名
取得某一dll所有输出函数名来源:考试大在uses里加上ImageHlp
procedure ListDLLFunctions(DLLName: string; List: TStrings);
type
chararr = array of Char;
var
H: THandle;
I,
fc: integer;
st: string;
arr: Pointer;
ImageDebugInformation: PImageDebugInformation;
begin
List.Clear;
DLLName := ExpandFileName(DLLName);
if FileExists(DLLName) then
begin
H := CreateFile(PChar(DLLName), GENERIC_READ, FILE_SHARE_READ or
FILE_SHARE_WRITE, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if H <> INVALID_HANDLE_VALUE then
try
ImageDebugInformation := MapDebugInformation(H, PChar(DLLName), nil, 0);
if ImageDebugInformation <> nil then
try
arr := ImageDebugInformation^.ExportedNames;
fc := 0;
for I := 0 to ImageDebugInformation^.ExportedNamesSize - 1 do
if chararr(arr^) = #0 then
begin
st := PChar(@chararr(arr^));
if Length(st) > 0 then
List.Add(st);
if (I > 0) and (chararr(arr^) = #0) then
Break;
fc := I + 1
end
finally
UnmapDebugInformation(ImageDebugInformation)
end
finally
CloseHandle(H)
end
end
end;
procedure TForm1.Button1Click(Sender: TObject);
var
List: TStrings;
I: integer;
S: string;
begin
List := TStringList.Create;
ListDLLFunctions(' c: windowssystemAbcsda.dll' , List);
showmessage(inttostr(list.count));
S := ' List of functions' ;
for I := 0 to List.Count - 1 do
S := S + #13#10 + List;
ShowMessage(S);
List.Free
end;
//rock
来源:http://www.examda.com/ncre2/Delphi/zonghe/20090914/081347578.html 你取到了DLL输出函数名了吗? \
感觉这份代码莫名其妙。 有空我来传一份真正的取DLL输出函数名的delphi代码上来。 我觉着在这个论坛,Delphi版块很不专业。 wofan 发表于 2011-7-31 17:03 static/image/common/back.gif
我觉着在这个论坛,Delphi版块很不专业。
这于DELPHI关系不大吧,对PE结构的熟悉程序关系大点。
RE: 取dll所有输出函数名
naylon 发表于 2011-7-31 18:20 static/image/common/back.gif这个还是论坛比较冷清,多数人都集中在WIN32内核板块、VB板块。
另外取DLL导出函数的话有个简单的偏方: ...
好像不是【空格】。。。是NULL吧。。。 naylon 发表于 2011-8-7 13:07 static/image/common/back.gif
好吧我写错了~记事本打开0x20和0x00没区别。。
用notepad++能看到区别。 代码很不错哦
页:
[1]