zoukankan      html  css  js  c++  java
  • 枚举导出函数

    unit Unit1;
    
    interface
    
    uses ImageHlp,Windows,Dialogs;
    
      procedure ListDLLExports(const AFileName:string);
    
    implementation
    
    procedure ListDLLExports(const AFileName:string);
    
    type
      TDWordArray = array [0..$FFFFF] of DWORD;
    
    var
      image:TLoadedImage;
      pExpDir:PImageExportDirectory;
      iSize:Cardinal;
      pNameRVAs:^TDWordArray;
      i: Integer;
      sName:string;
      lrs:PImageSectionHeader;
    begin
      if MapAndLoad(PAnsiChar(AFileName),nil,@image,true,true) then
      try
        pExpDir := ImageDirectoryEntryToData(image.MappedAddress,false,IMAGE_DIRECTORY_ENTRY_EXPORT,iSize);
        if pExpDir <> nil then
        begin
          lrs := nil;
          pNameRVAs := ImageRvaToVa(image.FileHeader,image.MappedAddress,DWORD(pExpDir^.AddressOfNames),lrs);
          for i := 0 to Pred(pExpDir^.NumberOfNames) do
          begin
            lrs := nil;
            sName := PAnsiChar(ImageRvaToVa(image.FileHeader,image.MappedAddress,DWORD(pNameRVAs^[i]),lrs));
            ShowMessage(sName);
          end;
        end;
      finally
        UnMapAndLoad(@image);
      end;
    end;
    
    end.
    View Code

  • 相关阅读:
    NOIP 2016 回文日期
    USACO Ski Course Design
    USACO Combination Lock
    USACO 利润Profits
    POJ 3368 Frequent values
    USACO Balanced Lineup
    JDOJ 1065 打倒苏联修正主义
    JDOJ 2174 忠诚
    VIJOS-P1514 天才的记忆
    VIJOS-P1423 最佳路线
  • 原文地址:https://www.cnblogs.com/key-ok/p/3380554.html
Copyright © 2011-2022 走看看