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_EXPORT_INFO_COMMAND_H
17#define LIEF_MACHO_EXPORT_INFO_COMMAND_H
40 friend class BinaryParser;
44 enum class KIND: uint64_t {
46 THREAD_LOCAL_KIND = 0x01u,
50 enum class FLAGS: uint64_t {
51 WEAK_DEFINITION = 0x04u,
53 STUB_AND_RESOLVER = 0x10u
56 using flag_list_t = std::vector<FLAGS>;
59 ExportInfo(uint64_t address, uint64_t flags, uint64_t offset = 0) :
67 void swap(ExportInfo& other)
noexcept;
73 uint64_t
flags()
const {
86 bool has(FLAGS flag)
const;
92 static constexpr auto MASK = uint64_t(3);
93 return KIND(flags_ & MASK);
110 return symbol() !=
nullptr;
112 const Symbol*
symbol()
const {
133 return alias_location_;
136 return alias_location_;
141 void accept(Visitor& visitor)
const override;
146 uint64_t node_offset_ = 0;
148 uint64_t address_ = 0;
150 Symbol* symbol_ =
nullptr;
152 Symbol* alias_ =
nullptr;
153 DylibCommand* alias_location_ =
nullptr;
Class used to parse a single binary (i.e. non-FAT)
Definition BinaryParser.hpp:74
Class which represents a MachO binary.
Definition MachO/Binary.hpp:85
Class which represents a library dependency.
Definition DylibCommand.hpp:34
Class that provides an interface over the Dyld export info.
Definition ExportInfo.hpp:38
FLAGS
Definition ExportInfo.hpp:50
void flags(uint64_t flags)
Definition ExportInfo.hpp:80
void accept(Visitor &visitor) const override
~ExportInfo() override=default
bool has_symbol() const
Check if a symbol is associated with this export.
Definition ExportInfo.hpp:109
Symbol * symbol()
Definition ExportInfo.hpp:117
void address(uint64_t addr)
Definition ExportInfo.hpp:104
ExportInfo(uint64_t address, uint64_t flags, uint64_t offset=0)
Definition ExportInfo.hpp:59
const Symbol * symbol() const
MachO::Symbol associated with this export or a nullptr if no symbol.
Definition ExportInfo.hpp:114
ExportInfo & operator=(ExportInfo copy)
uint64_t flags() const
Some information (ExportInfo::FLAGS) about the export. (like weak export, reexport,...
Definition ExportInfo.hpp:76
bool has(FLAGS flag) const
Check if the current entry contains the provided ExportInfo::FLAGS.
KIND kind() const
The export's kind (regular, thread local, absolute, ...)
Definition ExportInfo.hpp:91
DylibCommand * alias_library()
If the export is a ExportInfo::FLAGS::REEXPORT, this returns the (optional) library (MachO::DylibComm...
Definition ExportInfo.hpp:132
const DylibCommand * alias_library() const
Definition ExportInfo.hpp:135
friend std::ostream & operator<<(std::ostream &os, const ExportInfo &export_info)
flag_list_t flags_list() const
The export flags() as a list.
uint64_t address() const
The address of the export.
Definition ExportInfo.hpp:101
uint64_t node_offset() const
Original offset in the export Trie.
Definition ExportInfo.hpp:70
ExportInfo(const ExportInfo ©)
const Symbol * alias() const
Definition ExportInfo.hpp:126
uint64_t other() const
Definition ExportInfo.hpp:96
void swap(ExportInfo &other) noexcept
Symbol * alias()
If the export is a ExportInfo::FLAGS::REEXPORT, this returns the (optional) MachO::Symbol.
Definition ExportInfo.hpp:123
KIND
Definition ExportInfo.hpp:44
Class that represents a Symbol in a Mach-O file.
Definition MachO/Symbol.hpp:47
#define ENABLE_BITMASK_OPERATORS(X)
Definition enums.hpp:24
Namespace related to the LIEF's Mach-O module.
Definition Abstract/Header.hpp:36
const char * to_string(BuildToolVersion::TOOLS tool)
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41