16#ifndef LIEF_MACHO_DYLD_EXPORTS_TRIE_H
17#define LIEF_MACHO_DYLD_EXPORTS_TRIE_H
19#include "LIEF/span.hpp"
20#include "LIEF/iterators.hpp"
21#include "LIEF/visibility.h"
22#include "LIEF/MachO/LoadCommand.hpp"
34struct linkedit_data_command;
58 std::unique_ptr<LoadCommand> clone()
const override {
77 void data_offset(uint32_t offset) {
78 data_offset_ = offset;
80 void data_size(uint32_t size) {
84 span<const uint8_t> content()
const {
93 it_const_export_info exports()
const {
102 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;
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:73
Class which represents a MachO binary.
Definition MachO/Binary.hpp:73
Class used to rebuild a Mach-O file.
Definition MachO/Builder.hpp:54
Class that represents the LC_DYLD_EXPORTS_TRIE command.
Definition DyldExportsTrie.hpp:40
it_export_info exports()
Iterator over the ExportInfo entries.
Definition DyldExportsTrie.hpp:89
void add(std::unique_ptr< ExportInfo > info)
Add an entrie in the current trie. See also: LIEF::MachO::Binary::add_exported_function.
std::vector< std::unique_ptr< ExportInfo > > export_info_t
Internal container for storing ExportInfo.
Definition DyldExportsTrie.hpp:48
std::string show_export_trie() const
Print the exports trie in a humman-readable way.
uint32_t data_size() const
Size of the LC_DYLD_EXPORTS_TRIE payload.
Definition DyldExportsTrie.hpp:73
uint32_t data_offset() const
Offset of the LC_DYLD_EXPORTS_TRIE. This offset should point in the __LINKEDIT segment.
Definition DyldExportsTrie.hpp:68
Definition LinkEdit.hpp:42
Based class for the Mach-O load commands.
Definition LoadCommand.hpp:36
LoadCommand::TYPE command() const
Command type.
Definition LoadCommand.hpp:120
Definition Visitor.hpp:219
Iterator which returns reference on container's values.
Definition iterators.hpp:48
LIEF namespace.
Definition Abstract/Binary.hpp:32