16#ifndef LIEF_MACHO_RELOCATION_FIXUP_H
17#define LIEF_MACHO_RELOCATION_FIXUP_H
30struct dyld_chained_ptr_arm64e_rebase;
31struct dyld_chained_ptr_arm64e_auth_rebase;
32struct dyld_chained_ptr_64_rebase;
33struct dyld_chained_ptr_32_rebase;
78 return ORIGIN::CHAINED_FIXUPS;
104 return imagebase_ + offset_;
109 offset_ = address - imagebase_;
115 return r.
origin() == Relocation::ORIGIN::CHAINED_FIXUPS;
118 std::ostream&
print(std::ostream& os)
const override;
121 enum class REBASE_TYPES {
130 void set(
const details::dyld_chained_ptr_arm64e_rebase& fixup);
131 void set(
const details::dyld_chained_ptr_arm64e_auth_rebase& fixup);
132 void set(
const details::dyld_chained_ptr_64_rebase& fixup);
133 void set(
const details::dyld_chained_ptr_32_rebase& fixup);
136 uint64_t imagebase_ = 0;
137 uint32_t offset_ = 0;
139 REBASE_TYPES rtypes_ = REBASE_TYPES::UNKNOWN;
142 details::dyld_chained_ptr_arm64e_rebase* arm64_rebase_ =
nullptr;
Class used to parse a single binary (i.e. non-FAT)
Definition BinaryParser.hpp:74
Class used to rebuild a Mach-O file.
Definition MachO/Builder.hpp:55
Class that represents a rebase relocation found in the LC_DYLD_CHAINED_FIXUPS command.
Definition RelocationFixup.hpp:49
details::dyld_chained_ptr_64_rebase * p64_rebase_
Definition RelocationFixup.hpp:144
details::dyld_chained_ptr_32_rebase * p32_rebase_
Definition RelocationFixup.hpp:145
RelocationFixup & operator=(RelocationFixup &&) noexcept=default
RelocationFixup(DYLD_CHAINED_PTR_FORMAT fmt, uint64_t imagebase)
void offset(uint32_t offset)
Definition RelocationFixup.hpp:98
std::ostream & print(std::ostream &os) const override
void target(uint64_t target)
uint64_t target() const
The value that should be set at the address pointed by LIEF::Relocation::address if the imagebase cho...
ORIGIN origin() const override
Origin of the relocation. For this concrete object, it should be Relocation::ORIGIN::CHAINED_FIXUPS.
Definition RelocationFixup.hpp:77
uint32_t offset() const
Definition RelocationFixup.hpp:94
void pc_relative(bool) override
Not relevant for this kind of relocation.
Definition RelocationFixup.hpp:92
uint64_t address() const override
The address of this relocation is bound to its offset.
Definition RelocationFixup.hpp:103
details::dyld_chained_ptr_arm64e_auth_rebase * arm64_auth_rebase_
Definition RelocationFixup.hpp:143
static bool classof(const Relocation &r)
Definition RelocationFixup.hpp:114
bool is_pc_relative() const override
Not relevant for this kind of relocation.
Definition RelocationFixup.hpp:71
RelocationFixup & operator=(const RelocationFixup &)
void address(uint64_t address) override
Changing the address means changing the offset.
Definition RelocationFixup.hpp:108
RelocationFixup(const RelocationFixup &)
DYLD_CHAINED_PTR_FORMAT ptr_format() const
Definition RelocationFixup.hpp:81
void accept(Visitor &visitor) const override
Class that represents a Mach-O relocation.
Definition MachO/Relocation.hpp:40
virtual ORIGIN origin() const =0
Origin of the relocation.
ORIGIN
Definition MachO/Relocation.hpp:48
Definition Visitor.hpp:224
DYLD_CHAINED_PTR_FORMAT
Definition DyldChainedFormat.hpp:29
LIEF namespace.
Definition Abstract/Binary.hpp:32
#define LIEF_API
Definition visibility.h:41