16#ifndef LIEF_MACHO_FUNCTION_STARTS_COMMAND_H
17#define LIEF_MACHO_FUNCTION_STARTS_COMMAND_H
32struct linkedit_data_command;
50 std::unique_ptr<LoadCommand>
clone()
const override {
79 functions_.emplace_back(address);
83 data_offset_ = offset;
90 functions_ = std::move(funcs);
105 std::ostream&
print(std::ostream& os)
const override;
108 return cmd->
command() == LoadCommand::TYPE::FUNCTION_STARTS;
111 uint32_t data_offset_ = 0;
112 uint32_t data_size_ = 0;
114 std::vector<uint64_t> functions_;
Class used to parse a single binary (i.e. non-FAT)
Definition BinaryParser.hpp:74
Class which represents the LC_FUNCTION_STARTS command.
Definition FunctionStarts.hpp:39
span< const uint8_t > content() const
Definition FunctionStarts.hpp:93
std::vector< uint64_t > & functions()
Definition FunctionStarts.hpp:73
std::ostream & print(std::ostream &os) const override
void data_size(uint32_t size)
Definition FunctionStarts.hpp:85
const std::vector< uint64_t > & functions() const
Addresses of every function entry point in the executable.
Definition FunctionStarts.hpp:69
uint32_t data_offset() const
Offset in the __LINKEDIT SegmentCommand where start functions are located.
Definition FunctionStarts.hpp:55
FunctionStarts & operator=(const FunctionStarts ©)=default
std::unique_ptr< LoadCommand > clone() const override
Definition FunctionStarts.hpp:50
void data_offset(uint32_t offset)
Definition FunctionStarts.hpp:82
FunctionStarts(const details::linkedit_data_command &cmd)
~FunctionStarts() override=default
uint32_t data_size() const
Size of the functions list in the binary.
Definition FunctionStarts.hpp:60
void add_function(uint64_t address)
Add a new function.
Definition FunctionStarts.hpp:78
static bool classof(const LoadCommand *cmd)
Definition FunctionStarts.hpp:107
span< uint8_t > content()
Definition FunctionStarts.hpp:97
void functions(std::vector< uint64_t > funcs)
Definition FunctionStarts.hpp:89
FunctionStarts(const FunctionStarts ©)=default
void accept(Visitor &visitor) const override
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
LIEF namespace.
Definition Abstract/Binary.hpp:32
tcb::span< ElementType, Extent > span
Definition span.hpp:22
#define LIEF_API
Definition visibility.h:41