corflags

Interpreting the CorFlags flags


How do I interpret the CorFlags flags and how should I use it to determine if a .NET assembly was built for x86 or x64?

Could it be the following?

corflags MyAssembly.dll

Solution

  • Open the Visual Studio Command Prompt (in Windows: menu StartProgramsMicrosoft Visual StudioVisual Studio ToolsVisual Studio 2010 Command Prompt)

    CD to the directory containing the DLL in question.

    Run corflags like this:

    corflags MyAssembly.dll
    

    The output looks like this:

    Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  4.0.30319.1
    
    Copyright (c) Microsoft Corporation.  All rights reserved.
    
    Version   : v4.0.30319
    CLR Header: 2.5
    PE        : PE32
    CorFlags  : 1
    ILONLY    : 1
    32BIT     : 0
    Signed    : 0
    

    The flags' interpretation:

    Any CPU: PE = PE32 and 32BIT = 0
    
    x86: PE = PE32 and 32BIT = 1
    
    64-bit: PE = PE32+ and 32BIT = 0