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_THREAD_COMMAND_H
17#define LIEF_MACHO_THREAD_COMMAND_H
42 friend class BinaryParser;
46 Header::CPU_TYPE arch = Header::CPU_TYPE::ANY);
48 Header::CPU_TYPE arch= Header::CPU_TYPE::ANY);
50 ThreadCommand&
operator=(
const ThreadCommand& copy) =
default;
53 std::unique_ptr<LoadCommand>
clone()
const override {
54 return std::unique_ptr<ThreadCommand>(
new ThreadCommand(*
this));
68 uint32_t
count()
const {
80 span<const uint8_t>
state()
const {
97 void state(std::vector<uint8_t> state) {
98 state_ = std::move(state);
108 architecture_ = arch;
111 void accept(Visitor& visitor)
const override;
113 std::ostream&
print(std::ostream& os)
const override;
116 const LoadCommand::TYPE type = cmd->
command();
117 return type == LoadCommand::TYPE::THREAD ||
118 type == LoadCommand::TYPE::UNIXTHREAD;
122 uint32_t flavor_ = 0;
124 Header::CPU_TYPE architecture_ = Header::CPU_TYPE::ANY;
125 std::vector<uint8_t> state_;
Class used to parse a single binary (i.e. non-FAT)
Definition BinaryParser.hpp:74
Based class for the Mach-O load commands.
Definition LoadCommand.hpp:37
LoadCommand::TYPE command() const
Command type.
Definition LoadCommand.hpp:124
Class that represents the LC_THREAD / LC_UNIXTHREAD commands and that can be used to get the binary e...
Definition ThreadCommand.hpp:41
span< const uint8_t > state() const
The actual thread state as a vector of bytes. Depending on the architecture(), these data can be cast...
Definition ThreadCommand.hpp:83
ThreadCommand(const ThreadCommand ©)=default
void count(uint32_t count)
Definition ThreadCommand.hpp:104
void accept(Visitor &visitor) const override
std::ostream & print(std::ostream &os) const override
static bool classof(const LoadCommand *cmd)
Definition ThreadCommand.hpp:115
ThreadCommand(uint32_t flavor, uint32_t count, Header::CPU_TYPE arch=Header::CPU_TYPE::ANY)
void state(std::vector< uint8_t > state)
Definition ThreadCommand.hpp:97
void flavor(uint32_t flavor)
Definition ThreadCommand.hpp:101
ThreadCommand(const details::thread_command &cmd, Header::CPU_TYPE arch=Header::CPU_TYPE::ANY)
void architecture(Header::CPU_TYPE arch)
Definition ThreadCommand.hpp:107
ThreadCommand & operator=(const ThreadCommand ©)=default
span< uint8_t > state()
Definition ThreadCommand.hpp:87
~ThreadCommand() override=default
Header::CPU_TYPE architecture() const
The CPU architecture that is targeted by this ThreadCommand.
Definition ThreadCommand.hpp:77
uint64_t pc() const
Return the initial Program Counter regardless of the underlying architecture. This value,...
uint32_t count() const
Size of the thread state data with 32-bits alignment.
Definition ThreadCommand.hpp:72
std::unique_ptr< LoadCommand > clone() const override
Definition ThreadCommand.hpp:53
uint32_t flavor() const
Integer that defines a special flavor for the thread.
Definition ThreadCommand.hpp:65
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