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_STUB_H
17#define LIEF_MACHO_STUB_H
52 struct target_info_t {
53 Header::CPU_TYPE arch;
56 const Stub::target_info_t& rhs)
62 public iterator_facade_base<Iterator, std::random_access_iterator_tag, const Stub>
67 Iterator(target_info_t target_info, std::vector<const Section*> sections,
69 target_info_(target_info),
70 stubs_(std::move(sections)),
79 Iterator& operator=(Iterator&&) noexcept = default;
81 ~Iterator() = default;
83 bool operator<(const Iterator& rhs)
const {
84 return pos_ < rhs.pos_;
102 return LHS.pos_ == RHS.pos_;
106 return !(LHS == RHS);
112 const Section* find_section_offset(
size_t pos, uint64_t& offset)
const;
113 target_info_t target_info_;
114 std::vector<const Section*> stubs_;
122 Stub(Stub&&) noexcept = default;
123 Stub& operator=(Stub&&) noexcept = default;
126 Stub(target_info_t target_info, uint64_t addr, std::vector<uint8_t> raw) :
127 target_info_(target_info),
131 span<const uint8_t>
raw()
const {
141 result<uint64_t>
target()
const;
160 target_info_t target_info_;
161 uint64_t address_ = 0;
162 mutable uint64_t target_addr_ = 0;
163 std::vector<uint8_t> raw_;
Class which represents a MachO binary.
Definition MachO/Binary.hpp:85
Class that represents a Mach-O section.
Definition MachO/Section.hpp:46
Iterator & operator-=(std::ptrdiff_t n)
Definition Stub.hpp:96
Iterator(const Iterator &)=default
friend bool operator==(const Iterator &LHS, const Iterator &RHS)
Definition Stub.hpp:101
Iterator(Iterator &&) noexcept=default
std::ptrdiff_t operator-(const Iterator &R) const
Definition Stub.hpp:87
Iterator & operator+=(std::ptrdiff_t n)
Definition Stub.hpp:91
Iterator(target_info_t target_info, std::vector< const Section * > sections, size_t pos)
Definition Stub.hpp:67
Iterator & operator=(const Iterator &)=default
friend bool operator!=(const Iterator &LHS, const Iterator &RHS)
Definition Stub.hpp:105
This class represents a stub entry in sections like __stubs,__auth_stubs.
Definition Stub.hpp:50
Stub(Stub &&) noexcept=default
Stub(const Stub &)=default
friend std::ostream & operator<<(std::ostream &os, const Stub &stub)
result< uint64_t > target() const
The address resolved by this stub.
span< const uint8_t > raw() const
The (raw) instructions of this entry as a slice of bytes.
Definition Stub.hpp:133
uint64_t address() const
The virtual address where the stub is located.
Definition Stub.hpp:138
Stub & operator=(const Stub &)=default
Namespace related to the LIEF's Mach-O module.
Definition Abstract/Header.hpp:36
LIEF namespace.
Definition Abstract/Binary.hpp:36
friend bool operator==(const Stub::target_info_t &lhs, const Stub::target_info_t &rhs)
Definition Stub.hpp:55
uint32_t subtype
Definition Stub.hpp:54
Header::CPU_TYPE arch
Definition Stub.hpp:53
#define LIEF_API
Definition visibility.h:41