LIEF: Library to Instrument Executable Formats Version 0.17.0
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
16#ifndef LIEF_MACHO_DYLD_EXPORTS_TRIE_H
17#define LIEF_MACHO_DYLD_EXPORTS_TRIE_H
34struct linkedit_data_command;
41 friend class BinaryParser;
43 friend class LinkEdit;
46 public:
using export_info_t = std::vector<std::unique_ptr<ExportInfo>>;
49 using it_export_info = ref_iterator<export_info_t&, ExportInfo*>;
52 using it_const_export_info = const_ref_iterator<const export_info_t&, ExportInfo*>;
58 std::unique_ptr<LoadCommand>
clone()
const override {
59 return std::unique_ptr<DyldExportsTrie>(
new DyldExportsTrie(*
this));
62 void swap(DyldExportsTrie& other)
noexcept;
78 data_offset_ = offset;
99 void add(std::unique_ptr<ExportInfo> info);
104 void accept(Visitor& visitor)
const override;
106 std::ostream&
print(std::ostream& os)
const override;
109 return cmd->
command() == LoadCommand::TYPE::DYLD_EXPORTS_TRIE;
113 LIEF_LOCAL DyldExportsTrie& operator=(DyldExportsTrie other);
114 LIEF_LOCAL DyldExportsTrie(
const DyldExportsTrie& other);
116 uint32_t data_offset_ = 0;
117 uint32_t data_size_ = 0;
121 span<uint8_t> content_;
123 export_info_t export_info_;
Class used to parse a single binary (i.e. non-FAT)
Definition BinaryParser.hpp:75
Class which represents a MachO binary.
Definition MachO/Binary.hpp:86
Class used to rebuild a Mach-O file.
Definition MachO/Builder.hpp:58
Class that represents the LC_DYLD_EXPORTS_TRIE command.
Definition DyldExportsTrie.hpp:40
std::unique_ptr< LoadCommand > clone() const override
Definition DyldExportsTrie.hpp:58
void accept(Visitor &visitor) const override
span< const uint8_t > content() const
Definition DyldExportsTrie.hpp:84
DyldExportsTrie(const details::linkedit_data_command &cmd)
it_const_export_info exports() const
Definition DyldExportsTrie.hpp:93
it_export_info exports()
Iterator over the ExportInfo entries.
Definition DyldExportsTrie.hpp:89
void data_size(uint32_t size)
Definition DyldExportsTrie.hpp:80
void add(std::unique_ptr< ExportInfo > info)
Add an entrie in the current trie. See also: LIEF::MachO::Binary::add_exported_function.
std::string show_export_trie() const
Print the exports trie in a humman-readable way.
~DyldExportsTrie() override
void data_offset(uint32_t offset)
Definition DyldExportsTrie.hpp:77
std::ostream & print(std::ostream &os) const override
uint32_t data_size() const
Size of the LC_DYLD_EXPORTS_TRIE payload.
Definition DyldExportsTrie.hpp:73
void swap(DyldExportsTrie &other) noexcept
static bool classof(const LoadCommand *cmd)
Definition DyldExportsTrie.hpp:108
uint32_t data_offset() const
Offset of the LC_DYLD_EXPORTS_TRIE. This offset should point in the __LINKEDIT segment.
Definition DyldExportsTrie.hpp:68
Class that provides an interface over the Dyld export info.
Definition ExportInfo.hpp:38
Definition LinkEdit.hpp:43
Based class for the Mach-O load commands.
Definition LoadCommand.hpp:37
LoadCommand::TYPE command() const
Command type.
Definition LoadCommand.hpp:125
Definition endianness_support.hpp:59
Namespace related to the LIEF's Mach-O module.
Definition Abstract/Header.hpp:36
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41
#define LIEF_LOCAL
Definition visibility.h:42