Class CilExtraSection
- Namespace
- AsmResolver.PE.DotNet.Cil
- Assembly
- AsmResolver.PE.dll
Represents a single section that is appended to the end of a CIL method body, containing additional metadata such as exception handlers.
public class CilExtraSection : SegmentBase, ISegment, IOffsetProvider, IWritable
- Inheritance
-
CilExtraSection
- Implements
- Inherited Members
Remarks
This class does not do any verification on the actual contents of the section.
Constructors
CilExtraSection(CilExtraSectionAttributes, byte[])
Creates a new extra section that can be appended to a method body.
public CilExtraSection(CilExtraSectionAttributes attributes, byte[] data)
Parameters
attributes
CilExtraSectionAttributesThe attributes associated to this section.
data
byte[]The raw contents of the section.
Properties
Attributes
Gets or sets the attributes associated to this section.
public CilExtraSectionAttributes Attributes { get; set; }
Property Value
Remarks
This property does not update automatically if more sections are added to- or removed from the enclosing method body.
Data
Gets or sets the actual contents of the section.
public byte[] Data { get; set; }
Property Value
- byte[]
HasMoreSections
Gets or sets a value indicating there is at least one more section following this section.
public bool HasMoreSections { get; set; }
Property Value
Remarks
This property does not update automatically if more sections are added to- or removed from the enclosing method body.
IsEHTable
Gets or sets a value indicating the section contains an exception handler table.
public bool IsEHTable { get; set; }
Property Value
IsFat
Gets or sets a value indicating the data stored in the section is using the fat format.
public bool IsFat { get; set; }
Property Value
IsOptILTable
Gets or sets a value indicating the sectio contains an OptIL table.
public bool IsOptILTable { get; set; }
Property Value
Methods
FromReader(ref BinaryStreamReader)
Reads a single extra section from the provided input stream.
public static CilExtraSection FromReader(ref BinaryStreamReader reader)
Parameters
reader
BinaryStreamReaderThe input stream to read from.
Returns
- CilExtraSection
The extra section that was read.
GetPhysicalSize()
Computes the number of bytes that the structure contains.
public override uint GetPhysicalSize()
Returns
- uint
The number of bytes.
Write(BinaryStreamWriter)
Serializes the structure to an output stream.
public override void Write(BinaryStreamWriter writer)
Parameters
writer
BinaryStreamWriterThe output stream to write the data to.