LIEF: Library to Instrument Executable Formats Version 0.15.1
|
Namespace related to the LIEF's Mach-O module. More...
Namespaces | |
namespace | details |
Classes | |
class | Binary |
Class which represents a MachO binary. More... | |
class | BinaryParser |
Class used to parse a single binary (i.e. non-FAT) More... | |
class | BindingInfo |
Class that provides an interface over a binding operation. More... | |
class | Builder |
Class used to rebuild a Mach-O file. More... | |
class | BuildToolVersion |
Class that represents a tool's version that was involved in the build of the binary. More... | |
class | BuildVersion |
class | ChainedBindingInfo |
This class represents a symbol binding operation associated with the LC_DYLD_CHAINED_FIXUPS command. More... | |
class | CodeSignature |
class | CodeSignatureDir |
class | DataCodeEntry |
Interface over an entry in the DataInCode command. More... | |
class | DataInCode |
Interface of the LC_DATA_IN_CODE command This command is used to list slices of code sections that contain data. The slices information are stored as an array of DataCodeEntry. More... | |
class | DyldBindingInfo |
This class represents a symbol binding operation associated with the LC_DYLD_INFO bytecode. More... | |
class | DyldChainedFixups |
Class that represents the LC_DYLD_CHAINED_FIXUPS command. More... | |
class | DyldEnvironment |
Class that represents a LC_DYLD_ENVIRONMENT command which is used by the Mach-O linker/loader to initialize an environment variable. More... | |
class | DyldExportsTrie |
Class that represents the LC_DYLD_EXPORTS_TRIE command. More... | |
class | DyldInfo |
Class that represents the LC_DYLD_INFO and LC_DYLD_INFO_ONLY commands. More... | |
class | DylibCommand |
Class which represents a library dependency. More... | |
class | DylinkerCommand |
Class that represents the Mach-O linker, also named loader. Most of the time, DylinkerCommand::name() should return /usr/lib/dyld More... | |
class | DynamicSymbolCommand |
Class that represents the LC_DYSYMTAB command. More... | |
class | EncryptionInfo |
Class that represents the LC_ENCRYPTION_INFO / LC_ENCRYPTION_INFO_64 commands. More... | |
class | ExportInfo |
Class that provides an interface over the Dyld export info. More... | |
class | FatBinary |
Class which represent a Mach-O (fat) binary This object is also used for representing Mach-O binaries that are NOT FAT More... | |
class | FilesetCommand |
Class associated with the LC_FILESET_ENTRY commands. More... | |
class | FunctionStarts |
Class which represents the LC_FUNCTION_STARTS command. More... | |
class | Hash |
Class which implements a visitor to compute a deterministic hash for LIEF MachO objects. More... | |
class | Header |
Class that represents the Mach-O header. More... | |
class | LinkEdit |
class | LinkerOptHint |
Class which represents the LC_LINKER_OPTIMIZATION_HINT command. More... | |
class | LoadCommand |
Based class for the Mach-O load commands. More... | |
class | MainCommand |
Class that represent the LC_MAIN command. This kind of command can be used to determine the entrypoint of an executable. More... | |
class | Parser |
The main interface to parse a Mach-O binary. More... | |
struct | ParserConfig |
This structure is used to tweak the MachO Parser (MachO::Parser) More... | |
class | Relocation |
Class that represents a Mach-O relocation. More... | |
class | RelocationDyld |
Class that represents a relocation found in the DyldInfo structure. More... | |
class | RelocationFixup |
Class that represents a rebase relocation found in the LC_DYLD_CHAINED_FIXUPS command. More... | |
class | RelocationObject |
Class that represents a relocation presents in the MachO object file (.o ). Usually, this kind of relocation is found in the MachO::Section. More... | |
class | RPathCommand |
Class that represents the LC_RPATH command. More... | |
class | Section |
Class that represents a Mach-O section. More... | |
class | SegmentCommand |
Class which represents a LoadCommand::TYPE::SEGMENT / LoadCommand::TYPE::SEGMENT_64 command. More... | |
class | SegmentSplitInfo |
Class that represents the LoadCommand::TYPE::SEGMENT_SPLIT_INFO command. More... | |
class | SourceVersion |
Class that represents the MachO LoadCommand::TYPE::SOURCE_VERSION This command is used to provide the version of the sources used to build the binary. More... | |
class | SubFramework |
Class that represents the SubFramework command. Accodring to the Mach-O loader.h documentation: More... | |
class | Symbol |
Class that represents a Symbol in a Mach-O file. More... | |
class | SymbolCommand |
Class that represents the LC_SYMTAB command. More... | |
class | ThreadCommand |
Class that represents the LC_THREAD / LC_UNIXTHREAD commands and that can be used to get the binary entrypoint when the LC_MAIN (MainCommand) is not present. More... | |
class | TwoLevelHints |
Class which represents the LC_TWOLEVEL_HINTS command. More... | |
class | UnknownCommand |
Generic class when the command is not recognized by LIEF. More... | |
class | UUIDCommand |
Class that represents the UUID command. More... | |
class | VersionMin |
Class that wraps the LC_VERSION_MIN_MACOSX, LC_VERSION_MIN_IPHONEOS, ... commands. More... | |
Typedefs | |
using | buffer_t = std::vector<uint8_t> |
using | uuid_t = std::array<uint8_t, 16> |
Functions | |
const char * | to_string (BuildToolVersion::TOOLS tool) |
const char * | to_string (BuildVersion::PLATFORMS e) |
const char * | to_string (DataCodeEntry::TYPES e) |
const char * | to_string (DyldBindingInfo::CLASS e) |
const char * | to_string (DyldBindingInfo::TYPE e) |
const char * | to_string (DYLD_CHAINED_FORMAT fmt) |
const char * | to_string (DYLD_CHAINED_PTR_FORMAT ptr_fmt) |
const char * | to_string (DyldInfo::REBASE_TYPE e) |
const char * | to_string (DyldInfo::REBASE_OPCODES e) |
const char * | to_string (DyldInfo::BIND_OPCODES e) |
const char * | to_string (DyldInfo::BIND_SUBOPCODE_THREADED e) |
const char * | to_string (MACHO_TYPES e) |
const char * | to_string (X86_RELOCATION e) |
const char * | to_string (X86_64_RELOCATION e) |
const char * | to_string (PPC_RELOCATION e) |
const char * | to_string (ARM_RELOCATION e) |
const char * | to_string (ARM64_RELOCATION e) |
const char * | to_string (ExportInfo::KIND kind) |
const char * | to_string (ExportInfo::FLAGS flags) |
const char * | to_string (Header::FILE_TYPE e) |
const char * | to_string (Header::CPU_TYPE e) |
const char * | to_string (Header::FLAGS e) |
std::string | to_json (const Object &v) |
const char * | to_string (LoadCommand::TYPE type) |
const char * | to_string (Relocation::ORIGIN e) |
const char * | to_string (Section::TYPE type) |
const char * | to_string (Section::FLAGS flag) |
const char * | to_string (SegmentCommand::FLAGS flag) |
const char * | to_string (SegmentCommand::VM_PROTECTIONS protection) |
const char * | to_string (Symbol::ORIGIN e) |
const char * | to_string (Symbol::CATEGORY e) |
const char * | to_string (Symbol::TYPE e) |
bool | is_macho (BinaryStream &stream) |
Check if the given stream wraps a Mach-O binary. | |
bool | is_macho (const std::string &file) |
Check if the given file is a Mach-O binary. | |
bool | is_macho (const std::vector< uint8_t > &raw) |
Check if the given raw data is a Mach-O binary. | |
bool | is_fat (const std::string &file) |
Check if the given file is a FAT Mach-O. | |
bool | is_64 (const std::string &file) |
Check if the given Mach-O is 64-bits. | |
bool | check_layout (const Binary &binary, std::string *error=nullptr) |
Check the layout of the given Mach-O binary. It checks if it can be signed according to cctools-921/libstuff/checkout.c. | |
bool | check_layout (const FatBinary &binary, std::string *error=nullptr) |
Check the layout of the given FAT Mach-O by checking individually the layout of the binaries embedded in the FAT. | |
Namespace related to the LIEF's Mach-O module.
using LIEF::MachO::buffer_t = std::vector<uint8_t> |
using LIEF::MachO::uuid_t = std::array<uint8_t, 16> |
|
strong |
Enumerator | |
---|---|
ARM64_RELOC_UNSIGNED | For pointers. |
ARM64_RELOC_SUBTRACTOR | Must be followed by an ARM64_RELOCATION::ARM64_RELOC_UNSIGNED |
ARM64_RELOC_BRANCH26 | A B/BL instruction with 26-bit displacement. |
ARM64_RELOC_PAGE21 | PC-rel distance to page of target. |
ARM64_RELOC_PAGEOFF12 | Offset within page, scaled by MachO::Relocation::size. |
ARM64_RELOC_GOT_LOAD_PAGE21 | PC-rel distance to page of GOT slot |
ARM64_RELOC_GOT_LOAD_PAGEOFF12 | Offset within page of GOT slot, scaled by MachO::Relocation::size. |
ARM64_RELOC_POINTER_TO_GOT | For pointers to GOT slots. |
ARM64_RELOC_TLVP_LOAD_PAGE21 | PC-rel distance to page of TLVP slot. |
ARM64_RELOC_TLVP_LOAD_PAGEOFF12 | Offset within page of TLVP slot, scaled by MachO::Relocation::size. |
ARM64_RELOC_ADDEND | Must be followed by ARM64_RELOCATION::ARM64_RELOC_PAGE21 or ARM64_RELOCATION::ARM64_RELOC_PAGEOFF12. |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
Enumerator | |
---|---|
X86_64_RELOC_UNSIGNED | A CALL/JMP instruction with 32-bit displacement. |
X86_64_RELOC_SIGNED | A MOVQ load of a GOT entry. |
X86_64_RELOC_BRANCH | Other GOT references. |
X86_64_RELOC_GOT_LOAD | Signed 32-bit displacement. |
X86_64_RELOC_GOT | Absolute address. |
X86_64_RELOC_SUBTRACTOR | Must be followed by a X86_64_RELOCATION::X86_64_RELOC_UNSIGNED relocation. |
X86_64_RELOC_SIGNED_1 | |
X86_64_RELOC_SIGNED_2 | |
X86_64_RELOC_SIGNED_4 | |
X86_64_RELOC_TLV |
|
strong |
Enumerator | |
---|---|
GENERIC_RELOC_VANILLA | A generic relocation entry for both addresses contained in data and addresses contained in CPU instructions. |
GENERIC_RELOC_PAIR | The second relocation entry of a pair. |
GENERIC_RELOC_SECTDIFF | A relocation entry for an item that contains the difference of two section addresses. This is generally used for position-independent code generation. |
GENERIC_RELOC_PB_LA_PTR | contains the address from which to subtract; it must be followed by a X86_RELOCATION::GENERIC_RELOC_PAIR containing the address to subtract. |
GENERIC_RELOC_LOCAL_SECTDIFF | Similar to X86_RELOCATION::GENERIC_RELOC_SECTDIFF except that this entry refers specifically to the address in this item. If the address is that of a globally visible coalesced symbol, this relocation entry does not change if the symbol is overridden. This is used to associate stack unwinding information with the object code this relocation entry describes. |
GENERIC_RELOC_TLV | A relocation entry for a prebound lazy pointer. This is always a scattered relocation entry. The MachO::Relocation::value field contains the non-prebound value of the lazy pointer. |
bool LIEF::MachO::check_layout | ( | const Binary & | binary, |
std::string * | error = nullptr ) |
Check the layout of the given Mach-O binary. It checks if it can be signed according to cctools-921/libstuff/checkout.c.
bool LIEF::MachO::check_layout | ( | const FatBinary & | binary, |
std::string * | error = nullptr ) |
Check the layout of the given FAT Mach-O by checking individually the layout of the binaries embedded in the FAT.
bool LIEF::MachO::is_64 | ( | const std::string & | file | ) |
Check if the given Mach-O is 64-bits.
bool LIEF::MachO::is_fat | ( | const std::string & | file | ) |
Check if the given file is a FAT Mach-O.
bool LIEF::MachO::is_macho | ( | BinaryStream & | stream | ) |
Check if the given stream wraps a Mach-O binary.
bool LIEF::MachO::is_macho | ( | const std::string & | file | ) |
Check if the given file is a Mach-O binary.
bool LIEF::MachO::is_macho | ( | const std::vector< uint8_t > & | raw | ) |
Check if the given raw data is a Mach-O binary.
std::string LIEF::MachO::to_json | ( | const Object & | v | ) |
const char * LIEF::MachO::to_string | ( | ARM64_RELOCATION | e | ) |
const char * LIEF::MachO::to_string | ( | ARM_RELOCATION | e | ) |
const char * LIEF::MachO::to_string | ( | BuildToolVersion::TOOLS | tool | ) |
const char * LIEF::MachO::to_string | ( | BuildVersion::PLATFORMS | e | ) |
const char * LIEF::MachO::to_string | ( | DataCodeEntry::TYPES | e | ) |
const char * LIEF::MachO::to_string | ( | DYLD_CHAINED_FORMAT | fmt | ) |
const char * LIEF::MachO::to_string | ( | DYLD_CHAINED_PTR_FORMAT | ptr_fmt | ) |
const char * LIEF::MachO::to_string | ( | DyldBindingInfo::CLASS | e | ) |
const char * LIEF::MachO::to_string | ( | DyldBindingInfo::TYPE | e | ) |
const char * LIEF::MachO::to_string | ( | DyldInfo::BIND_OPCODES | e | ) |
const char * LIEF::MachO::to_string | ( | DyldInfo::BIND_SUBOPCODE_THREADED | e | ) |
const char * LIEF::MachO::to_string | ( | DyldInfo::REBASE_OPCODES | e | ) |
const char * LIEF::MachO::to_string | ( | DyldInfo::REBASE_TYPE | e | ) |
const char * LIEF::MachO::to_string | ( | ExportInfo::FLAGS | flags | ) |
const char * LIEF::MachO::to_string | ( | ExportInfo::KIND | kind | ) |
const char * LIEF::MachO::to_string | ( | Header::CPU_TYPE | e | ) |
const char * LIEF::MachO::to_string | ( | Header::FILE_TYPE | e | ) |
const char * LIEF::MachO::to_string | ( | Header::FLAGS | e | ) |
const char * LIEF::MachO::to_string | ( | LoadCommand::TYPE | type | ) |
const char * LIEF::MachO::to_string | ( | MACHO_TYPES | e | ) |
const char * LIEF::MachO::to_string | ( | PPC_RELOCATION | e | ) |
const char * LIEF::MachO::to_string | ( | Relocation::ORIGIN | e | ) |
const char * LIEF::MachO::to_string | ( | Section::FLAGS | flag | ) |
const char * LIEF::MachO::to_string | ( | Section::TYPE | type | ) |
const char * LIEF::MachO::to_string | ( | SegmentCommand::FLAGS | flag | ) |
const char * LIEF::MachO::to_string | ( | SegmentCommand::VM_PROTECTIONS | protection | ) |
const char * LIEF::MachO::to_string | ( | Symbol::CATEGORY | e | ) |
const char * LIEF::MachO::to_string | ( | Symbol::ORIGIN | e | ) |
const char * LIEF::MachO::to_string | ( | Symbol::TYPE | e | ) |
const char * LIEF::MachO::to_string | ( | X86_64_RELOCATION | e | ) |
const char * LIEF::MachO::to_string | ( | X86_RELOCATION | e | ) |