LIEF: Library to Instrument Executable Formats Version 0.15.0
|
Namespace related to the LIEF's Mach-O module. More...
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 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() returns /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 LOAD_COMMAND_TYPES::LC_SEGMENT / LOAD_COMMAND_TYPES::LC_SEGMENT_64 command. More... | |
class | SegmentSplitInfo |
Class that represents the LOAD_COMMAND_TYPES::LC_SEGMENT_SPLIT_INFO command. More... | |
class | SourceVersion |
Class that represents the MachO LOAD_COMMAND_TYPES::LC_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 | 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> |
Enumerations | |
enum class | MACHO_TYPES : uint32_t { MH_MAGIC = 0xFEEDFACEu , MH_CIGAM = 0xCEFAEDFEu , MH_MAGIC_64 = 0xFEEDFACFu , MH_CIGAM_64 = 0xCFFAEDFEu , FAT_MAGIC = 0xCAFEBABEu , FAT_CIGAM = 0xBEBAFECAu } |
enum class | FILE_TYPES { MH_OBJECT = 0x1u , MH_EXECUTE = 0x2u , MH_FVMLIB = 0x3u , MH_CORE = 0x4u , MH_PRELOAD = 0x5u , MH_DYLIB = 0x6u , MH_DYLINKER = 0x7u , MH_BUNDLE = 0x8u , MH_DYLIB_STUB = 0x9u , MH_DSYM = 0xAu , MH_KEXT_BUNDLE = 0xBu } |
enum class | HEADER_FLAGS { MH_NOUNDEFS = 0x00000001u , MH_INCRLINK = 0x00000002u , MH_DYLDLINK = 0x00000004u , MH_BINDATLOAD = 0x00000008u , MH_PREBOUND = 0x00000010u , MH_SPLIT_SEGS = 0x00000020u , MH_LAZY_INIT = 0x00000040u , MH_TWOLEVEL = 0x00000080u , MH_FORCE_FLAT = 0x00000100u , MH_NOMULTIDEFS = 0x00000200u , MH_NOFIXPREBINDING = 0x00000400u , MH_PREBINDABLE = 0x00000800u , MH_ALLMODSBOUND = 0x00001000u , MH_SUBSECTIONS_VIA_SYMBOLS = 0x00002000u , MH_CANONICAL = 0x00004000u , MH_WEAK_DEFINES = 0x00008000u , MH_BINDS_TO_WEAK = 0x00010000u , MH_ALLOW_STACK_EXECUTION = 0x00020000u , MH_ROOT_SAFE = 0x00040000u , MH_SETUID_SAFE = 0x00080000u , MH_NO_REEXPORTED_DYLIBS = 0x00100000u , MH_PIE = 0x00200000u , MH_DEAD_STRIPPABLE_DYLIB = 0x00400000u , MH_HAS_TLV_DESCRIPTORS = 0x00800000u , MH_NO_HEAP_EXECUTION = 0x01000000u , MH_APP_EXTENSION_SAFE = 0x02000000u } |
enum class | LOAD_COMMAND_TYPES : uint64_t { LC_SEGMENT = 0x00000001u , LC_SYMTAB = 0x00000002u , LC_SYMSEG = 0x00000003u , LC_THREAD = 0x00000004u , LC_UNIXTHREAD = 0x00000005u , LC_LOADFVMLIB = 0x00000006u , LC_IDFVMLIB = 0x00000007u , LC_IDENT = 0x00000008u , LC_FVMFILE = 0x00000009u , LC_PREPAGE = 0x0000000Au , LC_DYSYMTAB = 0x0000000Bu , LC_LOAD_DYLIB = 0x0000000Cu , LC_ID_DYLIB = 0x0000000Du , LC_LOAD_DYLINKER = 0x0000000Eu , LC_ID_DYLINKER = 0x0000000Fu , LC_PREBOUND_DYLIB = 0x00000010u , LC_ROUTINES = 0x00000011u , LC_SUB_FRAMEWORK = 0x00000012u , LC_SUB_UMBRELLA = 0x00000013u , LC_SUB_CLIENT = 0x00000014u , LC_SUB_LIBRARY = 0x00000015u , LC_TWOLEVEL_HINTS = 0x00000016u , LC_PREBIND_CKSUM = 0x00000017u , LC_LOAD_WEAK_DYLIB = 0x80000018u , LC_SEGMENT_64 = 0x00000019u , LC_ROUTINES_64 = 0x0000001Au , LC_UUID = 0x0000001Bu , LC_RPATH = 0x8000001Cu , LC_CODE_SIGNATURE = 0x0000001Du , LC_SEGMENT_SPLIT_INFO = 0x0000001Eu , LC_REEXPORT_DYLIB = 0x8000001Fu , LC_LAZY_LOAD_DYLIB = 0x00000020u , LC_ENCRYPTION_INFO = 0x00000021u , LC_DYLD_INFO = 0x00000022u , LC_DYLD_INFO_ONLY = 0x80000022u , LC_LOAD_UPWARD_DYLIB = 0x80000023u , LC_VERSION_MIN_MACOSX = 0x00000024u , LC_VERSION_MIN_IPHONEOS = 0x00000025u , LC_FUNCTION_STARTS = 0x00000026u , LC_DYLD_ENVIRONMENT = 0x00000027u , LC_MAIN = 0x80000028u , LC_DATA_IN_CODE = 0x00000029u , LC_SOURCE_VERSION = 0x0000002Au , LC_DYLIB_CODE_SIGN_DRS = 0x0000002Bu , LC_ENCRYPTION_INFO_64 = 0x0000002Cu , LC_LINKER_OPTION = 0x0000002Du , LC_LINKER_OPTIMIZATION_HINT = 0x0000002Eu , LC_VERSION_MIN_TVOS = 0x0000002Fu , LC_VERSION_MIN_WATCHOS = 0x00000030u , LC_NOTE = 0x00000031u , LC_BUILD_VERSION = 0x00000032u , LC_DYLD_EXPORTS_TRIE = 0x80000033u , LC_DYLD_CHAINED_FIXUPS = 0x80000034u , LC_FILESET_ENTRY = 0x80000035u } |
enum | { LC_REQ_DYLD = 0x80000000u } |
enum class | MACHO_SEGMENTS_FLAGS : uint64_t { SG_HIGHVM = 0x1u , SG_FVMLIB = 0x2u , SG_NORELOC = 0x4u , SG_PROTECTED_VERSION_1 = 0x8u } |
enum class | SECTION_FLAGS_HELPER : uint64_t { SECTION_TYPE_MASK = 0x000000ffu , SECTION_FLAGS_MASK = 0xffffff00u , SECTION_FLAGS_USR_MASK = 0xff000000u , SECTION_FLAGS_SYS_MASK = 0x00ffff00u } |
enum class | MACHO_SECTION_TYPES : uint64_t { S_REGULAR = 0x00u , S_ZEROFILL = 0x01u , S_CSTRING_LITERALS = 0x02u , S_4BYTE_LITERALS = 0x03u , S_8BYTE_LITERALS = 0x04u , S_LITERAL_POINTERS = 0x05u , S_NON_LAZY_SYMBOL_POINTERS = 0x06u , S_LAZY_SYMBOL_POINTERS = 0x07u , S_SYMBOL_STUBS = 0x08u , S_MOD_INIT_FUNC_POINTERS = 0x09u , S_MOD_TERM_FUNC_POINTERS = 0x0au , S_COALESCED = 0x0bu , S_GB_ZEROFILL = 0x0cu , S_INTERPOSING = 0x0du , S_16BYTE_LITERALS = 0x0eu , S_DTRACE_DOF = 0x0fu , S_LAZY_DYLIB_SYMBOL_POINTERS = 0x10u , S_THREAD_LOCAL_REGULAR = 0x11u , S_THREAD_LOCAL_ZEROFILL = 0x12u , S_THREAD_LOCAL_VARIABLES = 0x13u , S_THREAD_LOCAL_VARIABLE_POINTERS = 0x14u , S_THREAD_LOCAL_INIT_FUNCTION_POINTERS = 0x15u , LAST_KNOWN_SECTION_TYPE = 0x15u } |
These are the section type and attributes fields. A MachO section can have only one Type, but can have any of the attributes specified. More... | |
enum class | MACHO_SECTION_FLAGS : uint64_t { S_ATTR_PURE_INSTRUCTIONS = 0x80000000u , S_ATTR_NO_TOC = 0x40000000u , S_ATTR_STRIP_STATIC_SYMS = 0x20000000u , S_ATTR_NO_DEAD_STRIP = 0x10000000u , S_ATTR_LIVE_SUPPORT = 0x08000000u , S_ATTR_SELF_MODIFYING_CODE = 0x04000000u , S_ATTR_DEBUG = 0x02000000u , S_ATTR_SOME_INSTRUCTIONS = 0x00000400u , S_ATTR_EXT_RELOC = 0x00000200u , S_ATTR_LOC_RELOC = 0x00000100u , INDIRECT_SYMBOL_LOCAL = 0x80000000u , INDIRECT_SYMBOL_ABS = 0x40000000u } |
enum class | DataRegionType : uint64_t { DICE_KIND_DATA = 1u , DICE_KIND_JUMP_TABLE8 = 2u , DICE_KIND_JUMP_TABLE16 = 3u , DICE_KIND_JUMP_TABLE32 = 4u , DICE_KIND_ABS_JUMP_TABLE32 = 5u } |
enum class | REBASE_TYPES : uint64_t { REBASE_TYPE_POINTER = 1u , REBASE_TYPE_TEXT_ABSOLUTE32 = 2u , REBASE_TYPE_TEXT_PCREL32 = 3u , REBASE_TYPE_THREADED = 102u } |
enum | { REBASE_OPCODE_MASK = 0xF0u , REBASE_IMMEDIATE_MASK = 0x0Fu } |
enum class | REBASE_OPCODES : uint8_t { REBASE_OPCODE_DONE = 0x00u , REBASE_OPCODE_SET_TYPE_IMM = 0x10u , REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB = 0x20u , REBASE_OPCODE_ADD_ADDR_ULEB = 0x30u , REBASE_OPCODE_ADD_ADDR_IMM_SCALED = 0x40u , REBASE_OPCODE_DO_REBASE_IMM_TIMES = 0x50u , REBASE_OPCODE_DO_REBASE_ULEB_TIMES = 0x60u , REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB = 0x70u , REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB = 0x80u } |
Opcodes used by Dyld info to rebase a Mach-O image. More... | |
enum class | BINDING_CLASS : uint64_t { BIND_CLASS_WEAK = 1u , BIND_CLASS_LAZY = 2u , BIND_CLASS_STANDARD = 3u , BIND_CLASS_THREADED = 100u } |
Within the dyld_info_command there are differents area of binding. These enums tag these area. | |
enum class | BIND_TYPES : uint64_t { BIND_TYPE_POINTER = 1u , BIND_TYPE_TEXT_ABSOLUTE32 = 2u , BIND_TYPE_TEXT_PCREL32 = 3u } |
enum class | BIND_SPECIAL_DYLIB : int { BIND_SPECIAL_DYLIB_SELF = 0 , BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE = -1 , BIND_SPECIAL_DYLIB_FLAT_LOOKUP = -2 } |
enum | { BIND_SYMBOL_FLAGS_WEAK_IMPORT = 0x1u , BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION = 0x8u , BIND_OPCODE_MASK = 0xF0u , BIND_IMMEDIATE_MASK = 0x0Fu } |
enum class | BIND_OPCODES : uint8_t { BIND_OPCODE_DONE = 0x00u , BIND_OPCODE_SET_DYLIB_ORDINAL_IMM = 0x10u , BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB = 0x20u , BIND_OPCODE_SET_DYLIB_SPECIAL_IMM = 0x30u , BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM = 0x40u , BIND_OPCODE_SET_TYPE_IMM = 0x50u , BIND_OPCODE_SET_ADDEND_SLEB = 0x60u , BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB = 0x70u , BIND_OPCODE_ADD_ADDR_ULEB = 0x80u , BIND_OPCODE_DO_BIND = 0x90u , BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB = 0xA0u , BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED = 0xB0u , BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB = 0xC0u , BIND_OPCODE_THREADED = 0xD0u , BIND_OPCODE_THREADED_APPLY = 0xD0u | 0x01u , BIND_OPCODE_THREADED_SET_BIND_ORDINAL_TABLE_SIZE_ULEB = 0xD0u | 0x00u } |
Opcodes used by Dyld info to bind symbols. More... | |
enum class | BIND_SUBOPCODE_THREADED : uint8_t { BIND_SUBOPCODE_THREADED_SET_BIND_ORDINAL_TABLE_SIZE_ULEB = 0x00u , BIND_SUBOPCODE_THREADED_APPLY = 0x01u } |
enum class | EXPORT_SYMBOL_FLAGS : uint64_t { EXPORT_SYMBOL_FLAGS_KIND_MASK = 0x03u , EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION = 0x04u , EXPORT_SYMBOL_FLAGS_REEXPORT = 0x08u , EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER = 0x10u } |
enum class | EXPORT_SYMBOL_KINDS : uint64_t { EXPORT_SYMBOL_FLAGS_KIND_REGULAR = 0x00u , EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL = 0x01u , EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE = 0x02u } |
enum class | MACHO_SYMBOL_TYPES : uint64_t { N_STAB = 0xe0 , N_PEXT = 0x10 , N_TYPE = 0x0e , N_EXT = 0x01 } |
enum class | N_LIST_TYPES : uint64_t { N_UNDF = 0x0u , N_ABS = 0x2u , N_SECT = 0xeu , N_PBUD = 0xcu , N_INDR = 0xau } |
Constants for the "n_type & SYMBOL_TYPES::N_TYPE" in nlist. More... | |
enum class | SectionOrdinal : uint64_t { NO_SECT = 0u , MAX_SECT = 0xffu } |
enum class | SYMBOL_DESCRIPTIONS : uint64_t { REFERENCE_TYPE = 0x7 , REFERENCE_FLAG_UNDEFINED_NON_LAZY = 0 , REFERENCE_FLAG_UNDEFINED_LAZY = 1 , REFERENCE_FLAG_DEFINED = 2 , REFERENCE_FLAG_PRIVATE_DEFINED = 3 , REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY = 4 , REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY = 5 , N_ARM_THUMB_DEF = 0x0008u , REFERENCED_DYNAMICALLY = 0x0010u , N_NO_DEAD_STRIP = 0x0020u , N_WEAK_REF = 0x0040u , N_WEAK_DEF = 0x0080u , N_SYMBOL_RESOLVER = 0x0100u , N_ALT_ENTRY = 0x0200u , SELF_LIBRARY_ORDINAL = 0x0 , MAX_LIBRARY_ORDINAL = 0xfd , DYNAMIC_LOOKUP_ORDINAL = 0xfe , EXECUTABLE_ORDINAL = 0xff } |
enum class | StabType : uint64_t { N_GSYM = 0x20u , N_FNAME = 0x22u , N_FUN = 0x24u , N_STSYM = 0x26u , N_LCSYM = 0x28u , N_BNSYM = 0x2Eu , N_PC = 0x30u , N_AST = 0x32u , N_OPT = 0x3Cu , N_RSYM = 0x40u , N_SLINE = 0x44u , N_ENSYM = 0x4Eu , N_SSYM = 0x60u , N_SO = 0x64u , N_OSO = 0x66u , N_LSYM = 0x80u , N_BINCL = 0x82u , N_SOL = 0x84u , N_PARAMS = 0x86u , N_VERSION = 0x88u , N_OLEVEL = 0x8Au , N_PSYM = 0xA0u , N_EINCL = 0xA2u , N_ENTRY = 0xA4u , N_LBRAC = 0xC0u , N_EXCL = 0xC2u , N_RBRAC = 0xE0u , N_BCOMM = 0xE2u , N_ECOMM = 0xE4u , N_ECOML = 0xE8u , N_LENG = 0xFEu } |
enum | { R_ABS = 0 , R_SCATTERED = 0x80000000 } |
enum class | RELOCATION_ORIGINS { ORIGIN_UNKNOWN = 0 , ORIGIN_DYLDINFO = 1 , ORIGIN_RELOC_TABLE = 2 , ORIGIN_CHAINED_FIXUPS = 3 } |
enum class | SYMBOL_ORIGINS { SYM_ORIGIN_UNKNOWN = 0 , SYM_ORIGIN_DYLD_EXPORT = 1 , SYM_ORIGIN_DYLD_BIND = 2 , SYM_ORIGIN_LC_SYMTAB = 3 } |
enum class | X86_RELOCATION { GENERIC_RELOC_VANILLA = 0 , GENERIC_RELOC_PAIR = 1 , GENERIC_RELOC_SECTDIFF = 2 , GENERIC_RELOC_PB_LA_PTR = 3 , GENERIC_RELOC_LOCAL_SECTDIFF = 4 , GENERIC_RELOC_TLV = 5 } |
enum class | X86_64_RELOCATION { X86_64_RELOC_UNSIGNED = 0 , X86_64_RELOC_SIGNED = 1 , X86_64_RELOC_BRANCH = 2 , X86_64_RELOC_GOT_LOAD = 3 , X86_64_RELOC_GOT = 4 , X86_64_RELOC_SUBTRACTOR = 5 , X86_64_RELOC_SIGNED_1 = 6 , X86_64_RELOC_SIGNED_2 = 7 , X86_64_RELOC_SIGNED_4 = 8 , X86_64_RELOC_TLV = 9 } |
enum class | PPC_RELOCATION { PPC_RELOC_VANILLA = 0 , PPC_RELOC_PAIR = 1 , PPC_RELOC_BR14 = 2 , PPC_RELOC_BR24 = 3 , PPC_RELOC_HI16 = 4 , PPC_RELOC_LO16 = 5 , PPC_RELOC_HA16 = 6 , PPC_RELOC_LO14 = 7 , PPC_RELOC_SECTDIFF = 8 , PPC_RELOC_PB_LA_PTR = 9 , PPC_RELOC_HI16_SECTDIFF = 10 , PPC_RELOC_LO16_SECTDIFF = 11 , PPC_RELOC_HA16_SECTDIFF = 12 , PPC_RELOC_JBSR = 13 , PPC_RELOC_LO14_SECTDIFF = 14 , PPC_RELOC_LOCAL_SECTDIFF = 15 } |
enum class | ARM_RELOCATION { ARM_RELOC_VANILLA = 0 , ARM_RELOC_PAIR = 1 , ARM_RELOC_SECTDIFF = 2 , ARM_RELOC_LOCAL_SECTDIFF = 3 , ARM_RELOC_PB_LA_PTR = 4 , ARM_RELOC_BR24 = 5 , ARM_THUMB_RELOC_BR22 = 6 , ARM_THUMB_32BIT_BRANCH = 7 , ARM_RELOC_HALF = 8 , ARM_RELOC_HALF_SECTDIFF = 9 } |
enum class | ARM64_RELOCATION { ARM64_RELOC_UNSIGNED = 0 , ARM64_RELOC_SUBTRACTOR = 1 , ARM64_RELOC_BRANCH26 = 2 , ARM64_RELOC_PAGE21 = 3 , ARM64_RELOC_PAGEOFF12 = 4 , ARM64_RELOC_GOT_LOAD_PAGE21 = 5 , ARM64_RELOC_GOT_LOAD_PAGEOFF12 = 6 , ARM64_RELOC_POINTER_TO_GOT = 7 , ARM64_RELOC_TLVP_LOAD_PAGE21 = 8 , ARM64_RELOC_TLVP_LOAD_PAGEOFF12 = 9 , ARM64_RELOC_ADDEND = 10 } |
enum class | VM_PROTECTIONS { VM_PROT_READ = 0x1 , VM_PROT_WRITE = 0x2 , VM_PROT_EXECUTE = 0x4 } |
Values for segment_command.initprot. From <mach/vm_prot.h> More... | |
enum | { CPU_ARCH_MASK = 0xff000000 , CPU_ARCH_ABI64 = 0x01000000 } |
enum class | CPU_TYPES : int { CPU_TYPE_ANY = -1 , CPU_TYPE_X86 = 7 , CPU_TYPE_I386 = 7 , CPU_TYPE_X86_64 = 7 | 0x01000000 , CPU_TYPE_MC98000 = 10 , CPU_TYPE_ARM = 12 , CPU_TYPE_ARM64 = 12 | 0x01000000 , CPU_TYPE_SPARC = 14 , CPU_TYPE_POWERPC = 18 , CPU_TYPE_POWERPC64 = 18 | 0x01000000 } |
enum | { CPU_SUBTYPE_MASK = 0xff000000 , CPU_SUBTYPE_LIB64 = 0x80000000 , CPU_SUBTYPE_MULTIPLE = ~0u } |
enum class | CPU_SUBTYPES_X86 { CPU_SUBTYPE_I386_ALL = 3 , CPU_SUBTYPE_386 = 3 , CPU_SUBTYPE_486 = 4 , CPU_SUBTYPE_486SX = 0x84 , CPU_SUBTYPE_586 = 5 , CPU_SUBTYPE_PENT = 5 , CPU_SUBTYPE_PENTPRO = 0x16 , CPU_SUBTYPE_PENTII_M3 = 0x36 , CPU_SUBTYPE_PENTII_M5 = 0x56 , CPU_SUBTYPE_CELERON = 0x67 , CPU_SUBTYPE_CELERON_MOBILE = 0x77 , CPU_SUBTYPE_PENTIUM_3 = 0x08 , CPU_SUBTYPE_PENTIUM_3_M = 0x18 , CPU_SUBTYPE_PENTIUM_3_XEON = 0x28 , CPU_SUBTYPE_PENTIUM_M = 0x09 , CPU_SUBTYPE_PENTIUM_4 = 0x0a , CPU_SUBTYPE_PENTIUM_4_M = 0x1a , CPU_SUBTYPE_ITANIUM = 0x0b , CPU_SUBTYPE_ITANIUM_2 = 0x1b , CPU_SUBTYPE_XEON = 0x0c , CPU_SUBTYPE_XEON_MP = 0x1c , CPU_SUBTYPE_X86_ALL = 3 , CPU_SUBTYPE_X86_64_ALL = 3 , CPU_SUBTYPE_X86_ARCH1 = 4 , CPU_SUBTYPE_X86_64_H = 8 } |
enum | { CPU_SUBTYPE_INTEL_FAMILY_MAX = 15 , CPU_SUBTYPE_INTEL_MODEL_ALL = 0 } |
enum class | CPU_SUBTYPES_ARM { CPU_SUBTYPE_ARM_ALL = 0 , CPU_SUBTYPE_ARM_V4T = 5 , CPU_SUBTYPE_ARM_V6 = 6 , CPU_SUBTYPE_ARM_V5 = 7 , CPU_SUBTYPE_ARM_V5TEJ = 7 , CPU_SUBTYPE_ARM_XSCALE = 8 , CPU_SUBTYPE_ARM_V7 = 9 , CPU_SUBTYPE_ARM_V7S = 11 , CPU_SUBTYPE_ARM_V7K = 12 , CPU_SUBTYPE_ARM_V6M = 14 , CPU_SUBTYPE_ARM_V7M = 15 , CPU_SUBTYPE_ARM_V7EM = 16 } |
enum class | CPU_SUBTYPES_ARM64 { CPU_SUBTYPE_ARM64_ALL = 0 } |
enum class | CPU_SUBTYPES_SPARC { CPU_SUBTYPE_SPARC_ALL = 0 } |
enum class | CPU_SUBTYPES_POWERPC { CPU_SUBTYPE_POWERPC_ALL = 0 , CPU_SUBTYPE_POWERPC_601 = 1 , CPU_SUBTYPE_POWERPC_602 = 2 , CPU_SUBTYPE_POWERPC_603 = 3 , CPU_SUBTYPE_POWERPC_603e = 4 , CPU_SUBTYPE_POWERPC_603ev = 5 , CPU_SUBTYPE_POWERPC_604 = 6 , CPU_SUBTYPE_POWERPC_604e = 7 , CPU_SUBTYPE_POWERPC_620 = 8 , CPU_SUBTYPE_POWERPC_750 = 9 , CPU_SUBTYPE_POWERPC_7400 = 10 , CPU_SUBTYPE_POWERPC_7450 = 11 , CPU_SUBTYPE_POWERPC_970 = 100 , CPU_SUBTYPE_MC980000_ALL = 0 , CPU_SUBTYPE_MC98601 = 1 } |
enum class | DYLD_CHAINED_FORMAT { IMPORT = 1 , IMPORT_ADDEND = 2 , IMPORT_ADDEND64 = 3 } |
enum | DYLD_CHAINED_PTR_FORMAT { PTR_ARM64E = 1 , PTR_64 = 2 , PTR_32 = 3 , PTR_32_CACHE = 4 , PTR_32_FIRMWARE = 5 , PTR_64_OFFSET = 6 , PTR_ARM64E_OFFSET = 7 , PTR_ARM64E_KERNEL = 7 , PTR_64_KERNEL_CACHE = 8 , PTR_ARM64E_USERLAND = 9 , PTR_ARM64E_FIRMWARE = 10 , PTR_X86_64_KERNEL_CACHE = 11 , PTR_ARM64E_USERLAND24 = 12 } |
Functions | |
const char * | to_string (BuildToolVersion::TOOLS tool) |
const char * | to_string (LOAD_COMMAND_TYPES e) |
const char * | to_string (MACHO_TYPES e) |
const char * | to_string (FILE_TYPES e) |
const char * | to_string (CPU_TYPES e) |
const char * | to_string (HEADER_FLAGS e) |
const char * | to_string (MACHO_SECTION_TYPES e) |
const char * | to_string (MACHO_SECTION_FLAGS e) |
const char * | to_string (MACHO_SYMBOL_TYPES e) |
const char * | to_string (N_LIST_TYPES e) |
const char * | to_string (SYMBOL_DESCRIPTIONS 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 (RELOCATION_ORIGINS e) |
const char * | to_string (REBASE_TYPES e) |
const char * | to_string (BINDING_CLASS e) |
const char * | to_string (REBASE_OPCODES e) |
const char * | to_string (BIND_TYPES e) |
const char * | to_string (BIND_SPECIAL_DYLIB e) |
const char * | to_string (BIND_SUBOPCODE_THREADED e) |
const char * | to_string (BIND_OPCODES e) |
const char * | to_string (EXPORT_SYMBOL_KINDS e) |
const char * | to_string (VM_PROTECTIONS e) |
const char * | to_string (SYMBOL_ORIGINS e) |
const char * | to_string (EXPORT_SYMBOL_FLAGS e) |
const char * | to_string (DataCodeEntry::TYPES e) |
const char * | to_string (BuildVersion::PLATFORMS e) |
const char * | to_string (DYLD_CHAINED_PTR_FORMAT e) |
const char * | to_string (DYLD_CHAINED_FORMAT e) |
std::string | to_json (const Object &v) |
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. | |
Variables | |
static const HEADER_FLAGS | header_flags_array [] |
static const MACHO_SECTION_FLAGS | section_flags_array [] |
static const EXPORT_SYMBOL_FLAGS | export_symbol_flags [] |
Namespace related to the LIEF's Mach-O module.
|
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 |
Opcodes used by Dyld info to bind symbols.
|
strong |
|
strong |
Enumerator | |
---|---|
S_ATTR_PURE_INSTRUCTIONS | Section contains only true machine instructions. |
S_ATTR_NO_TOC | Section contains coalesced symbols that are not to be in a ranlib table of contents. |
S_ATTR_STRIP_STATIC_SYMS | Ok to strip static symbols in this section in files with the MY_DYLDLINK flag. |
S_ATTR_NO_DEAD_STRIP | No dead stripping. |
S_ATTR_LIVE_SUPPORT | Blocks are live if they reference live blocks. |
S_ATTR_SELF_MODIFYING_CODE | Used with i386 code stubs written on by dyld. |
S_ATTR_DEBUG | A debug section. |
S_ATTR_SOME_INSTRUCTIONS | Section contains some machine instructions. |
S_ATTR_EXT_RELOC | Section has external relocation entries. |
S_ATTR_LOC_RELOC | Section has local relocation entries. |
|
strong |
These are the section type and attributes fields. A MachO section can have only one Type, but can have any of the attributes specified.
Enumerator | |
---|---|
S_REGULAR | Regular section. |
S_ZEROFILL | Zero fill on demand section. |
S_CSTRING_LITERALS | Section with literal C strings. |
S_4BYTE_LITERALS | Section with 4 byte literals. |
S_8BYTE_LITERALS | Section with 8 byte literals. |
S_LITERAL_POINTERS | Section with pointers to literals. |
S_NON_LAZY_SYMBOL_POINTERS | Section with non-lazy symbol pointers. |
S_LAZY_SYMBOL_POINTERS | Section with lazy symbol pointers. |
S_SYMBOL_STUBS | Section with symbol stubs, byte size of stub in the Reserved2 field. |
S_MOD_INIT_FUNC_POINTERS | Section with only function pointers for initialization. |
S_MOD_TERM_FUNC_POINTERS | Section with only function pointers for termination. |
S_COALESCED | Section contains symbols that are to be coalesced. |
S_GB_ZEROFILL | Zero fill on demand section (that can be larger than 4 gigabytes). |
S_INTERPOSING | Section with only pairs of function pointers for interposing. |
S_16BYTE_LITERALS | Section with only 16 byte literals. |
S_DTRACE_DOF | |
S_LAZY_DYLIB_SYMBOL_POINTERS | Section with lazy symbol pointers to lazy loaded dylibs. |
S_THREAD_LOCAL_REGULAR | Thread local data section. |
S_THREAD_LOCAL_ZEROFILL | Thread local zerofill section. |
S_THREAD_LOCAL_VARIABLES | Section with thread local variable structure data. |
S_THREAD_LOCAL_VARIABLE_POINTERS | Section with pointers to thread local structures. |
S_THREAD_LOCAL_INIT_FUNCTION_POINTERS | Section with thread local variable initialization pointers to functions. |
|
strong |
|
strong |
Enumerator | |
---|---|
N_STAB | The symbol is symbolic debugging table. |
N_PEXT | Limited global scope symbol. |
N_TYPE | Define the type of the symbol.
|
N_EXT | External symbol, a symbol that is either defined outside this file or that is defined in this file but can be referenced by other files. |
|
strong |
|
strong |
Constants for the "n_type & SYMBOL_TYPES::N_TYPE" in nlist.
|
strong |
Opcodes used by Dyld info to rebase a Mach-O image.
|
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. |
|
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. |
|
static |
|
static |
|
static |