Class ReadyToRunDirectory
- Namespace
- AsmResolver.PE.DotNet.ReadyToRun
- Assembly
- AsmResolver.PE.dll
Represents a managed native header of a .NET portable executable file that is in the ReadyToRun format.
public class ReadyToRunDirectory : SegmentBase, IManagedNativeHeader, ISegment, IOffsetProvider, IWritable
- Inheritance
-
ReadyToRunDirectory
- Implements
- Derived
- Inherited Members
Properties
Attributes
Gets or sets the flags associated with the ReadyToRun module.
public ReadyToRunAttributes Attributes { get; set; }
Property Value
MajorVersion
Gets the major version of the file format that is used.
public ushort MajorVersion { get; set; }
Property Value
MinorVersion
Gets the minor version of the file format that is used.
public ushort MinorVersion { get; set; }
Property Value
Sections
Gets the individual sections referenced by the ReadyToRun directory.
public IList<IReadyToRunSection> Sections { get; }
Property Value
Signature
Gets the signature of the native header, indicating the type of metadata that is stored.
public ManagedNativeHeaderSignature Signature { get; }
Property Value
Methods
GetPhysicalSize()
Computes the number of bytes that the structure contains.
public override uint GetPhysicalSize()
Returns
- uint
The number of bytes.
GetSection(ReadyToRunSectionType)
Gets a section by its section type.
public IReadyToRunSection GetSection(ReadyToRunSectionType type)
Parameters
typeReadyToRunSectionTypeThe type of section.
Returns
- IReadyToRunSection
The section.
Exceptions
- ArgumentException
Occurs when there is no section of the provided type present in the directory.
GetSection<TSection>()
Gets a section by its section type.
public TSection GetSection<TSection>() where TSection : class, IReadyToRunSection
Returns
- TSection
The section.
Type Parameters
TSectionThe type of section.
Exceptions
- ArgumentException
Occurs when there is no section of the provided type present in the directory.
GetSections()
Obtains the sections referenced by the directory.
protected virtual IList<IReadyToRunSection> GetSections()
Returns
- IList<IReadyToRunSection>
The sections.
Remarks
This method is called upon initialization of the Sections property.
TryGetSection(ReadyToRunSectionType, out IReadyToRunSection?)
Attempts to get a section by its section type.
public bool TryGetSection(ReadyToRunSectionType type, out IReadyToRunSection? section)
Parameters
typeReadyToRunSectionTypeThe type of the section.
sectionIReadyToRunSectionThe section, or
nullif none was found.
Returns
- bool
trueif the section was found,falseotherwise.
TryGetSection<TSection>(out TSection?)
Attempts to get a section by its section type.
public bool TryGetSection<TSection>(out TSection? section) where TSection : class, IReadyToRunSection
Parameters
sectionTSectionThe section, or
nullif none was found.
Returns
- bool
trueif the section was found,falseotherwise.
Type Parameters
TSectionThe type of section.
Write(BinaryStreamWriter)
Serializes the structure to an output stream.
public override void Write(BinaryStreamWriter writer)
Parameters
writerBinaryStreamWriterThe output stream to write the data to.