16#ifndef LIEF_MACHO_DATA_IN_CODE_COMMAND_H
17#define LIEF_MACHO_DATA_IN_CODE_COMMAND_H
34struct linkedit_data_command;
57 std::unique_ptr<LoadCommand>
clone()
const override {
58 return std::unique_ptr<DataInCode>(
new DataInCode(*
this));
72 data_offset_ = offset;
80 entries_.push_back(std::move(entry));
105 std::ostream&
print(std::ostream& os)
const override;
108 return cmd->
command() == LoadCommand::TYPE::DATA_IN_CODE;
112 uint32_t data_offset_ = 0;
113 uint32_t data_size_ = 0;
Class used to parse a single binary (i.e. non-FAT)
Definition BinaryParser.hpp:74
Interface over an entry in the DataInCode command.
Definition DataCodeEntry.hpp:33
Interface of the LC_DATA_IN_CODE command This command is used to list slices of code sections that co...
Definition DataInCode.hpp:42
uint32_t data_size() const
Size of the raw array (size = sizeof(DataCodeEntry) * nb_elements)
Definition DataInCode.hpp:67
std::unique_ptr< LoadCommand > clone() const override
Definition DataInCode.hpp:57
void data_offset(uint32_t offset)
Definition DataInCode.hpp:71
uint32_t data_offset() const
Start of the array of the DataCodeEntry entries.
Definition DataInCode.hpp:62
span< const uint8_t > content() const
Definition DataInCode.hpp:97
DataInCode & operator=(const DataInCode &)=default
DataInCode & add(DataCodeEntry entry)
Add a new entry.
Definition DataInCode.hpp:79
std::ostream & print(std::ostream &os) const override
void data_size(uint32_t size)
Definition DataInCode.hpp:74
~DataInCode() override=default
it_const_entries entries() const
Iterator over the DataCodeEntry.
Definition DataInCode.hpp:85
std::vector< DataCodeEntry > entries_t
Definition DataInCode.hpp:46
DataInCode(const DataInCode &)=default
it_entries entries()
Definition DataInCode.hpp:89
DataInCode(const details::linkedit_data_command &cmd)
span< uint8_t > content()
Definition DataInCode.hpp:93
void accept(Visitor &visitor) const override
static bool classof(const LoadCommand *cmd)
Definition DataInCode.hpp:107
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:122
Definition Visitor.hpp:224
Iterator which returns reference on container's values.
Definition iterators.hpp:48
LIEF namespace.
Definition Abstract/Binary.hpp:32
tcb::span< ElementType, Extent > span
Definition span.hpp:22
#define LIEF_API
Definition visibility.h:41