LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
LIEF::PE::unwind_aarch64::UnpackedFunction Class Reference

This class represents an unpacked AArch64 exception entry. More...

#include <UnpackedFunction.hpp>

Inheritance diagram for LIEF::PE::unwind_aarch64::UnpackedFunction:
Collaboration diagram for LIEF::PE::unwind_aarch64::UnpackedFunction:

Classes

struct  epilog_scope_t
 This strucure describes an epilog scope. More...
 

Public Types

using epilog_scopes_t = std::vector<epilog_scope_t>
 
using it_epilog_scopes = ref_iterator<epilog_scopes_t&>
 
using it_const_epilog_scopes = const_ref_iterator<const epilog_scopes_t&>
 
- Public Types inherited from LIEF::PE::RuntimeFunctionAArch64
enum class  PACKED_FLAGS { UNPACKED = 0 , PACKED = 1 , PACKED_FRAGMENT = 2 , RESERVED = 3 }
 
- Public Types inherited from LIEF::PE::ExceptionInfo
enum class  ARCH { UNKNOWN = 0 , ARM64 , X86_64 }
 Arch discriminator for the subclasses. More...
 

Public Member Functions

 UnpackedFunction (uint32_t rva, uint32_t length)
 
 UnpackedFunction (const UnpackedFunction &)=default
 
UnpackedFunctionoperator= (const UnpackedFunction &)=default
 
 UnpackedFunction (UnpackedFunction &&)=default
 
UnpackedFunctionoperator= (UnpackedFunction &&)=default
 
 ~UnpackedFunction () override=default
 
std::unique_ptr< ExceptionInfoclone () const override
 
std::string to_string () const override
 
uint32_t xdata_rva () const
 RVA where this unpacked data is located (usually pointing in .xdata)
 
uint32_t version () const
 Describes the version of the remaining .xdata.
 
uint8_t X () const
 1-bit field that indicates the presence (1) or absence (0) of exception data.
 
uint8_t E () const
 1-bit field that indicates that information describing a single epilog is packed into the header (1) rather than requiring more scope words later (0).
 
uint16_t epilog_count () const
 If E() == 0, specifies the count of the total number of epilog scopes. Otherwise, return 0
 
uint16_t epilog_offset () const
 If E() == 1, index of the first unwind code that describes the one and only epilog.
 
uint32_t code_words () const
 Number of 32-bit words needed to contain all of the unwind codes.
 
uint32_t exception_handler () const
 Exception handler RVA (if any)
 
span< const uint8_t > unwind_code () const
 Bytes that contain the unwind codes.
 
span< uint8_t > unwind_code ()
 
it_epilog_scopes epilog_scopes ()
 Iterator over the epilog scopes.
 
it_const_epilog_scopes epilog_scopes () const
 
UnpackedFunctionxdata_rva (uint32_t value)
 
UnpackedFunctionversion (uint32_t value)
 
UnpackedFunctionX (uint8_t value)
 
UnpackedFunctionE (uint8_t value)
 
UnpackedFunctionepilog_cnt_offset (uint16_t value)
 
UnpackedFunctioncode_words (uint32_t value)
 
UnpackedFunctionexception_handler (uint32_t value)
 
UnpackedFunctionepilog_scopes (epilog_scopes_t scopes)
 
UnpackedFunctionunwind_code (std::vector< uint8_t > code)
 
- Public Member Functions inherited from LIEF::PE::RuntimeFunctionAArch64
 RuntimeFunctionAArch64 (uint64_t RVA, uint32_t length, PACKED_FLAGS flag)
 
 RuntimeFunctionAArch64 (const RuntimeFunctionAArch64 &)=default
 
RuntimeFunctionAArch64operator= (const RuntimeFunctionAArch64 &)=default
 
 RuntimeFunctionAArch64 (RuntimeFunctionAArch64 &&)=default
 
RuntimeFunctionAArch64operator= (RuntimeFunctionAArch64 &&)=default
 
uint32_t length () const
 Length of the function in bytes.
 
PACKED_FLAGS flag () const
 Flag describing the format the unwind data.
 
uint32_t rva_end () const
 Function end address.
 
 ~RuntimeFunctionAArch64 ()=default
 
- Public Member Functions inherited from LIEF::PE::ExceptionInfo
 ExceptionInfo ()=delete
 
 ExceptionInfo (const ExceptionInfo &)=default
 
ExceptionInfooperator= (const ExceptionInfo &)=default
 
 ExceptionInfo (ExceptionInfo &&)=default
 
ExceptionInfooperator= (ExceptionInfo &&)=default
 
 ExceptionInfo (ARCH arch, uint64_t rva)
 
 ExceptionInfo (ARCH arch)
 
ARCH arch () const
 Target architecture of this exception.
 
uint32_t rva_start () const
 Function start address.
 
virtual ~ExceptionInfo ()=default
 
template<class T >
Tas ()
 Helper to downcast an ExceptionInfo into a concrete implementation.
 
template<class T >
const Tas () const
 

Static Public Member Functions

static std::unique_ptr< UnpackedFunctionparse (Parser &ctx, BinaryStream &strm, uint32_t xdata_rva, uint32_t rva)
 
static bool classof (const ExceptionInfo *info)
 
- Static Public Member Functions inherited from LIEF::PE::RuntimeFunctionAArch64
static std::unique_ptr< RuntimeFunctionAArch64parse (Parser &ctx, BinaryStream &strm)
 
static bool classof (const ExceptionInfo *info)
 
- Static Public Member Functions inherited from LIEF::PE::ExceptionInfo
static std::unique_ptr< ExceptionInfoparse (Parser &ctx, BinaryStream &strm)
 
static std::unique_ptr< ExceptionInfoparse (Parser &ctx, BinaryStream &strm, Header::MACHINE_TYPES arch)
 

Detailed Description

This class represents an unpacked AArch64 exception entry.

Reference: https://learn.microsoft.com/en-us/cpp/build/arm64-exception-handling?view=msvc-170#xdata-records

Member Typedef Documentation

◆ epilog_scopes_t

◆ it_const_epilog_scopes

◆ it_epilog_scopes

Constructor & Destructor Documentation

◆ UnpackedFunction() [1/3]

LIEF::PE::unwind_aarch64::UnpackedFunction::UnpackedFunction ( uint32_t rva,
uint32_t length )
inline

◆ UnpackedFunction() [2/3]

LIEF::PE::unwind_aarch64::UnpackedFunction::UnpackedFunction ( const UnpackedFunction & )
default

◆ UnpackedFunction() [3/3]

LIEF::PE::unwind_aarch64::UnpackedFunction::UnpackedFunction ( UnpackedFunction && )
default

◆ ~UnpackedFunction()

LIEF::PE::unwind_aarch64::UnpackedFunction::~UnpackedFunction ( )
overridedefault

Member Function Documentation

◆ classof()

static bool LIEF::PE::unwind_aarch64::UnpackedFunction::classof ( const ExceptionInfo * info)
inlinestatic

◆ clone()

std::unique_ptr< ExceptionInfo > LIEF::PE::unwind_aarch64::UnpackedFunction::clone ( ) const
inlineoverridevirtual

Reimplemented from LIEF::PE::RuntimeFunctionAArch64.

◆ code_words() [1/2]

uint32_t LIEF::PE::unwind_aarch64::UnpackedFunction::code_words ( ) const
inline

Number of 32-bit words needed to contain all of the unwind codes.

◆ code_words() [2/2]

UnpackedFunction & LIEF::PE::unwind_aarch64::UnpackedFunction::code_words ( uint32_t value)
inline

◆ E() [1/2]

uint8_t LIEF::PE::unwind_aarch64::UnpackedFunction::E ( ) const
inline

1-bit field that indicates that information describing a single epilog is packed into the header (1) rather than requiring more scope words later (0).

◆ E() [2/2]

UnpackedFunction & LIEF::PE::unwind_aarch64::UnpackedFunction::E ( uint8_t value)
inline

◆ epilog_cnt_offset()

UnpackedFunction & LIEF::PE::unwind_aarch64::UnpackedFunction::epilog_cnt_offset ( uint16_t value)
inline

◆ epilog_count()

uint16_t LIEF::PE::unwind_aarch64::UnpackedFunction::epilog_count ( ) const
inline

If E() == 0, specifies the count of the total number of epilog scopes. Otherwise, return 0

References LIEF::PE::E.

◆ epilog_offset()

uint16_t LIEF::PE::unwind_aarch64::UnpackedFunction::epilog_offset ( ) const
inline

If E() == 1, index of the first unwind code that describes the one and only epilog.

References LIEF::PE::E.

◆ epilog_scopes() [1/3]

it_epilog_scopes LIEF::PE::unwind_aarch64::UnpackedFunction::epilog_scopes ( )
inline

Iterator over the epilog scopes.

◆ epilog_scopes() [2/3]

it_const_epilog_scopes LIEF::PE::unwind_aarch64::UnpackedFunction::epilog_scopes ( ) const
inline

◆ epilog_scopes() [3/3]

UnpackedFunction & LIEF::PE::unwind_aarch64::UnpackedFunction::epilog_scopes ( epilog_scopes_t scopes)
inline

◆ exception_handler() [1/2]

uint32_t LIEF::PE::unwind_aarch64::UnpackedFunction::exception_handler ( ) const
inline

Exception handler RVA (if any)

◆ exception_handler() [2/2]

UnpackedFunction & LIEF::PE::unwind_aarch64::UnpackedFunction::exception_handler ( uint32_t value)
inline

◆ operator=() [1/2]

UnpackedFunction & LIEF::PE::unwind_aarch64::UnpackedFunction::operator= ( const UnpackedFunction & )
default

◆ operator=() [2/2]

UnpackedFunction & LIEF::PE::unwind_aarch64::UnpackedFunction::operator= ( UnpackedFunction && )
default

◆ parse()

static std::unique_ptr< UnpackedFunction > LIEF::PE::unwind_aarch64::UnpackedFunction::parse ( Parser & ctx,
BinaryStream & strm,
uint32_t xdata_rva,
uint32_t rva )
static

◆ to_string()

std::string LIEF::PE::unwind_aarch64::UnpackedFunction::to_string ( ) const
overridevirtual

Reimplemented from LIEF::PE::RuntimeFunctionAArch64.

◆ unwind_code() [1/3]

span< uint8_t > LIEF::PE::unwind_aarch64::UnpackedFunction::unwind_code ( )
inline

◆ unwind_code() [2/3]

span< const uint8_t > LIEF::PE::unwind_aarch64::UnpackedFunction::unwind_code ( ) const
inline

Bytes that contain the unwind codes.

◆ unwind_code() [3/3]

UnpackedFunction & LIEF::PE::unwind_aarch64::UnpackedFunction::unwind_code ( std::vector< uint8_t > code)
inline

◆ version() [1/2]

uint32_t LIEF::PE::unwind_aarch64::UnpackedFunction::version ( ) const
inline

Describes the version of the remaining .xdata.

Currently (2025-01-04), only version 0 is defined, so values of 1-3 aren't permitted.

◆ version() [2/2]

UnpackedFunction & LIEF::PE::unwind_aarch64::UnpackedFunction::version ( uint32_t value)
inline

◆ X() [1/2]

uint8_t LIEF::PE::unwind_aarch64::UnpackedFunction::X ( ) const
inline

1-bit field that indicates the presence (1) or absence (0) of exception data.

◆ X() [2/2]

UnpackedFunction & LIEF::PE::unwind_aarch64::UnpackedFunction::X ( uint8_t value)
inline

◆ xdata_rva() [1/2]

uint32_t LIEF::PE::unwind_aarch64::UnpackedFunction::xdata_rva ( ) const
inline

RVA where this unpacked data is located (usually pointing in .xdata)

◆ xdata_rva() [2/2]

UnpackedFunction & LIEF::PE::unwind_aarch64::UnpackedFunction::xdata_rva ( uint32_t value)
inline

Member Data Documentation

◆ epilog_count_

uint32_t LIEF::PE::unwind_aarch64::UnpackedFunction::epilog_count_

◆ epilog_offset_

uint32_t LIEF::PE::unwind_aarch64::UnpackedFunction::epilog_offset_ = 0

The documentation for this class was generated from the following file: