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

Class that provides an interface over a binding operation. More...

#include <BindingInfo.hpp>

Inheritance diagram for LIEF::MachO::BindingInfo:
Collaboration diagram for LIEF::MachO::BindingInfo:

Public Types

enum class  TYPES {
  UNKNOWN = 0 , DYLD_INFO , CHAINED , CHAINED_LIST ,
  INDIRECT_SYMBOL
}
 
- 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

 BindingInfo ()=default
 
 BindingInfo (const BindingInfo &other)
 
void swap (BindingInfo &other) noexcept
 
bool has_segment () const
 Check if a MachO::SegmentCommand is associated with this binding.
 
const SegmentCommandsegment () const
 The MachO::SegmentCommand associated with the BindingInfo or a nullptr of it is not bind to a SegmentCommand.
 
SegmentCommandsegment ()
 
bool has_library () const
 Check if a MachO::DylibCommand is tied with the BindingInfo.
 
const DylibCommandlibrary () const
 MachO::DylibCommand associated with the BindingInfo or a nullptr if not present.
 
DylibCommandlibrary ()
 
bool has_symbol () const
 Check if a MachO::Symbol is associated with the BindingInfo.
 
const Symbolsymbol () const
 MachO::Symbol associated with the BindingInfo or a nullptr if not present.
 
Symbolsymbol ()
 
virtual uint64_t address () const
 Address of the binding.
 
virtual void address (uint64_t addr)
 
int32_t library_ordinal () const
 
void library_ordinal (int32_t ordinal)
 
int64_t addend () const
 Value added to the segment's virtual address when bound.
 
void addend (int64_t addend)
 
bool is_weak_import () const
 
void set_weak_import (bool val=true)
 
virtual TYPES type () const =0
 The type of the binding. This type provides the origin of the binding (LC_DYLD_INFO or LC_DYLD_CHAINED_FIXUPS)
 
 ~BindingInfo () override=default
 
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 ()
 

Detailed Description

Class that provides an interface over a binding operation.

This class does not represent a structure that exists in the Mach-O format specifications but it provides a view of a binding operation that is performed by the Dyld binding bytecode (LC_DYLD_INFO) or the Dyld chained fixups (DYLD_CHAINED_FIXUPS)

See: LIEF::MachO::ChainedBindingInfo, LIEF::MachO::DyldBindingInfo

Member Enumeration Documentation

◆ TYPES

Enumerator
UNKNOWN 
DYLD_INFO 
CHAINED 

Binding associated with the Dyld info opcodes.

CHAINED_LIST 

Binding associated with the chained fixups.

INDIRECT_SYMBOL 

Internal use.

Constructor & Destructor Documentation

◆ BindingInfo() [1/2]

LIEF::MachO::BindingInfo::BindingInfo ( )
default

◆ BindingInfo() [2/2]

LIEF::MachO::BindingInfo::BindingInfo ( const BindingInfo & other)

◆ ~BindingInfo()

LIEF::MachO::BindingInfo::~BindingInfo ( )
overridedefault

Member Function Documentation

◆ accept()

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

◆ addend() [1/2]

int64_t LIEF::MachO::BindingInfo::addend ( ) const
inline

Value added to the segment's virtual address when bound.

◆ addend() [2/2]

void LIEF::MachO::BindingInfo::addend ( int64_t addend)
inline

◆ address() [1/2]

virtual uint64_t LIEF::MachO::BindingInfo::address ( ) const
inlinevirtual

Address of the binding.

Reimplemented in LIEF::MachO::ChainedBindingInfo.

◆ address() [2/2]

virtual void LIEF::MachO::BindingInfo::address ( uint64_t addr)
inlinevirtual

◆ cast() [1/2]

template<class T >
T * LIEF::MachO::BindingInfo::cast ( )
inline

◆ cast() [2/2]

template<class T >
const T * LIEF::MachO::BindingInfo::cast ( ) const
inline

◆ has_library()

bool LIEF::MachO::BindingInfo::has_library ( ) const
inline

Check if a MachO::DylibCommand is tied with the BindingInfo.

◆ has_segment()

bool LIEF::MachO::BindingInfo::has_segment ( ) const
inline

Check if a MachO::SegmentCommand is associated with this binding.

◆ has_symbol()

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

Check if a MachO::Symbol is associated with the BindingInfo.

◆ is_weak_import()

bool LIEF::MachO::BindingInfo::is_weak_import ( ) const
inline

◆ library() [1/2]

DylibCommand * LIEF::MachO::BindingInfo::library ( )
inline

◆ library() [2/2]

const DylibCommand * LIEF::MachO::BindingInfo::library ( ) const
inline

MachO::DylibCommand associated with the BindingInfo or a nullptr if not present.

◆ library_ordinal() [1/2]

int32_t LIEF::MachO::BindingInfo::library_ordinal ( ) const
inline

◆ library_ordinal() [2/2]

void LIEF::MachO::BindingInfo::library_ordinal ( int32_t ordinal)
inline

◆ segment() [1/2]

SegmentCommand * LIEF::MachO::BindingInfo::segment ( )
inline

◆ segment() [2/2]

const SegmentCommand * LIEF::MachO::BindingInfo::segment ( ) const
inline

The MachO::SegmentCommand associated with the BindingInfo or a nullptr of it is not bind to a SegmentCommand.

◆ set_weak_import()

void LIEF::MachO::BindingInfo::set_weak_import ( bool val = true)
inline

◆ swap()

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

◆ symbol() [1/2]

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

◆ symbol() [2/2]

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

MachO::Symbol associated with the BindingInfo or a nullptr if not present.

◆ type()

virtual TYPES LIEF::MachO::BindingInfo::type ( ) const
pure virtual

The type of the binding. This type provides the origin of the binding (LC_DYLD_INFO or LC_DYLD_CHAINED_FIXUPS)

Implemented in LIEF::MachO::ChainedBindingInfo, LIEF::MachO::DyldBindingInfo, and LIEF::MachO::IndirectBindingInfo.


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