Show / Hide Table of Contents

Class MetaDataTablesHdr

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

Inheritance
object
AbstractStructure
MetaDataTablesHdr
Implements
IMetaDataTablesHdr
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: PeNet.Header.Net
Assembly: PeNet.dll
Syntax
public class MetaDataTablesHdr : AbstractStructure, IMetaDataTablesHdr

Constructors

| Edit this page View Source

MetaDataTablesHdr(IRawFile, long)

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.

long offset

Offset in the PE file, where the header starts.

Properties

| Edit this page 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
uint?
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

| Edit this page 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
bool
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

| Edit this page 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
byte
| Edit this page View Source

MajorVersion

Major Version.

Declaration
public byte MajorVersion { get; set; }
Property Value
Type Description
byte
| Edit this page View Source

MaskSorted

Bit mask which shows, which tables are sorted.

Declaration
public ulong MaskSorted { get; set; }
Property Value
Type Description
ulong
| Edit this page 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
| Edit this page View Source

MaskValidResolved

MaskValid flags resolved to readable strings.

Declaration
public List<string> MaskValidResolved { get; }
Property Value
Type Description
List<string>
| Edit this page View Source

MinorVersion

Minor Version.

Declaration
public byte MinorVersion { get; set; }
Property Value
Type Description
byte
| Edit this page View Source

Reserved1

Reserved1, always 0.

Declaration
public uint Reserved1 { get; set; }
Property Value
Type Description
uint
| Edit this page View Source

Reserved2

Reserved2, always 1.

Declaration
public byte Reserved2 { get; set; }
Property Value
Type Description
byte
| Edit this page 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>
| Edit this page View Source

Tables

Access all parsed meta data tables.

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

Methods

| Edit this page 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<string>

List with present table names.

Implements

IMetaDataTablesHdr
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX