Class MetaDataTablesHdr
The Meta Data Tables Header contains information about all present data tables in the .Net assembly.
Implements
Namespace: PeNet.Header.Net
Assembly: PeNet.dll
Syntax
public class MetaDataTablesHdr : AbstractStructure, IMetaDataTablesHdr
Constructors
| Improve this Doc View SourceMetaDataTablesHdr(IRawFile, Int64)
Create a new Meta Data Tables Header instance from a byte array.
Declaration
public MetaDataTablesHdr(IRawFile peFile, long offset)
Parameters
Type | Name | Description |
---|---|---|
IRawFile | peFile | PE file which contains a MetaDataTablesHdr structure. |
System.Int64 | offset | Offset in the PE file, where the header starts. |
Properties
| Improve this Doc View SourceExtraData
When present in the PE file, gets or sets the extra 32-bits stored after the table row counts.
Declaration
public uint? ExtraData { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.UInt32> |
Remarks
This is an undocumented feature of the CLR. See also: https://github.com/dotnet/runtime/blob/ce2165d8084cca98b95f5d8ff9386759bfd8c722/src/coreclr/md/runtime/metamodel.cpp#L290
HasExtraData
Gets a value indicating whether the tables stream header contains an additional 32-bits after the table row counts.
Declaration
public bool HasExtraData { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
This is an undocumented feature of the CLR. See also: https://github.com/dotnet/runtime/blob/ce2165d8084cca98b95f5d8ff9386759bfd8c722/src/coreclr/md/runtime/metamodel.cpp#L290
HeapSizes
The first 3 bits indicate the size of indexes into the streams. Bit 0 (0x01) set: Indexes into #String are 4 bytes wide. Bit 1 (0x02) set: Indexes into #GUID heap are 4 bytes wide. Bit 2 (0x04) set: Indexes into #Blob heap are 4 bytes wide. If bit not set: indexes into heap is 2 bytes wide.
The remainder bits are undocumented, but exist in the current implementation of the CLR. Bit 4 (0x40) set: Indicates that 4 extra bytes are stored in the tables stream header.
Declaration
public byte HeapSizes { get; set; }
Property Value
Type | Description |
---|---|
System.Byte |
MajorVersion
Major Version.
Declaration
public byte MajorVersion { get; set; }
Property Value
Type | Description |
---|---|
System.Byte |
MaskSorted
Bit mask which shows, which tables are sorted.
Declaration
public ulong MaskSorted { get; set; }
Property Value
Type | Description |
---|---|
System.UInt64 |
MaskValid
Bit mask which shows, which tables are present in the .Net assembly. Maximal 64 tables can be present, but most tables are not defined such that the high bits of the mask are always 0.
Declaration
public MaskValidType MaskValid { get; set; }
Property Value
Type | Description |
---|---|
MaskValidType |
MaskValidResolved
MaskValid flags resolved to readable strings.
Declaration
public List<string> MaskValidResolved { get; }
Property Value
Type | Description |
---|---|
List<System.String> |
MinorVersion
Minor Version.
Declaration
public byte MinorVersion { get; set; }
Property Value
Type | Description |
---|---|
System.Byte |
Reserved1
Reserved1, always 0.
Declaration
public uint Reserved1 { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Reserved2
Reserved2, always 1.
Declaration
public byte Reserved2 { get; set; }
Property Value
Type | Description |
---|---|
System.Byte |
TableDefinitions
Access a list of defined tables in the Meta Data Tables Header with the name and number of rows of the table.
Declaration
public List<MetaDataTablesHdr.MetaDataTableInfo> TableDefinitions { get; }
Property Value
Type | Description |
---|---|
List<MetaDataTablesHdr.MetaDataTableInfo> |
Tables
Access all parsed meta data tables.
Declaration
public Tables Tables { get; }
Property Value
Type | Description |
---|---|
Tables |
Methods
| Improve this Doc View SourceResolveMaskValid(MaskValidType)
Resolve which tables are present in the .Net header based on the MaskValid flags from the MetaDataTablesHdr.
Declaration
public static List<string> ResolveMaskValid(MaskValidType maskValid)
Parameters
Type | Name | Description |
---|---|---|
MaskValidType | maskValid | MaskValid value from the MetaDataTablesHdr |
Returns
Type | Description |
---|---|
List<System.String> | List with present table names. |