LIEF: Library to Instrument Executable Formats Version 0.16.0
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
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;
52 friend class BinaryParser;
54 friend class DyldChainedFixupsCreator;
63 RelocationFixup&
operator=(RelocationFixup&&) noexcept = default;
64 RelocationFixup(RelocationFixup&&) noexcept = default;
66 ~RelocationFixup() override;
68 std::unique_ptr<Relocation> clone()
const override {
69 return std::unique_ptr<RelocationFixup>(
new RelocationFixup(*
this));
76 ORIGIN
origin()
const override {
80 return ORIGIN::CHAINED_FIXUPS;
103 uint64_t
address()
const override {
108 void address(uint64_t address)
override {
113 uint32_t
next()
const;
116 void next(uint32_t value);
120 void accept(Visitor& visitor)
const override;
123 return r.
origin() == Relocation::ORIGIN::CHAINED_FIXUPS;
126 std::ostream&
print(std::ostream& os)
const override;
129 enum class REBASE_TYPES {
138 LIEF_LOCAL void set(
const details::dyld_chained_ptr_arm64e_rebase& fixup);
139 LIEF_LOCAL void set(
const details::dyld_chained_ptr_arm64e_auth_rebase& fixup);
140 LIEF_LOCAL void set(
const details::dyld_chained_ptr_64_rebase& fixup);
141 LIEF_LOCAL void set(
const details::dyld_chained_ptr_32_rebase& fixup);
144 uint64_t imagebase_ = 0;
145 uint32_t offset_ = 0;
147 REBASE_TYPES rtypes_ = REBASE_TYPES::UNKNOWN;
150 details::dyld_chained_ptr_arm64e_rebase* arm64_rebase_ =
nullptr;
151 details::dyld_chained_ptr_arm64e_auth_rebase* arm64_auth_rebase_;
152 details::dyld_chained_ptr_64_rebase* p64_rebase_;
153 details::dyld_chained_ptr_32_rebase* p32_rebase_;
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:57
Definition DyldChainedFixupsCreator.hpp:41
Class that represents a rebase relocation found in the LC_DYLD_CHAINED_FIXUPS command.
Definition RelocationFixup.hpp:50
RelocationFixup & operator=(RelocationFixup &&) noexcept=default
RelocationFixup(DYLD_CHAINED_PTR_FORMAT fmt, uint64_t imagebase)
void offset(uint32_t offset)
Definition RelocationFixup.hpp:100
std::ostream & print(std::ostream &os) const override
void target(uint64_t target)
uint32_t next() const
Return the (unscaled) next offset in the chain.
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:79
uint32_t offset() const
Definition RelocationFixup.hpp:96
void pc_relative(bool) override
Not relevant for this kind of relocation.
Definition RelocationFixup.hpp:94
void next(uint32_t value)
Change next offset of the current element.
uint64_t address() const override
The address of this relocation is bound to its offset.
Definition RelocationFixup.hpp:105
static bool classof(const Relocation &r)
Definition RelocationFixup.hpp:122
bool is_pc_relative() const override
Not relevant for this kind of relocation.
Definition RelocationFixup.hpp:73
RelocationFixup & operator=(const RelocationFixup &)
void address(uint64_t address) override
Changing the address means changing the offset.
Definition RelocationFixup.hpp:110
RelocationFixup(const RelocationFixup &)
DYLD_CHAINED_PTR_FORMAT ptr_format() const
Definition RelocationFixup.hpp:83
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.
Definition endianness_support.hpp:59
Namespace related to the LIEF's Mach-O module.
Definition Abstract/Header.hpp:36
@ UNKNOWN
Definition MachO/enums.hpp:25
DYLD_CHAINED_PTR_FORMAT
Definition DyldChainedFormat.hpp:29
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41
#define LIEF_LOCAL
Definition visibility.h:42