LIEF: Library to Instrument Executable Formats Version 0.15.0
|
Class that represents a rebase relocation found in the LC_DYLD_CHAINED_FIXUPS command. More...
#include <RelocationFixup.hpp>
Public Member Functions | |
RelocationFixup (DYLD_CHAINED_PTR_FORMAT fmt, uint64_t imagebase) | |
RelocationFixup & | operator= (const RelocationFixup &) |
RelocationFixup (const RelocationFixup &) | |
RelocationFixup & | operator= (RelocationFixup &&) |
RelocationFixup (RelocationFixup &&) | |
Relocation * | clone () const override |
bool | is_pc_relative () const override |
Not relevant for this kind of relocation. | |
RELOCATION_ORIGINS | origin () const override |
Origin of the relocation. For this concrete object, it should be RELOCATION_ORIGINS::ORIGIN_CHAINED_FIXUPS. | |
DYLD_CHAINED_PTR_FORMAT | ptr_format () const |
uint64_t | target () const |
The value that should be set at LIEF::Relocation::address if the imagebase is LIEF::Binary::imagebase. Otherwise, it should be: target() - LIEF::Binary::imagebase() + new_imagebase. | |
void | target (uint64_t target) |
void | pc_relative (bool) override |
Not relevant for this kind of relocation. | |
uint32_t | offset () const |
void | offset (uint32_t offset) |
uint64_t | address () const override |
The address of this relocation is bound to its offset. | |
void | address (uint64_t address) override |
Changing the address means changing the offset. | |
void | accept (Visitor &visitor) const override |
std::ostream & | print (std::ostream &os) const override |
Public Member Functions inherited from LIEF::MachO::Relocation | |
Relocation (uint64_t address, uint8_t type) | |
Relocation & | operator= (const Relocation &other) |
Relocation (const Relocation &other) | |
void | swap (Relocation &other) |
virtual uint8_t | type () const |
Type of the relocation according to the Relocation::architecture and/or the Relocation::origin. | |
CPU_TYPES | architecture () const |
Achitecture targeted by this relocation. | |
bool | has_symbol () const |
true if the relocation has a symbol associated with | |
Symbol * | symbol () |
Symbol associated with the relocation, if any, otherwise a nullptr. | |
const Symbol * | symbol () const |
bool | has_section () const |
true if the relocation has a section associated with | |
Section * | section () |
Section associated with the relocation, if any, otherwise a nullptr. | |
const Section * | section () const |
bool | has_segment () const |
true if the relocation has a SegmentCommand associated with | |
SegmentCommand * | segment () |
SegmentCommand associated with the relocation, if any, otherwise a nullptr. | |
const SegmentCommand * | segment () const |
virtual void | type (uint8_t type) |
Public Member Functions inherited from LIEF::Relocation | |
Relocation (uint64_t address, uint8_t size) | |
Constructor from a relocation's address and size. | |
Relocation & | operator= (const Relocation &) |
Relocation (const Relocation &) | |
void | swap (Relocation &other) |
virtual size_t | size () const |
Relocation size in bits | |
virtual void | size (size_t size) |
virtual bool | operator< (const Relocation &rhs) const |
Comparaison based on the Relocation's address | |
virtual bool | operator<= (const Relocation &rhs) const |
Comparaison based on the Relocation's address | |
virtual bool | operator> (const Relocation &rhs) const |
Comparaison based on the Relocation's address | |
virtual bool | operator>= (const Relocation &rhs) const |
Comparaison based on the Relocation's address | |
Public Member Functions inherited from LIEF::Object | |
Object (const Object &other) | |
Object & | operator= (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 Relocation &r) |
Additional Inherited Members | |
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>>> |
Class that represents a rebase relocation found in the LC_DYLD_CHAINED_FIXUPS command.
This class extends LIEF::Relocation in which LIEF::Relocation::address is set to the absolute virtual address where the relocation must take place (e.g. 0x10000d270
).
On the other hand, RelocationFixup::target contains the value that should be set at LIEF::Relocation::address if the imagebase is LIEF::Binary::imagebase (e.g. 0x1000073a8
).
If the Mach-O loader chooses another base address (like 0x7ff100000), it must set 0x10000d270
to 0x7ff1073a8
.
|
overridevirtual |
Reimplemented from LIEF::MachO::Relocation.
|
overridevirtual |
The address of this relocation is bound to its offset.
Reimplemented from LIEF::Relocation.
|
overridevirtual |
Changing the address means changing the offset.
Reimplemented from LIEF::Relocation.
|
overridevirtual |
Implements LIEF::MachO::Relocation.
|
overridevirtual |
Not relevant for this kind of relocation.
Implements LIEF::MachO::Relocation.
|
overridevirtual |
Origin of the relocation. For this concrete object, it should be RELOCATION_ORIGINS::ORIGIN_CHAINED_FIXUPS.
Implements LIEF::MachO::Relocation.
|
overridevirtual |
Not relevant for this kind of relocation.
Implements LIEF::MachO::Relocation.
|
overridevirtual |
Reimplemented from LIEF::MachO::Relocation.