Figure 1
Figure 1 Module Metadata Information
Metadata Definition Table Name |
Description |
ModuleDef |
Always contains one entry that identifies the module. The entry includes the module's file name and extension (without path) and a module version ID (in the form of a GUID created by the compiler). This allows the file's name to be changed while keeping a record of its original filename. |
TypeDef |
Contains one entry for each type defined in the module. Each entry includes the type's name, base type, flags (public, private, and so on), and points to the methods it owns in the MethodDef table as well as the fields it owns in the FieldDef table. |
MethodDef |
Contains one entry for each method defined in the module. Each entry includes the method's name, flags (private, public, virtual, abstract, static, final, and so on), signature, offset within the module where Microsoft Intermediate Language (MSIL) code can be found. Each entry may also refer to a ParamDef table entry where more information about the method's parameters can be found. |
FieldDef |
Contains one entry for every field defined in the module. Each entry includes a name, flags (private, public, and so on), and type. |
ParamDef |
Contains one entry for each parameter defined in the module. Each entry includes a name and flags (in, out, retval, and so on). |
PropertyDef |
Contains one entry for each property defined in the module. Each entry includes a name, flags, type, and backing field (which may be null). |
EventDef |
Contains one entry for each event defined in the module. Each entry includes a name and flags. |
Figure 2 Assembly Reference Metadata Information
Metadata Reference Table Name |
Description |
AssemblyRef |
Contains one entry for each assembly referenced by the module. Each entry includes the information necessary to bind to the assembly: the assembly's name (without path and extension), version number, culture, and public key token (normally a small hash value identifying the referenced assembly's public key). Each entry also contains some flags and a hash value. |
ModuleRef |
Contains one entry for each PE module that implements types referenced by this module. Each entry includes the module's file name and extension (without path). This table is used to bind to types that are implemented in different modules of the calling assembly's module. |
TypeRef |
Contains one entry for each type referenced by the module. Each entry includes the type's name and a reference to where the type can be found. If the type is implemented in a different assembly, then the reference indicates an AssemblyRef entry. If the type is implemented in a module within the calling assembly, then the reference indicates a ModuleRef entry. |
MemberRef |
Contains one entry for each member (fields, methods, as well as property and event methods) referenced by the module. Each entry includes the member's name and signature, and points to the TypeRef entry for the type that defines the member. |
Figure 3 Show Metadata
Version of runtime against which the binary is built : 2000.14.2007.0
ScopeName : assmain.exe
MVID : {82B5C4CB-7A48-4D64-A96F-E77C9AC60A82}
===========================================================
Global functions
Global fields
Global MemberRefs
TypeDef #1
TypDefName: App (02000002)
Flags : [Public] [AutoLayout] [Class] [AnsiClass] (00000001)
Version : 0:0:0:0
Extends : 01000001 [TypeRef] System.Object
Method #1 [ENTRYPOINT]
MethodName: Main (06000001)
Flags : [Public] [Static] [HideBySig] [ReuseSlot] (00000096)
RVA : 0x00001050
ImplFlags : [IL] [Managed] (00000000)
CallCnvntn: [DEFAULT]
ReturnType: Void
1 Arguments
Argument #1: SZArray String
1 Parameters
(1) MethodToken : (06000001) Name : args flags: [none] (00000000) default:
Method #2
MethodName: .ctor (06000002)
Flags : [Public] [HideBySig] [ReuseSlot] [SpecialName] [RTSpecialName] [.ctor] (00001886)
RVA : 0x0000105c
ImplFlags : [IL] [Managed] (00000000)
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
No arguments.
TypeRef #1 (01000001)
Token: 0x01000001
ResolutionScope: 0x23000001
TypeRefName: System.Object
MemberRef #1
Member: (0a000003) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
No arguments.
TypeRef #2 (01000002)
Token: 0x01000002
ResolutionScope: 0x23000001
TypeRefName: System.Diagnostics.DebuggableAttribute
MemberRef #1
Member: (0a000001) .ctor:
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
2 Arguments
Argument #1: Boolean
Argument #2: Boolean
TypeRef #3 (01000003)
Token: 0x01000003
ResolutionScope: 0x23000001
TypeRefName: System.Console
MemberRef #1
Member: (0a000002) WriteLine:
CallCnvntn: [DEFAULT]
ReturnType: Void
1 Arguments
Argument #1: String
Assembly
Token: 0x20000001
Name : assmain
Originator Blob : <null>
Hash Algorithm : 0x00008004
Major Version: 0x00000000
Minor Version: 0x00000000
Revision Number: 0x00000000
Build Number: 0x00000000
Locale: <null>
Configuration: <null>
Title :
Description :
Flags : [SideBySideCompatible] (00000000)
CustomAttribute #1 (0c000001)
CustomAttribute Type: 0a000001
CustomAttributeName: System.Diagnostics.DebuggableAttribute :: instance void .ctor(bool,bool)
Value Blob length : 6
Value : 01 00 00 01 00 00
ctor args: ()
AssemblyRef #1
Token: 0x23000001
Originator Blob: 03 68 91 16 d3 a4 ae 33
Name: mscorlib
Major Version: 0x000007d0
Minor Version: 0x0000000e
Revision Number: 0x000007d7
Build Number: 0x00000000
Locale: <null>
Configuration: <null>
HashValue Blob: 04 9c cc 43 f0 57 2d 68 35 29 43 62 10 69 75 89 9b 34 42 e2
ExecutionLocation token: 0x29000000
Flags: [none] (00000000)
User Strings
70000001 : ( 2) L"Hi"
Figure 4 View Statistics
File size : 2560
PE header size : 512 (456 used) (20.00%)
PE additional info : 883 (34.49%)
Num.of PE sections : 2
COM+ header size : 72 ( 2.81%)
COM+ meta-data size : 620 (24.22%)
COM+ additional info : 0 ( 0.00%)
COM+ method headers : 2 ( 0.08%)
Managed code : 18 ( 0.70%)
Data : 1024 (40.00%)
Unaccounted : -571 (-22.30%)
Num.of PE sections : 2
.text - 1024
.rsrc - 1024
COM+ meta-data size : 620
Module - 1 (6 bytes)
TypeDef - 2 (48 bytes) 0 interfaces, 0 explicit layout
TypeRef - 3 (18 bytes)
MethodDef - 2 (28 bytes) 0 abstract, 0 native, 2 bodies
MemberRef - 3 (18 bytes)
ParamDef - 1 (6 bytes)
CustomValue - 1 (6 bytes)
Assembly - 1 (30 bytes)
AssemblyRef - 1 (24 bytes)
Strings - 200 bytes
Blobs - 60 bytes
UserStrings - 8 bytes
Guids - 16 bytes
Uncategorized - 152 bytes
COM+ method headers : 2
Num.of method bodies - 2
Num.of fat headers - 0
Num.of tiny headers - 2
Managed code : 18
Ave method size - 9
Figure 5 Metadata Manifest Tables
Metadata Manifest Table Name |
Description |
AssemblyDef |
Contains a single entry if this module identifies an assembly. The entry includes the assembly's name (without path and extension), culture, version (major, minor, build, and revision), flags, hash algorithm, and the publisher's public key. |
FileDef |
Contains one entry for each PE and resource file that is part of the assembly. The entry includes the file's name and extension (without path), hash value, and flags. If this assembly consists only of its own file, then this table has no entries. |
ManifestResourceDef |
Contains one entry for each resource that is part of the assembly. The entry includes the resource's name, flags (public, private), and an index into the FileDef table indicating the file that contains the resource file or stream. If the resource is not a standalone file (such as JPEG or GIF), then the resource is a stream contained within a PE file. For an embedded resource, the entry also includes an offset indicating the start of the resource stream within the PE file. |
ExportedTypesDef |
Contains one entry for each public type exported from all the assembly's PE modules. The entry includes the type's name, an index into the FileDef table (indicating which of this assembly's files implements the type), and an index into the TypeDef table. Note: to save file space, types exported from the file containing the manifest are not repeated in this table since the type information is available using the metadata's TypeDef table. |
AssemblyProcessorDef |
Contains one entry for each CPU supported by modules of the assembly. Each entry includes a processor identifier (as defined in WinNT.h) such as PROCESSOR_INTER_PENTIUM, PROCESSOR_INTEL_IA64, and so on. Usually, this table is empty. This information is for reference only; the runtime ignores it. This information might be interesting because some modules (built with C++ with managed extensions, for example) may contain native CPU code. |
AssemblyOSDef |
Contains one entry for OS supported by the modules of the assembly. Each entry includes the platform ID (such as VER_PLATFORM_ WIN32_WINDOWS, VER_PLATFORM_WIN32_NT, or VER_PLATFORM_WIN32_CE), and the OS major and minor version. Usually, this table is empty. This information is for reference only; the runtime ignores it. This information might be interesting because some types and methods may only be available on certain operating systems. |
Figure 7 ILDasm Output
File #1
Token: 0x26000001
Name : RUT.mod
HashValue Blob : bb 11 9e 19 82 8a a5 d1 3e 40 16 9c c9 8a d9 db 4d 4e 9f e6
Flags : [none] (00000000)
ComType #1
Token: 0x27000001
Name: ARarelyUsedType
Description token:
Implementation token: 0x26000001
TypeDef token: 0x02000002
ExecutionLocation token: 0x29000000
Flags : [Public] [AutoLayout] [Class] [AnsiClass] (00000001)
Figure 11 Generate Version Information
using System.Reflection;
// Set the version CompanyName, LegalCopyright & LegalTrademarks fields
[assembly:AssemblyCompany("The Jeffrey Richter Company")]
[assembly:AssemblyCopyright("Copyright (c) 2000 Jeffrey Richter")]
[assembly:AssemblyTrademark("FUT & RUT are a registered trademark of the Jeffrey Richter Company")]
// Set the version ProductName & ProductVersion fields
[assembly:AssemblyProduct("Jeffrey Richter Type Library")]
[assembly:AssemblyInformationalVersion("2.0.*")]
// Set the version FileVersion, FileDescription, and Comments fields
[assembly:AssemblyVersion("1.0.*")]
[assembly:AssemblyTitle("Jeff's FUT & RUT assembly")]
[assembly:AssemblyDescription("This assembly contains Jeff's FUTs & RUTs")]
Figure 12 Version Resource Fields and Attributes
Version Resource |
AL Switch |
Custom Attribute/Comment |
FILEVERSION |
/version |
System.Reflection.AssemblyVersionAttribute. |
PRODUCTVERSION |
/productversion |
System.Reflection.AssemblyInformationalVersionAttribute. |
FILEFLAGSMASK |
(none) |
This value is always set to VS_FFI_FILEFLAGSMASK (defined in WinVer.h as 0x0000003F). |
FILEFLAGS |
(none) |
Always 0. |
FILEOS |
(none) |
Currently always VOS__WINDOWS32. |
FILETYPE |
/type |
Set to VFT_APP if /type:exe or /type:win is specified. Set to VFT_DLL if /type:lib is specified. |
FILESUBTYPE |
(none) |
Always set to VFT2_UNKNOWN (this field has no meaning for VFT_APP and VFT_DLL). |
Comments |
/description |
System.Reflection.AssemblyDescriptionAttribute. |
CompanyName |
/company |
System.Reflection.AssemblyCompanyAttribute. |
FileDescription |
/title |
System.Reflection.AssemblyTitleAttribute. |
FileVersion |
/version |
System.Reflection.AssemblyVersionAttribute. |
InternalName |
/out |
Set to the name of the output file specified (without the extension). |
LegalCopyright |
/copyright |
System.Reflection.AssemblyCopyrightAttribute. |
LegalTrademarks |
/trademark |
System.Reflection.AssemblyTrademarkAttribute. |
OriginalFilename |
/out |
Set to the name of the output file (without a path). |
PrivateBuild |
(none) |
Always blank. |
ProductName |
/product |
System.Reflection.AssemblyProductAttribute. |
ProductVersion |
/productversion |
System.Reflection.AssemblyInformationalVersionAttribute. |
SpecialBuild |
(none) |
Always blank. |