我在哪里可以找到的CorFlags价值手段是每个位参考?我在、个位、可以找到、手段

2023-09-04 22:41:30 作者:刪了回忆、却刪不了痛

我瞎搞一些比较低层次的东西,并试图确定为什么我得到的CorFlags.exe工具不同的输出。作为参考,在输出为这样:

I'm messing around with some rather low level things and trying to determine why I get different outputs with the CorFlags.exe utility. For reference, the outputs are as so:


$ corflags test2.exe
Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  4.0.30319.17929
Copyright (c) Microsoft Corporation.  All rights reserved.

Version   : v4.0.30319
CLR Header: 2.5
PE        : PE32
CorFlags  : 0x1
ILONLY    : 1
32BITREQ  : 0
32BITPREF : 0
Signed    : 0

$ corflags test.exe
Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  4.0.30319.17929
Copyright (c) Microsoft Corporation.  All rights reserved.

Version   : v4.0.30319
CLR Header: 2.5
PE        : PE32
CorFlags  : 0x20003
ILONLY    : 1
32BITREQ  : 0
32BITPREF : 1
Signed    : 0

我试图找出在CorFlags值的平均值未在CorFlags实用暴露了其他位。哪里是这个基准?

I'm trying to figure out what the other bits in the CorFlags value mean that aren't exposed in the CorFlags utility. Where is a reference for this?

推荐答案

您实际上看到融合了来自PE32头(PE场)信息和清单嵌入汇编(其余)的头。这是在Windows SDK的所有描述,你需要的版本8,以获得新的32BIT preF的标志。使用C:\ Program Files文件(x86)的\的Windows套件\ 8.0 \包括\ UM \ CorHdr.h,很多在此文件中的注释描述该声明

You are actually seeing a blend of info from the PE32 header (PE field) and the header of the manifest embedded in the assembly (the rest). This is all described in the Windows SDK, you'll need version 8 to get the new 32BITPREF flag. Use C:\Program Files (x86)\Windows Kits\8.0\Include\um\CorHdr.h, lots of comments in this file that describe the declarations.

我会复制部分描述IMAGE_COR20_HEADER.Flags值:

I'll copy the section that describes the IMAGE_COR20_HEADER.Flags values:

COMIMAGE_FLAGS_ILONLY               =0x00000001,
COMIMAGE_FLAGS_32BITREQUIRED        =0x00000002,
COMIMAGE_FLAGS_IL_LIBRARY           =0x00000004,
COMIMAGE_FLAGS_STRONGNAMESIGNED     =0x00000008,
COMIMAGE_FLAGS_NATIVE_ENTRYPOINT    =0x00000010,
COMIMAGE_FLAGS_TRACKDEBUGDATA       =0x00010000,
COMIMAGE_FLAGS_32BITPREFERRED       =0x00020000,

所以0x20003分解成32BIT preFERRED(地址0x20000)加32BITREQUIRED(0x00002)加ILONLY显示的值(0x00001)

So a displayed value of 0x20003 breaks down into 32BITPREFERRED (0x20000) plus 32BITREQUIRED (0x00002) plus ILONLY (0x00001)