16#ifndef LIEF_MACHO_TWO_LEVEL_HINTS_H
17#define LIEF_MACHO_TWO_LEVEL_HINTS_H
21#include "LIEF/visibility.h"
22#include "LIEF/span.hpp"
23#include "LIEF/iterators.hpp"
25#include "LIEF/MachO/LoadCommand.hpp"
35struct twolevel_hints_command;
45 using hints_list_t = std::vector<uint32_t>;
55 std::unique_ptr<LoadCommand> clone()
const override {
56 return std::unique_ptr<TwoLevelHints>(
new TwoLevelHints(*
this));
60 span<const uint8_t>
content()
const {
return content_; }
61 span<uint8_t> content() {
return content_; }
65 it_const_hints_t hints()
const {
return hints_; }
69 uint32_t
offset()
const {
return offset_; }
70 void offset(uint32_t offset) { offset_ = offset; }
72 uint32_t original_nb_hints()
const {
73 return original_nb_hints_;
76 ~TwoLevelHints()
override =
default;
78 void accept(Visitor& visitor)
const override;
80 std::ostream& print(std::ostream& os)
const override;
82 static bool classof(
const LoadCommand* cmd) {
83 return cmd->command() == LoadCommand::TYPE::TWOLEVEL_HINTS;
89 span<uint8_t> content_;
90 uint32_t original_nb_hints_ = 0;
Class used to parse a single binary (i.e. non-FAT)
Definition BinaryParser.hpp:73
Class used to rebuild a Mach-O file.
Definition MachO/Builder.hpp:54
Definition LinkEdit.hpp:42
Based class for the Mach-O load commands.
Definition LoadCommand.hpp:36
Class which represents the LC_TWOLEVEL_HINTS command.
Definition TwoLevelHints.hpp:39
span< const uint8_t > content() const
Original payload of the command.
Definition TwoLevelHints.hpp:60
uint32_t offset() const
Original offset of the command. It should point in the __LINKEDIT segment.
Definition TwoLevelHints.hpp:69
it_hints_t hints()
Iterator over the hints (uint32_t integers)
Definition TwoLevelHints.hpp:64
Iterator which returns reference on container's values.
Definition iterators.hpp:48
LIEF namespace.
Definition Abstract/Binary.hpp:32