LIEF: Library to Instrument Executable Formats Version 0.16.0
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
16#ifndef LIEF_MACHO_FUNCTION_STARTS_COMMAND_H
17#define LIEF_MACHO_FUNCTION_STARTS_COMMAND_H
32struct linkedit_data_command;
40 friend class BinaryParser;
41 friend class LinkEdit;
47 FunctionStarts&
operator=(
const FunctionStarts& copy) =
default;
50 std::unique_ptr<LoadCommand>
clone()
const override {
51 return std::unique_ptr<FunctionStarts>(
new FunctionStarts(*
this));
63 const std::vector<uint64_t>&
functions()
const {
79 functions_.emplace_back(address);
83 data_offset_ = offset;
90 functions_ = std::move(funcs);
103 void accept(Visitor& visitor)
const override;
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;
113 span<uint8_t> content_;
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:37
LoadCommand::TYPE command() const
Command type.
Definition LoadCommand.hpp:124
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