大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 技术开发 -> 程序开发 -> 取得某一dll所有输出函数名

取得某一dll所有输出函数名

时间: 2021-07-31 作者:daque

在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  endend;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.freeend;//rock//连载请保持此消息

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.