//显示DLL文件调用的API函数<br>procedure ListDLLAPI(FileName:string);<br>type<br> PDWordArray=^TDWordArray;<br> TDWordArray= array [0..0] of DWORD;<br>var<br> ImageInfo : PloadedImage;<br> pExportDirectory : PImageExportDirectory;<br> dirsize : Cardinal;<br> pDummy : PImageSectionHeader;<br> i : Cardinal;<br> pNameRVAs : PDWordArray;<br>begin<br> ImageInfo := new(PloadedImage);<br> pExportDirectory := new(PImageExportDirectory);<br> pDummy := new(PImageSectionHeader);<br><br> if MapAndLoad(Pchar(FileName), nil, Imageinfo, True,True ) then<br> begin<br> try<br> pExportDirectory:=ImageDirectoryEntryToData(ImageInfo.MappedAddress,False,<br> IMAGE_DIRECTORY_ENTRY_EXPORT,dirsize);<br> if (pExportDirectory<>nil) then<br> begin<br> pNameRVAs:=PDWordArray(ImageRvaToVa(ImageInfo.FileHeader,ImageInfo.MappedAddress,<br> DWORD(pExportDirectory^.AddressOfNames), pDummy));<br> for i:=0 to pExportDirectory^.NumberOfNames-1 do<br> with mainform.DllAPILists.Items.Add do<br> caption:=Pchar(ImageRvaToVa(ImageInfo.FileHeader,ImageInfo.MappedAddress,<br> pNameRVAs^,pDummy));<br> end;<br> finally<br> UnMapAndLoad(Imageinfo);<br> end;<br> end;<br>end;<br>