Based class for the Mach-O load commands.
Subclassed by LIEF::MachO::BuildVersion, LIEF::MachO::CodeSignature, LIEF::MachO::CodeSignatureDir, LIEF::MachO::DataInCode, LIEF::MachO::DyldChainedFixups, LIEF::MachO::DyldEnvironment, LIEF::MachO::DyldExportsTrie, LIEF::MachO::DyldInfo, LIEF::MachO::DylibCommand, LIEF::MachO::DylinkerCommand, LIEF::MachO::DynamicSymbolCommand, LIEF::MachO::EncryptionInfo, LIEF::MachO::FilesetCommand, LIEF::MachO::FunctionStarts, LIEF::MachO::LinkerOptHint, LIEF::MachO::MainCommand, LIEF::MachO::RPathCommand, LIEF::MachO::SegmentCommand, LIEF::MachO::SegmentSplitInfo, LIEF::MachO::SourceVersion, LIEF::MachO::SubFramework, LIEF::MachO::SymbolCommand, LIEF::MachO::ThreadCommand, LIEF::MachO::TwoLevelHints, LIEF::MachO::UUIDCommand, LIEF::MachO::UnknownCommand, LIEF::MachO::VersionMin
Public Types
- enum class TYPE : uint64_t
Values:
- enumerator UNKNOWN = 0
- enumerator SEGMENT = 0x00000001u
- enumerator SYMTAB = 0x00000002u
- enumerator SYMSEG = 0x00000003u
- enumerator THREAD = 0x00000004u
- enumerator UNIXTHREAD = 0x00000005u
- enumerator LOADFVMLIB = 0x00000006u
- enumerator IDFVMLIB = 0x00000007u
- enumerator IDENT = 0x00000008u
- enumerator FVMFILE = 0x00000009u
- enumerator PREPAGE = 0x0000000Au
- enumerator DYSYMTAB = 0x0000000Bu
- enumerator LOAD_DYLIB = 0x0000000Cu
- enumerator ID_DYLIB = 0x0000000Du
- enumerator LOAD_DYLINKER = 0x0000000Eu
- enumerator ID_DYLINKER = 0x0000000Fu
- enumerator PREBOUND_DYLIB = 0x00000010u
- enumerator ROUTINES = 0x00000011u
- enumerator SUB_FRAMEWORK = 0x00000012u
- enumerator SUB_UMBRELLA = 0x00000013u
- enumerator SUB_CLIENT = 0x00000014u
- enumerator SUB_LIBRARY = 0x00000015u
- enumerator TWOLEVEL_HINTS = 0x00000016u
- enumerator PREBIND_CKSUM = 0x00000017u
- enumerator LOAD_WEAK_DYLIB = 0x80000018u
- enumerator SEGMENT_64 = 0x00000019u
- enumerator ROUTINES_64 = 0x0000001Au
- enumerator UUID = 0x0000001Bu
- enumerator RPATH = 0x8000001Cu
- enumerator CODE_SIGNATURE = 0x0000001Du
- enumerator SEGMENT_SPLIT_INFO = 0x0000001Eu
- enumerator REEXPORT_DYLIB = 0x8000001Fu
- enumerator LAZY_LOAD_DYLIB = 0x00000020u
- enumerator ENCRYPTION_INFO = 0x00000021u
- enumerator DYLD_INFO = 0x00000022u
- enumerator DYLD_INFO_ONLY = 0x80000022u
- enumerator LOAD_UPWARD_DYLIB = 0x80000023u
- enumerator VERSION_MIN_MACOSX = 0x00000024u
- enumerator VERSION_MIN_IPHONEOS = 0x00000025u
- enumerator FUNCTION_STARTS = 0x00000026u
- enumerator DYLD_ENVIRONMENT = 0x00000027u
- enumerator MAIN = 0x80000028u
- enumerator DATA_IN_CODE = 0x00000029u
- enumerator SOURCE_VERSION = 0x0000002Au
- enumerator DYLIB_CODE_SIGN_DRS = 0x0000002Bu
- enumerator ENCRYPTION_INFO_64 = 0x0000002Cu
- enumerator LINKER_OPTION = 0x0000002Du
- enumerator LINKER_OPTIMIZATION_HINT = 0x0000002Eu
- enumerator VERSION_MIN_TVOS = 0x0000002Fu
- enumerator VERSION_MIN_WATCHOS = 0x00000030u
- enumerator NOTE = 0x00000031u
- enumerator BUILD_VERSION = 0x00000032u
- enumerator DYLD_EXPORTS_TRIE = 0x80000033u
- enumerator DYLD_CHAINED_FIXUPS = 0x80000034u
- enumerator FILESET_ENTRY = 0x80000035u
- enumerator LIEF_UNKNOWN = 0xffee0001u
- using raw_t = std::vector<uint8_t>
Public Functions
- LoadCommand() = default
- LoadCommand(const details::load_command &command)
- inline LoadCommand(LoadCommand::TYPE type, uint32_t size)
- LoadCommand &operator=(const LoadCommand ©) = default
- LoadCommand(const LoadCommand ©) = default
- void swap(LoadCommand &other) noexcept
- inline virtual std::unique_ptr<LoadCommand> clone() const
- ~LoadCommand() override = default
- inline LoadCommand::TYPE command() const
Command type.
- inline uint32_t size() const
Size of the command (should be greather than sizeof(load_command)
)
- inline span<const uint8_t> data() const
Raw command.
- inline uint64_t command_offset() const
Offset of the command within the Load Command Table
- inline void data(raw_t data)
- inline void command(LoadCommand::TYPE command)
- inline void size(uint32_t size)
- inline void command_offset(uint64_t offset)
- virtual std::ostream &print(std::ostream &os) const
- virtual void accept(Visitor &visitor) const override
Public Static Functions
- static bool is_linkedit_data(const LoadCommand &cmd)
Friends
- inline friend std::ostream &operator<<(std::ostream &os, const LoadCommand &cmd)