Class X64UnwindInfo
- Namespace
- AsmResolver.PE.Exceptions
- Assembly
- AsmResolver.PE.dll
Encodes the effects a function has on the stack pointer, and where the nonvolatile registers are saved on the stack.
public class X64UnwindInfo : SegmentBase, ISegment, IOffsetProvider, IWritable
- Inheritance
-
X64UnwindInfo
- Implements
- Inherited Members
Constructors
X64UnwindInfo()
Creates a new empty instance of the X64UnwindInfo class.
public X64UnwindInfo()
Properties
ChainedFunction
When IsChained is true
, gets or sets the function that this unwind information is
chained with.
public X64RuntimeFunction? ChainedFunction { get; set; }
Property Value
ExceptionHandler
When IsExceptionHandler or IsTerminationHandler is true
, gets or sets
the reference to the exception handler assigned to this unwind information.
public ISegmentReference ExceptionHandler { get; set; }
Property Value
ExceptionHandlerData
When IsExceptionHandler or IsTerminationHandler is true
, gets or sets
the reference to the exception handler data assigned to this unwind information.
public ISegmentReference ExceptionHandlerData { get; set; }
Property Value
Flags
Gets or sets the flags associated to the unwind information.
public X64UnwindFlags Flags { get; set; }
Property Value
FrameRegister
Gets the number of the nonvolatile register used as the frame pointer, using the same encoding for the operation info field of UNWIND_CODE nodes.
public byte FrameRegister { get; set; }
Property Value
FrameRegisterOffset
If FrameRegister is nonzero, gets or sets the scaled offset from RSP that is applied to the FP register when it is established.
public byte FrameRegisterOffset { get; set; }
Property Value
IsChained
Gets or sets a value indicating whether this unwind info structure is not the primary one for the procedure. Instead, the chained unwind info entry is the contents of a previous RUNTIME_FUNCTION entry.
public bool IsChained { get; set; }
Property Value
IsExceptionHandler
Gets or sets a value indicating whether the function has an exception handler that should be called when looking for functions that need to examine exceptions.
public bool IsExceptionHandler { get; set; }
Property Value
IsTerminationHandler
Gets or sets a value indicating whether the function has a termination handler that should be called when unwinding an exception.
public bool IsTerminationHandler { get; set; }
Property Value
SizeOfProlog
Gets or sets the length of the function prolog in bytes.
public byte SizeOfProlog { get; set; }
Property Value
UnwindCodes
Gets or sets an array of items that explains the effect of the prolog on the nonvolatile registers and RSP.
public ushort[] UnwindCodes { get; set; }
Property Value
- ushort[]
Version
Gets or sets the version number of the unwind info..
public byte Version { get; set; }
Property Value
Remarks
Should be 1.
Methods
FromReader(PEReaderContext, ref BinaryStreamReader)
Reads unwind information from the provided input stream.
public static X64UnwindInfo FromReader(PEReaderContext context, ref BinaryStreamReader reader)
Parameters
context
PEReaderContextThe reader context.
reader
BinaryStreamReaderThe input stream.
Returns
- X64UnwindInfo
The read unwind information.
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.