Show / Hide Table of Contents

Class MetaDataTablesHdr

The Meta Data Tables Header contains information about all present data tables in the .Net assembly.

Inheritance
System.Object
AbstractStructure
MetaDataTablesHdr
Implements
IMetaDataTablesHdr
Namespace: PeNet.Header.Net
Assembly: PeNet.dll
Syntax
public class MetaDataTablesHdr : AbstractStructure, IMetaDataTablesHdr

Constructors

| Improve this Doc View Source

MetaDataTablesHdr(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 Source

ExtraData

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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
| Improve this Doc View Source

MajorVersion

Major Version.

Declaration
public byte MajorVersion { get; set; }
Property Value
Type Description
System.Byte
| Improve this Doc View Source

MaskSorted

Bit mask which shows, which tables are sorted.

Declaration
public ulong MaskSorted { get; set; }
Property Value
Type Description
System.UInt64
| Improve this Doc View Source

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
| Improve this Doc View Source

MaskValidResolved

MaskValid flags resolved to readable strings.

Declaration
public List<string> MaskValidResolved { get; }
Property Value
Type Description
List<System.String>
| Improve this Doc View Source

MinorVersion

Minor Version.

Declaration
public byte MinorVersion { get; set; }
Property Value
Type Description
System.Byte
| Improve this Doc View Source

Reserved1

Reserved1, always 0.

Declaration
public uint Reserved1 { get; set; }
Property Value
Type Description
System.UInt32
| Improve this Doc View Source

Reserved2

Reserved2, always 1.

Declaration
public byte Reserved2 { get; set; }
Property Value
Type Description
System.Byte
| Improve this Doc View Source

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>
| Improve this Doc View Source

Tables

Access all parsed meta data tables.

Declaration
public Tables Tables { get; }
Property Value
Type Description
Tables

Methods

| Improve this Doc View Source

ResolveMaskValid(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.

Implements

IMetaDataTablesHdr
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX