LIEF: Library to Instrument Executable Formats Version 0.16.0
Loading...
Searching...
No Matches
LIEF::ELF::CorePrStatus Class Reference

Class representing core PrPsInfo object. More...

#include <CorePrStatus.hpp>

Inheritance diagram for LIEF::ELF::CorePrStatus:
Collaboration diagram for LIEF::ELF::CorePrStatus:

Classes

struct  pr_status_t
 
struct  Registers
 
struct  siginfo_t
 
struct  timeval_t
 

Public Member Functions

 CorePrStatus (ARCH arch, Header::CLASS cls, std::string name, uint32_t type, description_t description)
 
std::unique_ptr< Noteclone () const override
 Clone the current note and keep its polymorphic type.
 
pr_status_t status () const
 Return the pr_status_t structure.
 
void status (const pr_status_t &status)
 
ARCH architecture () const
 
result< uint64_t > pc () const
 The program counter or an error if not found.
 
result< uint64_t > sp () const
 The stack pointer or an error if not found.
 
result< uint64_t > return_value () const
 The value of the register that holds the return value according to the calling convention.
 
result< uint64_t > get (Registers::X86 reg) const
 Get the value for the given X86 register or return an error.
 
result< uint64_t > get (Registers::X86_64 reg) const
 Get the value for the given X86_64 register or return an error.
 
result< uint64_t > get (Registers::ARM reg) const
 Get the value for the given ARM register or return an error.
 
result< uint64_t > get (Registers::AARCH64 reg) const
 Get the value for the given AARCH64 register or return an error.
 
ok_error_t set (Registers::X86 reg, uint64_t value)
 
ok_error_t set (Registers::X86_64 reg, uint64_t value)
 
ok_error_t set (Registers::ARM reg, uint64_t value)
 
ok_error_t set (Registers::AARCH64 reg, uint64_t value)
 
std::vector< uint64_t > register_values () const
 A list of the register values. This list is guarantee to be as long as the Registers::ARM::_COUNT or empty if it can't be resolved. Thus, one can access a specific register with:
 
result< uint64_t > operator[] (Registers::X86 reg) const
 
result< uint64_t > operator[] (Registers::X86_64 reg) const
 
result< uint64_t > operator[] (Registers::ARM reg) const
 
result< uint64_t > operator[] (Registers::AARCH64 reg) const
 
void dump (std::ostream &os) const override
 
void accept (Visitor &visitor) const override
 
 ~CorePrStatus () override=default
 
- Public Member Functions inherited from LIEF::ELF::Note
Noteoperator= (const Note &copy)=default
 
 Note (const Note &copy)=default
 
 ~Note () override=default
 
const std::string & name () const
 Return the name of the note (also known as 'owner' )
 
const std::string & section_name () const
 Return the section name in which the note is or should be stored.
 
TYPE type () const
 Return the type of the note. This type does not match the NT_ type value. For accessing the original NT_ value, check original_type()
 
uint32_t original_type () const
 The original NT_xxx integer value. The meaning of this value likely depends on the owner of the note.
 
span< const uint8_t > description () const
 Return the description associated with the note.
 
span< uint8_t > description ()
 
void name (std::string name)
 
void description (description_t description)
 Change the description of the note.
 
uint64_t size () const
 Size of the raw note which includes padding.
 
void accept (Visitor &visitor) const override
 
template<class T >
const T * cast () const
 
template<class T >
T * cast ()
 
- Public Member Functions inherited from LIEF::Object
 Object ()
 
 Object (const Object &other)
 
Objectoperator= (const Object &other)
 
template<class T >
output_t< T > as ()
 
template<class T >
output_const_t< T > as () const
 
virtual bool operator== (const Object &other) const
 
virtual bool operator!= (const Object &other) const
 
virtual ~Object ()
 

Static Public Member Functions

static bool classof (const Note *note)
 
- Static Public Member Functions inherited from LIEF::ELF::Note
static result< TYPEconvert_type (Header::FILE_TYPE ftype, uint32_t type, const std::string &name)
 Convert the raw integer note type into a TYPE according to the owner.
 
static result< const char * > type_to_section (TYPE type)
 Try to determine the ELF section name associated with the TYPE provided in parameter.
 
static result< std::string > note_to_section (const Note &note)
 
static result< const char * > type_owner (TYPE type)
 Try to determine the owner's name of the TYPE provided in parameter.
 
static std::unique_ptr< Notecreate (const std::string &name, uint32_t type, description_t description, std::string section_name, Header::FILE_TYPE ftype=Header::FILE_TYPE::NONE, ARCH arch=ARCH::NONE, Header::CLASS cls=Header::CLASS::NONE)
 Create a new note from the given parameters. Additional information such as the architecture or the ELF class could be required for creating notes like Coredump notes.
 
static std::unique_ptr< Notecreate (const std::string &name, TYPE type, description_t description, std::string section_name, ARCH arch=ARCH::NONE, Header::CLASS cls=Header::CLASS::NONE)
 Create a new note from the given parameters. Additional information such as the architecture or the ELF class could be required for creating notes like Coredump notes.
 
static std::unique_ptr< Notecreate (BinaryStream &stream, std::string section_name, Header::FILE_TYPE ftype=Header::FILE_TYPE::NONE, ARCH arch=ARCH::NONE, Header::CLASS cls=Header::CLASS::NONE)
 Create a new note from the given stream. Additional information such as the architecture or the ELF class could be required for creating notes like Coredump notes.
 

Additional Inherited Members

- Public Types inherited from LIEF::ELF::Note
enum class  TYPE {
  UNKNOWN = 0 , GNU_ABI_TAG , GNU_HWCAP , GNU_BUILD_ID ,
  GNU_GOLD_VERSION , GNU_PROPERTY_TYPE_0 , GNU_BUILD_ATTRIBUTE_OPEN , GNU_BUILD_ATTRIBUTE_FUNC ,
  CRASHPAD , CORE_PRSTATUS , CORE_FPREGSET , CORE_PRPSINFO ,
  CORE_TASKSTRUCT , CORE_AUXV , CORE_PSTATUS , CORE_FPREGS ,
  CORE_PSINFO , CORE_LWPSTATUS , CORE_LWPSINFO , CORE_WIN32PSTATUS ,
  CORE_FILE , CORE_PRXFPREG , CORE_SIGINFO , CORE_ARM_VFP ,
  CORE_ARM_TLS , CORE_ARM_HW_BREAK , CORE_ARM_HW_WATCH , CORE_ARM_SYSTEM_CALL ,
  CORE_ARM_SVE , CORE_ARM_PAC_MASK , CORE_ARM_PACA_KEYS , CORE_ARM_PACG_KEYS ,
  CORE_TAGGED_ADDR_CTRL , CORE_PAC_ENABLED_KEYS , CORE_X86_TLS , CORE_X86_IOPERM ,
  CORE_X86_XSTATE , CORE_X86_CET , ANDROID_IDENT , ANDROID_MEMTAG ,
  ANDROID_KUSER , GO_BUILDID , STAPSDT , QNX_STACK
}
 LIEF representation of the ELF NT_ values. More...
 
using description_t = std::vector<uint8_t>
 Container used to handle the description data.
 
- Public Types inherited from LIEF::Object
template<class T >
using output_t = add_pointer_t<decay_t<T>>
 
template<class T >
using output_const_t = add_pointer_t<add_const_t<decay_t<T>>>
 

Detailed Description

Class representing core PrPsInfo object.

Constructor & Destructor Documentation

◆ CorePrStatus()

LIEF::ELF::CorePrStatus::CorePrStatus ( ARCH arch,
Header::CLASS cls,
std::string name,
uint32_t type,
description_t description )
inline

◆ ~CorePrStatus()

LIEF::ELF::CorePrStatus::~CorePrStatus ( )
overridedefault

Member Function Documentation

◆ accept()

void LIEF::ELF::CorePrStatus::accept ( Visitor & visitor) const
overridevirtual

Implements LIEF::Object.

◆ architecture()

ARCH LIEF::ELF::CorePrStatus::architecture ( ) const
inline

◆ classof()

static bool LIEF::ELF::CorePrStatus::classof ( const Note * note)
inlinestatic

◆ clone()

std::unique_ptr< Note > LIEF::ELF::CorePrStatus::clone ( ) const
inlineoverridevirtual

Clone the current note and keep its polymorphic type.

Reimplemented from LIEF::ELF::Note.

◆ dump()

void LIEF::ELF::CorePrStatus::dump ( std::ostream & os) const
overridevirtual

Reimplemented from LIEF::ELF::Note.

Referenced by operator<<.

◆ get() [1/4]

result< uint64_t > LIEF::ELF::CorePrStatus::get ( Registers::AARCH64 reg) const

Get the value for the given AARCH64 register or return an error.

◆ get() [2/4]

result< uint64_t > LIEF::ELF::CorePrStatus::get ( Registers::ARM reg) const

Get the value for the given ARM register or return an error.

◆ get() [3/4]

result< uint64_t > LIEF::ELF::CorePrStatus::get ( Registers::X86 reg) const

Get the value for the given X86 register or return an error.

◆ get() [4/4]

result< uint64_t > LIEF::ELF::CorePrStatus::get ( Registers::X86_64 reg) const

Get the value for the given X86_64 register or return an error.

◆ operator[]() [1/4]

result< uint64_t > LIEF::ELF::CorePrStatus::operator[] ( Registers::AARCH64 reg) const
inline

◆ operator[]() [2/4]

result< uint64_t > LIEF::ELF::CorePrStatus::operator[] ( Registers::ARM reg) const
inline

◆ operator[]() [3/4]

result< uint64_t > LIEF::ELF::CorePrStatus::operator[] ( Registers::X86 reg) const
inline

◆ operator[]() [4/4]

result< uint64_t > LIEF::ELF::CorePrStatus::operator[] ( Registers::X86_64 reg) const
inline

◆ pc()

result< uint64_t > LIEF::ELF::CorePrStatus::pc ( ) const

The program counter or an error if not found.

◆ register_values()

std::vector< uint64_t > LIEF::ELF::CorePrStatus::register_values ( ) const

A list of the register values. This list is guarantee to be as long as the Registers::ARM::_COUNT or empty if it can't be resolved. Thus, one can access a specific register with:

auto reg_vals = register_values()
if (!reg_vals.empty()) {
auto x20 = reg_vals[static_cast<size_t>(Register::AARCH64::X20)]
}
}
std::vector< uint64_t > register_values() const
A list of the register values. This list is guarantee to be as long as the Registers::ARM::_COUNT or ...
ARCH architecture() const
Definition CorePrStatus.hpp:115
@ AARCH64
Definition ELF/enums.hpp:170

◆ return_value()

result< uint64_t > LIEF::ELF::CorePrStatus::return_value ( ) const

The value of the register that holds the return value according to the calling convention.

◆ set() [1/4]

ok_error_t LIEF::ELF::CorePrStatus::set ( Registers::AARCH64 reg,
uint64_t value )

◆ set() [2/4]

ok_error_t LIEF::ELF::CorePrStatus::set ( Registers::ARM reg,
uint64_t value )

◆ set() [3/4]

ok_error_t LIEF::ELF::CorePrStatus::set ( Registers::X86 reg,
uint64_t value )

◆ set() [4/4]

ok_error_t LIEF::ELF::CorePrStatus::set ( Registers::X86_64 reg,
uint64_t value )

◆ sp()

result< uint64_t > LIEF::ELF::CorePrStatus::sp ( ) const

The stack pointer or an error if not found.

◆ status() [1/2]

pr_status_t LIEF::ELF::CorePrStatus::status ( ) const

Return the pr_status_t structure.

◆ status() [2/2]

void LIEF::ELF::CorePrStatus::status ( const pr_status_t & status)

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