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

Class that provides an interface over the Dyld export info. More...

#include <ExportInfo.hpp>

Inheritance diagram for LIEF::MachO::ExportInfo:
Collaboration diagram for LIEF::MachO::ExportInfo:

Public Types

enum class  KIND : uint64_t { REGULAR = 0x00u , THREAD_LOCAL_KIND = 0x01u , ABSOLUTE_KIND = 0x02u }
 
enum class  FLAGS : uint64_t { WEAK_DEFINITION = 0x04u , REEXPORT = 0x08u , STUB_AND_RESOLVER = 0x10u }
 
using flag_list_t = std::vector<FLAGS>
 
- 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

 ExportInfo ()=default
 
 ExportInfo (uint64_t address, uint64_t flags, uint64_t offset=0)
 
ExportInfooperator= (ExportInfo copy)
 
 ExportInfo (const ExportInfo &copy)
 
void swap (ExportInfo &other) noexcept
 
uint64_t node_offset () const
 Original offset in the export Trie.
 
uint64_t flags () const
 Some information (ExportInfo::FLAGS) about the export. (like weak export, reexport, ...)
 
void flags (uint64_t flags)
 
flag_list_t flags_list () const
 The export flags() as a list.
 
bool has (FLAGS flag) const
 Check if the current entry contains the provided ExportInfo::FLAGS.
 
KIND kind () const
 The export's kind (regular, thread local, absolute, ...)
 
uint64_t other () const
 
uint64_t address () const
 The address of the export.
 
void address (uint64_t addr)
 
bool has_symbol () const
 Check if a symbol is associated with this export.
 
const Symbolsymbol () const
 MachO::Symbol associated with this export or a nullptr if no symbol.
 
Symbolsymbol ()
 
Symbolalias ()
 If the export is a ExportInfo::FLAGS::REEXPORT, this returns the (optional) MachO::Symbol.
 
const Symbolalias () const
 
DylibCommandalias_library ()
 If the export is a ExportInfo::FLAGS::REEXPORT, this returns the (optional) library (MachO::DylibCommand)
 
const DylibCommandalias_library () const
 
 ~ExportInfo () override=default
 
void accept (Visitor &visitor) const override
 
- 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 ()
 

Detailed Description

Class that provides an interface over the Dyld export info.

This class does not represent a structure that exists in the Mach-O format specification but provides a view on an entry of the Dyld export trie.

Member Typedef Documentation

◆ flag_list_t

Member Enumeration Documentation

◆ FLAGS

enum class LIEF::MachO::ExportInfo::FLAGS : uint64_t
strong
Enumerator
WEAK_DEFINITION 
REEXPORT 
STUB_AND_RESOLVER 

◆ KIND

enum class LIEF::MachO::ExportInfo::KIND : uint64_t
strong
Enumerator
REGULAR 
THREAD_LOCAL_KIND 
ABSOLUTE_KIND 

Constructor & Destructor Documentation

◆ ExportInfo() [1/3]

LIEF::MachO::ExportInfo::ExportInfo ( )
default

◆ ExportInfo() [2/3]

LIEF::MachO::ExportInfo::ExportInfo ( uint64_t address,
uint64_t flags,
uint64_t offset = 0 )
inline

◆ ExportInfo() [3/3]

LIEF::MachO::ExportInfo::ExportInfo ( const ExportInfo & copy)

◆ ~ExportInfo()

LIEF::MachO::ExportInfo::~ExportInfo ( )
overridedefault

Member Function Documentation

◆ accept()

void LIEF::MachO::ExportInfo::accept ( Visitor & visitor) const
overridevirtual

Implements LIEF::Object.

◆ address() [1/2]

uint64_t LIEF::MachO::ExportInfo::address ( ) const
inline

The address of the export.

◆ address() [2/2]

void LIEF::MachO::ExportInfo::address ( uint64_t addr)
inline

◆ alias() [1/2]

Symbol * LIEF::MachO::ExportInfo::alias ( )
inline

If the export is a ExportInfo::FLAGS::REEXPORT, this returns the (optional) MachO::Symbol.

◆ alias() [2/2]

const Symbol * LIEF::MachO::ExportInfo::alias ( ) const
inline

◆ alias_library() [1/2]

DylibCommand * LIEF::MachO::ExportInfo::alias_library ( )
inline

If the export is a ExportInfo::FLAGS::REEXPORT, this returns the (optional) library (MachO::DylibCommand)

◆ alias_library() [2/2]

const DylibCommand * LIEF::MachO::ExportInfo::alias_library ( ) const
inline

◆ flags() [1/2]

uint64_t LIEF::MachO::ExportInfo::flags ( ) const
inline

Some information (ExportInfo::FLAGS) about the export. (like weak export, reexport, ...)

◆ flags() [2/2]

void LIEF::MachO::ExportInfo::flags ( uint64_t flags)
inline

◆ flags_list()

flag_list_t LIEF::MachO::ExportInfo::flags_list ( ) const

The export flags() as a list.

◆ has()

bool LIEF::MachO::ExportInfo::has ( FLAGS flag) const

Check if the current entry contains the provided ExportInfo::FLAGS.

◆ has_symbol()

bool LIEF::MachO::ExportInfo::has_symbol ( ) const
inline

Check if a symbol is associated with this export.

◆ kind()

KIND LIEF::MachO::ExportInfo::kind ( ) const
inline

The export's kind (regular, thread local, absolute, ...)

◆ node_offset()

uint64_t LIEF::MachO::ExportInfo::node_offset ( ) const
inline

Original offset in the export Trie.

◆ operator=()

ExportInfo & LIEF::MachO::ExportInfo::operator= ( ExportInfo copy)

◆ other()

uint64_t LIEF::MachO::ExportInfo::other ( ) const
inline

◆ swap()

void LIEF::MachO::ExportInfo::swap ( ExportInfo & other)
noexcept

◆ symbol() [1/2]

Symbol * LIEF::MachO::ExportInfo::symbol ( )
inline

◆ symbol() [2/2]

const Symbol * LIEF::MachO::ExportInfo::symbol ( ) const
inline

MachO::Symbol associated with this export or a nullptr if no symbol.


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