谢谢
解决方案 »
- for_each(coll.begin(),colll.end(), &Person::person);
- 谁帮我改好程序100分送上,高手谢谢了
- 数据库->ClistCtrl的问题 解决马上送分
- 我想做一个自己的BUTTON类从CBUTTONST继承,可是在创建的时候基类只有CBUTTON,没有CBUTTONST类
- 请问如何使用windows api或消息取得文本框中被选择的文本?(不使用clipboard)
- ^-^ 用vc++进行摄像头的图像采集
- MajorVon()进来接分!
- 关于一个大学生是否违约的问题?请你关注。。。。。。。。。。
- 怎么去掉模态属性页的确定,取消,应用按钮?
- ReadEventLog问题?
- IE的问题
- 这个错是因为指针越界么?如何解决呢?
http://vip.6to23.com/NowCan1/tech/pe.htm
取得某一dll所有输出函数名
在uses里加上ImageHlpprocedure ListDLLFunctions(DLLName: String; List: TStrings);
type
chararr = array [0..$FFFFFF] 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^)[I]=#0 then
begin
st := PChar(@chararr(arr^)[fc]);
if Length(st)>0 then
List.Add(st);
if (I>0) and (chararr(arr^)[I-1]=#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:\windows\system\Abcsda.dll', List);
showmessage(inttostr(list.count));
S := 'List of functions';
for I := 0 to List.Count - 1 do
S := S + #13#10 + List[I];
ShowMessage(S); List.Free
end;//rock
看看这个
http://vip.6to23.com/NowCan1/tech/dll_crk.htm