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_DATA_IN_CODE_COMMAND_H
17#define LIEF_MACHO_DATA_IN_CODE_COMMAND_H
34struct linkedit_data_command;
43 friend class BinaryParser;
44 friend class LinkEdit;
46 using entries_t = std::vector<DataCodeEntry>;
47 using it_const_entries = const_ref_iterator<const entries_t&>;
48 using it_entries = ref_iterator<entries_t&>;
57 std::unique_ptr<LoadCommand>
clone()
const override {
58 return std::unique_ptr<DataInCode>(
new DataInCode(*
this));
72 data_offset_ = offset;
77 DataInCode&
add(DataCodeEntry entry) {
80 entries_.push_back(std::move(entry));
83 it_const_entries
entries()
const {
103 void accept(Visitor& visitor)
const override;
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;
115 span<uint8_t> content_;
Class used to parse a single binary (i.e. non-FAT)
Definition BinaryParser.hpp:75
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
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: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