2017-05-03 5 views
0

PEファイルのCOM_DESCRIPTORディレクトリに関する情報を探しています。それは何ですか?それは何のために使われていますか?私はPEファイルの構造を読んだが、COM_DESCRIPTORが何であるか分からない。PE-filesのCOM_DESCRIPTOR

ありがとうございます!

+0

こんにちは、歓迎、StackOverflow。ヘルプページ、特に[ここではどのトピックについて聞かせていただけますか?](http://stackoverflow.com/help/on-topic)と[質問しないでください。」](http://stackoverflow.com/help/dont-ask)。さらに重要なことは、[Stack Overflow question checklist](http://meta.stackexchange.com/q/156810/204922)をお読みください。 –

答えて

0

PEヘッダーの「COM記述子ディレクトリ」は、「CLRヘッダー」とも呼ばれます。これはManaged PE Images(C#および他のDot Netコンパイラで作成されたもの)にのみ存在します。 DumpBin/CLRHRADERオプションを使用してこのディレクトリの内容をダンプできます。たとえば、このディレクトリエントリポイントで

  48 cb 
     2.05 runtime version 
     30C4 [ 1DEC] RVA [size] of MetaData Directory 
      1 flags 
       IL Only 
    6000004 entry point token 
     4EB0 [ 2560] RVA [size] of Resources Directory 
      0 [  0] RVA [size] of StrongNameSignature Directory 
      0 [  0] RVA [size] of CodeManagerTable Directory 
      0 [  0] RVA [size] of VTableFixups Directory 
      0 [  0] RVA [size] of ExportAddressTableJumps Directory 
      0 [  0] RVA [size] of ManagedNativeHeader Directory 

RVA WINNT.Hで定義さIMAGE_COR20_HEADERする:

DumBin/CLRHEADERは

CLRヘッダをsomeapp.exe。また、CorHdr.hで定義されています。

typedef struct IMAGE_COR20_HEADER 
{ 
    // Header versioning 
    DWORD     cb;    
    WORD     MajorRuntimeVersion; 
    WORD     MinorRuntimeVersion; 

    // Symbol table and startup information 
    IMAGE_DATA_DIRECTORY MetaData;   
    DWORD     Flags;   

    // The main program if it is an EXE (not used if a DLL?) 
    // If COMIMAGE_FLAGS_NATIVE_ENTRYPOINT is not set, EntryPointToken represents a managed entrypoint. 
    // If COMIMAGE_FLAGS_NATIVE_ENTRYPOINT is set, EntryPointRVA represents an RVA to a native entrypoint 
    // (depricated for DLLs, use modules constructors intead). 
    union { 
     DWORD    EntryPointToken; 
     DWORD    EntryPointRVA; 
    }; 

    // This is the blob of managed resources. Fetched using code:AssemblyNative.GetResource and 
    // code:PEFile.GetResource and accessible from managed code from 
    // System.Assembly.GetManifestResourceStream. The meta data has a table that maps names to offsets into 
    // this blob, so logically the blob is a set of resources. 
    IMAGE_DATA_DIRECTORY Resources; 
    // IL assemblies can be signed with a public-private key to validate who created it. The signature goes 
    // here if this feature is used. 
    IMAGE_DATA_DIRECTORY StrongNameSignature; 

    IMAGE_DATA_DIRECTORY CodeManagerTable;   // Depricated, not used 
    // Used for manged codee that has unmaanaged code inside it (or exports methods as unmanaged entry points) 
    IMAGE_DATA_DIRECTORY VTableFixups; 
    IMAGE_DATA_DIRECTORY ExportAddressTableJumps; 

    // null for ordinary IL images. NGEN images it points at a code:CORCOMPILE_HEADER structure 
    IMAGE_DATA_DIRECTORY ManagedNativeHeader; 

} IMAGE_COR20_HEADER, *PIMAGE_COR20_HEADER; 
関連する問題