LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
LIEF::ELF::NoteAbi Class Reference

Class that wraps the NT_GNU_ABI_TAG note. More...

#include <NoteAbi.hpp>

Inheritance diagram for LIEF::ELF::NoteAbi:
Inheritance graph
[legend]
Collaboration diagram for LIEF::ELF::NoteAbi:
Collaboration graph
[legend]

Public Types

enum class  ABI {
  LINUX = 0 , GNU , SOLARIS2 , FREEBSD ,
  NETBSD , SYLLABLE , NACL
}
 ABI recognized by this note.
 
using version_t = std::array<uint32_t, 3>
 Version type: (Major, Minor, Patch)
 
- 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
}
 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>>>
 

Public Member Functions

std::unique_ptr< Noteclone () const override
 Clone the current note and keep its polymorphic type.
 
result< version_tversion () const
 Return the version or an error if it can't be parsed.
 
result< ABIabi () const
 Return the ABI or an error if it can't be parsed.
 
void version (const version_t &version)
 
void version (ABI abi)
 
void dump (std::ostream &os) const override
 
void accept (Visitor &visitor) const override
 
 Note (const Note &copy)=default
 
- Public Member Functions inherited from LIEF::ELF::Note
Noteoperator= (const Note &copy)=default
 
 Note (const Note &copy)=default
 
const std::string & name () const
 Return the name of the note (also known as 'owner' )
 
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.
 
- Public Member Functions inherited from LIEF::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
 

Static Public Member Functions

static bool classof (const Note *note)
 
static constexpr uint8_t description_size ()
 
- 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< const char * > 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, 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, 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, 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.
 

Static Public Attributes

static constexpr size_t abi_offset = 0
 
static constexpr size_t abi_size = sizeof(uint32_t)
 
static constexpr size_t version_offset = abi_size
 
static constexpr size_t version_size = 3 * sizeof(uint32_t)
 

Detailed Description

Class that wraps the NT_GNU_ABI_TAG note.

Member Function Documentation

◆ accept()

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

Reimplemented from LIEF::ELF::Note.

◆ clone()

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

Clone the current note and keep its polymorphic type.

Reimplemented from LIEF::ELF::Note.

◆ dump()

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

Reimplemented from LIEF::ELF::Note.


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