突发异想,不知有没有delphi高手能够解决?(200分)

  • 主题发起人 主题发起人 ahhjgh
  • 开始时间 开始时间
A

ahhjgh

Unregistered / Unconfirmed
GUEST, unregistred user!
   任意给你一个dll链接库,有没有办法提取库中的所有输出过程和函数的名字和参数?
 
我不能,有很多程序能(如win98自带的)。<br>但要注意,这样得到的东西价值不大。
 
应该可以<br>但我不知道
 
参考一下这个<br>http://www.delphibbs.com/delphibbs/dispq.asp?LID=1671585
 
名字是可以,参数是不可以的,而且有些函数根本就没有名字。只有序号。
 
//显示DLL文件调用的API函数<br>procedure ListDLLAPI(FileName:string);<br>type<br>&nbsp; &nbsp;PDWordArray=^TDWordArray;<br>&nbsp; &nbsp;TDWordArray= array [0..0] of DWORD;<br>var<br>&nbsp;ImageInfo &nbsp; &nbsp; &nbsp; &nbsp;: PloadedImage;<br>&nbsp;pExportDirectory : PImageExportDirectory;<br>&nbsp;dirsize &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: Cardinal;<br>&nbsp;pDummy &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : PImageSectionHeader;<br>&nbsp;i &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: Cardinal;<br>&nbsp;pNameRVAs &nbsp; &nbsp; &nbsp; &nbsp;: PDWordArray;<br>begin<br>&nbsp;ImageInfo := new(PloadedImage);<br>&nbsp;pExportDirectory := new(PImageExportDirectory);<br>&nbsp;pDummy &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := new(PImageSectionHeader);<br><br>&nbsp;if MapAndLoad(Pchar(FileName), nil, Imageinfo, True,True ) then<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp;try<br>&nbsp; &nbsp; &nbsp; pExportDirectory:=ImageDirectoryEntryToData(ImageInfo.MappedAddress,False,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IMAGE_DIRECTORY_ENTRY_EXPORT,dirsize);<br>&nbsp; &nbsp; &nbsp; &nbsp;if (pExportDirectory&lt;&gt;nil) then<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pNameRVAs:=PDWordArray(ImageRvaToVa(ImageInfo.FileHeader,ImageInfo.MappedAddress,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DWORD(pExportDirectory^.AddressOfNames), pDummy));<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for i:=0 to pExportDirectory^.NumberOfNames-1 do<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;with mainform.DllAPILists.Items.Add do<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;caption:=Pchar(ImageRvaToVa(ImageInfo.FileHeader,ImageInfo.MappedAddress,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pNameRVAs^,pDummy));<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;<br>&nbsp; &nbsp; &nbsp;finally<br>&nbsp; &nbsp; &nbsp; UnMapAndLoad(Imageinfo);<br>&nbsp; &nbsp; &nbsp;end;<br>&nbsp; &nbsp; end;<br>end;<br>
 
yczjs的代码中有很多变量类型是不能识别的,yczjs能不能解释一下,谢谢
 
PloadedImage是什么数据类型?delphi无法识别<br>ImageDirectoryEntryToData是什么函数?delphi无法识别
 
yczjs的方法真的可以取到函数名哎,但是怎么取到参数呢?yczjs,结贴的时候我会给呢一半分数的,谢谢你
 
可以得到函数名<br>用WDASM就可以了
 
接受答案了.
 

Similar threads

后退
顶部