Rizin
unix-like reverse engineering framework and cli tools
|
#include <stdio.h>
#include <rz_types.h>
#include <rz_util.h>
#include "mach0.h"
#include <rz_hash.h>
#include "mach0_utils.inc"
Go to the source code of this file.
Classes | |
struct | RSymCtx |
struct | RTrieState |
Macros | |
#define | bprintf |
#define | Eprintf |
#define | mach0_endian 1 |
#define | Error(x) |
#define | READFIELD(x) cscd.x = rz_read_ble32(p + rz_offsetof(CS_CodeDirectory, x), 1) |
#define | READFIELD8(x) cscd.x = p[rz_offsetof(CS_CodeDirectory, x)] |
#define | READWORD() |
Typedefs | |
typedef void(* | RExportsIterator) (struct MACH0_(obj_t) *bin, const char *name, ut64 flags, ut64 offset, void *ctx) |
#define bprintf |
#define READFIELD | ( | x | ) | cscd.x = rz_read_ble32(p + rz_offsetof(CS_CodeDirectory, x), 1) |
#define READFIELD8 | ( | x | ) | cscd.x = p[rz_offsetof(CS_CodeDirectory, x)] |
#define READWORD | ( | ) |
|
static |
Definition at line 2146 of file mach0.c.
References rz_bin_section_t::name.
Referenced by get_segments().
|
static |
Definition at line 2943 of file mach0.c.
References symbol_t::addr, RSymCtx::hash, inSymtab(), RSymCtx::j, MACH0_(), symbol_t::name, symbol_t::offset, paddr_to_vaddr(), RZ_BIN_MACH0_SYMBOL_TYPE_EXT, symbol_t::size, strdup(), RSymCtx::symbols, and symbol_t::type.
Referenced by get_symbols().
Definition at line 1436 of file mach0.c.
Referenced by mach_headerfields().
Definition at line 1336 of file mach0.c.
References cmd, LC_BUILD_VERSION, LC_CODE_SIGNATURE, LC_DATA_IN_CODE, LC_DYLD_ENVIRONMENT, LC_DYLD_INFO, LC_DYLD_INFO_ONLY, LC_DYLIB_CODE_SIGN_DRS, LC_DYSYMTAB, LC_ENCRYPTION_INFO, LC_ENCRYPTION_INFO_64, LC_FUNCTION_STARTS, LC_FVMFILE, LC_ID_DYLIB, LC_ID_DYLINKER, LC_IDENT, LC_IDFVMLIB, LC_LAZY_LOAD_DYLIB, LC_LINKER_OPTIMIZATION_HINT, LC_LINKER_OPTION, LC_LOAD_DYLIB, LC_LOAD_DYLINKER, LC_LOAD_WEAK_DYLIB, LC_LOADFVMLIB, LC_MAIN, LC_NOTE, LC_PREBIND_CKSUM, LC_PREBOUND_DYLIB, LC_PREPAGE, LC_REEXPORT_DYLIB, LC_ROUTINES, LC_ROUTINES_64, LC_RPATH, LC_SEGMENT, LC_SEGMENT_64, LC_SEGMENT_SPLIT_INFO, LC_SOURCE_VERSION, LC_SUB_CLIENT, LC_SUB_FRAMEWORK, LC_SUB_LIBRARY, LC_SUB_UMBRELLA, LC_SYMSEG, LC_SYMTAB, LC_THREAD, LC_TWOLEVEL_HINTS, LC_UNIXTHREAD, LC_UUID, LC_VERSION_MIN_IPHONEOS, LC_VERSION_MIN_MACOSX, LC_VERSION_MIN_TVOS, LC_VERSION_MIN_WATCHOS, and NULL.
Referenced by init_items(), MACH0_(), and mach_headerfields().
Definition at line 1230 of file mach0.c.
References cmd, LC_BUILD_VERSION, LC_CODE_SIGNATURE, LC_DATA_IN_CODE, LC_DYLD_ENVIRONMENT, LC_DYLD_INFO, LC_DYLD_INFO_ONLY, LC_DYLIB_CODE_SIGN_DRS, LC_DYSYMTAB, LC_ENCRYPTION_INFO, LC_ENCRYPTION_INFO_64, LC_FUNCTION_STARTS, LC_FVMFILE, LC_ID_DYLIB, LC_ID_DYLINKER, LC_IDENT, LC_IDFVMLIB, LC_LAZY_LOAD_DYLIB, LC_LINKER_OPTIMIZATION_HINT, LC_LINKER_OPTION, LC_LOAD_DYLIB, LC_LOAD_DYLINKER, LC_LOAD_WEAK_DYLIB, LC_LOADFVMLIB, LC_MAIN, LC_NOTE, LC_PREBIND_CKSUM, LC_PREBOUND_DYLIB, LC_PREPAGE, LC_REEXPORT_DYLIB, LC_ROUTINES, LC_ROUTINES_64, LC_RPATH, LC_SEGMENT, LC_SEGMENT_64, LC_SEGMENT_SPLIT_INFO, LC_SOURCE_VERSION, LC_SUB_CLIENT, LC_SUB_FRAMEWORK, LC_SUB_LIBRARY, LC_SUB_UMBRELLA, LC_SYMSEG, LC_SYMTAB, LC_THREAD, LC_TWOLEVEL_HINTS, LC_UNIXTHREAD, LC_UUID, LC_VERSION_MIN_IPHONEOS, LC_VERSION_MIN_MACOSX, LC_VERSION_MIN_TVOS, and LC_VERSION_MIN_WATCHOS.
Referenced by MACH0_(), and mach_headerfields().
Definition at line 3387 of file mach0.c.
References CPU_SUBTYPE_386, CPU_SUBTYPE_486, CPU_SUBTYPE_486SX, CPU_SUBTYPE_ARM64_ALL, CPU_SUBTYPE_ARM64_V8, CPU_SUBTYPE_ARM64E, CPU_SUBTYPE_ARM_ALL, CPU_SUBTYPE_ARM_V4T, CPU_SUBTYPE_ARM_V5, CPU_SUBTYPE_ARM_V6, CPU_SUBTYPE_ARM_V7, CPU_SUBTYPE_ARM_V7EM, CPU_SUBTYPE_ARM_V7F, CPU_SUBTYPE_ARM_V7K, CPU_SUBTYPE_ARM_V7M, CPU_SUBTYPE_ARM_V7S, CPU_SUBTYPE_ARM_XSCALE, CPU_SUBTYPE_CELERON, CPU_SUBTYPE_CELERON_MOBILE, CPU_SUBTYPE_HPPA_7100, CPU_SUBTYPE_HPPA_7100LC, CPU_SUBTYPE_I860_860, CPU_SUBTYPE_I860_ALL, CPU_SUBTYPE_ITANIUM, CPU_SUBTYPE_ITANIUM_2, CPU_SUBTYPE_MC68030, CPU_SUBTYPE_MC68030_ONLY, CPU_SUBTYPE_MC68040, CPU_SUBTYPE_MC88000_ALL, CPU_SUBTYPE_MC88100, CPU_SUBTYPE_MC88110, CPU_SUBTYPE_MC98000_ALL, CPU_SUBTYPE_MC98601, CPU_SUBTYPE_MIPS_ALL, CPU_SUBTYPE_MIPS_R2000, CPU_SUBTYPE_MIPS_R2000a, CPU_SUBTYPE_MIPS_R2300, CPU_SUBTYPE_MIPS_R2600, CPU_SUBTYPE_MIPS_R2800, CPU_SUBTYPE_MIPS_R3000, CPU_SUBTYPE_MIPS_R3000a, CPU_SUBTYPE_PENT, CPU_SUBTYPE_PENTII_M3, CPU_SUBTYPE_PENTII_M5, CPU_SUBTYPE_PENTIUM_3, CPU_SUBTYPE_PENTIUM_3_M, CPU_SUBTYPE_PENTIUM_3_XEON, CPU_SUBTYPE_PENTIUM_4, CPU_SUBTYPE_PENTIUM_4_M, CPU_SUBTYPE_PENTIUM_M, CPU_SUBTYPE_PENTPRO, CPU_SUBTYPE_POWERPC_601, CPU_SUBTYPE_POWERPC_602, CPU_SUBTYPE_POWERPC_603, CPU_SUBTYPE_POWERPC_603e, CPU_SUBTYPE_POWERPC_603ev, CPU_SUBTYPE_POWERPC_604, CPU_SUBTYPE_POWERPC_604e, CPU_SUBTYPE_POWERPC_620, CPU_SUBTYPE_POWERPC_7400, CPU_SUBTYPE_POWERPC_7450, CPU_SUBTYPE_POWERPC_750, CPU_SUBTYPE_POWERPC_970, CPU_SUBTYPE_POWERPC_ALL, CPU_SUBTYPE_SPARC_ALL, CPU_SUBTYPE_UVAXI, CPU_SUBTYPE_UVAXII, CPU_SUBTYPE_UVAXIII, CPU_SUBTYPE_VAX730, CPU_SUBTYPE_VAX750, CPU_SUBTYPE_VAX780, CPU_SUBTYPE_VAX785, CPU_SUBTYPE_VAX8200, CPU_SUBTYPE_VAX8500, CPU_SUBTYPE_VAX8600, CPU_SUBTYPE_VAX8650, CPU_SUBTYPE_VAX8800, CPU_SUBTYPE_VAX_ALL, CPU_SUBTYPE_X86_64_ALL, CPU_SUBTYPE_X86_ARCH1, CPU_SUBTYPE_XEON, CPU_SUBTYPE_XEON_MP, CPU_TYPE_ARM, CPU_TYPE_ARM64, CPU_TYPE_HPPA, CPU_TYPE_I386, CPU_TYPE_I860, CPU_TYPE_MC680x0, CPU_TYPE_MC88000, CPU_TYPE_MC98000, CPU_TYPE_MIPS, CPU_TYPE_POWERPC, CPU_TYPE_POWERPC64, CPU_TYPE_SPARC, CPU_TYPE_VAX, CPU_TYPE_X86_64, and eprintf.
Referenced by get_cpusubtype_from_hdr().
Definition at line 41 of file mach0.c.
References LC_MAIN, LC_THREAD, and LC_UNIXTHREAD.
Referenced by get_entrypoint().
|
static |
Definition at line 2746 of file mach0.c.
References rz_bin_symbol_t::bind, list(), MACH0_(), rz_bin_symbol_t::name, rz_bin_symbol_t::paddr, paddr_to_vaddr(), RZ_BIN_BIND_GLOBAL_STR, rz_list_append(), RZ_NEW0, strdup(), rz_bin_symbol_t::type, and rz_bin_symbol_t::vaddr.
Referenced by get_symbols_list().
Definition at line 3288 of file mach0.c.
References bits(), CPU_TYPE_ARM, get_bits_from_hdr(), and MACH0_().
int MACH0_() get_bits_from_hdr | ( | struct MACH0_(mach_header) * | hdr | ) |
Definition at line 3299 of file mach0.c.
References CPU_SUBTYPE_ARM_V7K, CPU_SUBTYPE_MASK, CPU_TYPE_ARM64_32, MH_CIGAM_64, and MH_MAGIC_64.
Referenced by fill_metadata_info_from_hdr(), get_bits(), get_symbols(), get_symbols_list(), and reloc_target_size().
Definition at line 3546 of file mach0.c.
References get_cpusubtype_from_hdr(), MACH0_(), and strdup().
Referenced by info().
char* MACH0_() get_cpusubtype_from_hdr | ( | struct MACH0_(mach_header) * | hdr | ) |
Definition at line 3541 of file mach0.c.
References cpusubtype_tostring(), NULL, rz_return_val_if_fail, and strdup().
Referenced by fill_metadata_info_from_hdr(), and get_cpusubtype().
Definition at line 3383 of file mach0.c.
References get_cputype_from_hdr(), and MACH0_().
Referenced by info().
const char* MACH0_() get_cputype_from_hdr | ( | struct MACH0_(mach_header) * | hdr | ) |
Definition at line 3336 of file mach0.c.
References CPU_TYPE_ARM, CPU_TYPE_ARM64, CPU_TYPE_ARM64_32, CPU_TYPE_HPPA, CPU_TYPE_I386, CPU_TYPE_I860, CPU_TYPE_MC680x0, CPU_TYPE_MC88000, CPU_TYPE_MC98000, CPU_TYPE_MIPS, CPU_TYPE_POWERPC, CPU_TYPE_POWERPC64, CPU_TYPE_SPARC, CPU_TYPE_VAX, CPU_TYPE_X86_64, and eprintf.
Referenced by _patch_reloc(), fill_metadata_info_from_hdr(), and get_cputype().
Definition at line 3196 of file mach0.c.
References entry_to_vaddr(), eprintf, i, if(), MACH0_(), NULL, RZ_NEW0, rz_return_val_if_fail, sdb_num_get(), sdb_num_set(), ut64(), UT64_MAX, and vaddr_to_paddr().
Referenced by entries(), and get_main().
Definition at line 3578 of file mach0.c.
References get_filetype_from_hdr(), MACH0_(), and strdup().
Referenced by info().
char* MACH0_() get_filetype_from_hdr | ( | struct MACH0_(mach_header) * | hdr | ) |
Definition at line 3559 of file mach0.c.
References MH_BUNDLE, MH_CORE, MH_DSYM, MH_DYLIB, MH_DYLIB_STUB, MH_DYLINKER, MH_EXECUTE, MH_FILESET, MH_FVMLIB, MH_KEXT_BUNDLE, MH_OBJECT, MH_PRELOAD, and strdup().
Referenced by fill_metadata_info_from_hdr(), and get_filetype().
Definition at line 3146 of file mach0.c.
References bprintf, calloc(), free(), get_name(), i, setup::idx, imports(), MACH0_(), NULL, RZ_BIN_MACH0_STRING_LENGTH, rz_return_val_if_fail, and rz_str_ncpy().
Referenced by imports().
Definition at line 3582 of file mach0.c.
References addr, b, delta, free(), get_entrypoint(), get_symbols(), get_symbols_list(), i, LC_MAIN, MACH0_(), rz_buf_read_at(), ut64(), UT64_MAX, and vaddr_to_paddr().
Referenced by binsym().
Definition at line 2252 of file mach0.c.
References get_maps_unpatched(), MACH0_(), MACH0_VFILE_NAME_PATCHED, MACH0_VFILE_NAME_RELOC_TARGETS, NULL, patch_relocs(), reloc_targets_map_base(), reloc_targets_vfile_size(), and rz_bin_relocs_patch_maps().
Referenced by maps().
Definition at line 2217 of file mach0.c.
References i, MACH0_(), MACH0_VFILE_NAME_REBASED_STRIPPED, map(), NULL, prot2perm(), rz_bin_map_free(), rz_list_append(), rz_list_newf(), RZ_NEW0, rz_return_val_if_fail, rz_str_filter(), rz_str_ndup(), segment_needs_rebasing_and_stripping(), and strdup().
Referenced by get_maps(), and reloc_targets_map_base().
Get a string from the string table referenced by the LC_SYMTAB command.
stridx | the index into the string table, such as n_strx from a nlist symbol entry |
filter | whether to call rz_str_filter() on the string before returning |
Definition at line 2563 of file mach0.c.
References i, len, NULL, rz_str_filter(), and rz_str_ndup().
Referenced by get_imports(), get_operator_code(), get_symbols(), get_symbols_list(), and parse_relocation_info().
Definition at line 2411 of file mach0.c.
References addr, calloc(), i, NULL, prot2perm(), RZ_MIN, rz_return_val_if_fail, rz_str_filter(), rz_strf, S_ZEROFILL, sections(), snprintf, to, and ut64().
Referenced by carve_kexts(), classes(), estimate_slide(), get_prelink_info_range_from_mach0(), get_stubs_info(), parse_categories(), parse_classes(), process_constructors(), process_kmod_init_term(), rebase_info_populate(), resolve_mig_subsystem(), resolve_syscalls(), rz_dyldcache_get_objc_opt_info(), rz_kext_fill_text_range(), rz_rebase_info_new_from_mach0(), sections_from_bin(), and sections_from_mach0().
Definition at line 2267 of file mach0.c.
References __isDataSection(), free(), i, list(), NULL, PFMT64d, prot2perm(), rz_bin_section_free(), rz_bin_section_new(), rz_list_append(), rz_list_newf(), RZ_MIN, RZ_NEW0, rz_str_filter(), rz_str_ndup(), rz_str_newf(), s, S_ZEROFILL, and ut64().
Referenced by sections().
Definition at line 2959 of file mach0.c.
References addr, assign_export_symbol_t(), bits(), bprintf, calloc(), eprintf, free(), from, get_bits_from_hdr(), get_name(), RSymCtx::hash, i, inSymtab(), RSymCtx::j, MACH0_(), N_ARM_THUMB_DEF, N_EXT, N_STAB, NULL, parse_import_stub(), RZ_BIN_MACH0_SYMBOL_TYPE_EXT, RZ_BIN_MACH0_SYMBOL_TYPE_LOCAL, RZ_FREE, RZ_MAX, RZ_MIN, rz_return_val_if_fail, rz_str_newf(), s, ST32_MAX, st64, RSymCtx::symbols, symbols(), RSymCtx::symbols_count, to, vaddr_to_paddr(), and walk_exports().
Referenced by get_main(), symbols(), symbols_from_bin(), and symbols_from_mach0().
Definition at line 2761 of file mach0.c.
References symbol_t::addr, rz_bin_symbol_t::bits, bits(), bprintf, calloc(), eprintf, fill_exports_list(), free(), from, get_bits_from_hdr(), get_name(), i, inSymtab(), symbol_t::is_imported, rz_bin_symbol_t::is_imported, list(), MACH0_(), N_ARM_THUMB_DEF, N_EXT, symbol_t::name, rz_bin_symbol_t::name, NULL, symbol_t::offset, rz_bin_symbol_t::paddr, parse_import_stub(), rz_bin_symbol_free(), rz_list_append(), rz_list_length(), rz_list_newf(), RZ_MAX, RZ_MIN, RZ_NEW0, rz_return_val_if_fail, rz_str_newf(), s, symbols(), to, rz_bin_symbol_t::type, UT64_MAX, rz_bin_symbol_t::vaddr, vaddr_to_paddr(), and walk_exports().
Referenced by get_main().
Definition at line 2162 of file mach0.c.
References rz_bin_virtual_file_t::buf, rz_bin_virtual_file_t::buf_owned, MACH0_(), MACH0_VFILE_NAME_PATCHED, MACH0_VFILE_NAME_REBASED_STRIPPED, MACH0_VFILE_NAME_RELOC_TARGETS, rz_bin_virtual_file_t::name, needs_rebasing_and_stripping(), new_rebasing_and_stripping_buf(), NULL, patch_relocs(), reloc_targets_vfile_size(), rz_bin_virtual_file_free(), rz_buf_free(), rz_buf_new_empty(), rz_list_newf(), rz_list_push(), RZ_NEW0, rz_return_val_if_fail, strdup(), and ut64().
Referenced by virtual_files().
Definition at line 3554 of file mach0.c.
References MH_EXECUTE, and MH_NO_HEAP_EXECUTION.
Referenced by info().
Definition at line 2046 of file mach0.c.
References Eprintf, get_baddr(), init_hdr(), init_items(), and MACH0_().
Definition at line 234 of file mach0.c.
References bprintf, FAT_MAGIC, init_sdb_formats(), len, rz_buf_read_at(), rz_read_be32(), rz_read_ble(), rz_read_le32(), and sdb_num_set().
Referenced by init().
Definition at line 1678 of file mach0.c.
References bprintf, calloc(), load_command::cmd, dylinker_command::cmd, cmd_to_pf_definition(), load_command::cmdsize, dylinker_command::cmdsize, CPU_SUBTYPE_ARM64E, CPU_SUBTYPE_MASK, CPU_TYPE_ARM64, eprintf, free(), i, key, LC_CODE_SIGNATURE, LC_DATA_IN_CODE, LC_DYLD_CHAINED_FIXUPS, LC_DYLD_EXPORTS_TRIE, LC_DYLD_INFO, LC_DYLD_INFO_ONLY, LC_DYLIB_CODE_SIGN_DRS, LC_DYSYMTAB, LC_ENCRYPTION_INFO, LC_ENCRYPTION_INFO_64, LC_FUNCTION_STARTS, LC_LOAD_DYLIB, LC_LOAD_DYLINKER, LC_LOAD_WEAK_DYLIB, LC_MAIN, LC_REEXPORT_DYLIB, LC_RPATH, LC_SEGMENT, LC_SEGMENT_64, LC_SEGMENT_SPLIT_INFO, LC_SOURCE_VERSION, LC_SYMTAB, LC_THREAD, LC_UNIXTHREAD, LC_UUID, LC_VERSION_MIN_IPHONEOS, LC_VERSION_MIN_MACOSX, LC_VERSION_MIN_TVOS, LC_VERSION_MIN_WATCHOS, len, MACH0_(), malloc(), dylinker_command::name, off, paddr_to_vaddr(), parse_chained_fixups(), parse_dylib(), parse_dysymtab(), parse_function_starts(), parse_segments(), parse_signature(), parse_symtab(), parse_thread(), PFMT64x, reconstruct_chained_fixup(), rz_buf_fread_at(), rz_buf_read_at(), RZ_FREE, rz_hex_bin2str(), rz_read_ble16(), rz_read_ble32(), rz_read_ble64(), sdb_fmt(), sdb_num_set(), sdb_set(), snprintf, ut64(), uuid_command::uuid, and val.
Referenced by init().
|
static |
Definition at line 91 of file mach0.c.
References sdb_set().
Referenced by init_hdr().
Definition at line 2545 of file mach0.c.
References addr, found, free(), key, PFMT64x, and rz_str_newf().
Referenced by assign_export_symbol_t(), get_symbols(), and get_symbols_list().
Definition at line 3312 of file mach0.c.
References cpu, CPU_TYPE_POWERPC, and CPU_TYPE_POWERPC64.
Referenced by info(), and rz_debruijn_offset().
struct MACH0_ | ( | mach_header | ) |
Definition at line 3969 of file mach0.c.
References addr, cmd_to_pf_definition(), cmd_to_string(), CPU_TYPE_POWERPC, CPU_TYPE_POWERPC64, eprintf, f, free(), i, LC_BUILD_VERSION, LC_SEGMENT, LC_SEGMENT_64, length, MACH0_(), n, NULL, off, pa2va(), rz_bin_field_free(), rz_bin_field_new(), rz_buf_read_le32_at, rz_buf_size(), rz_list_append(), rz_list_newf(), sdb_fmt(), and ut64().
static struct MACH0_ | ( | obj_t | ) |
Definition at line 2103 of file mach0.c.
References options, and rz_return_if_fail.
Referenced by assign_export_symbol_t(), fill_exports_list(), get_bits(), get_cpusubtype(), get_cputype(), get_entrypoint(), get_filetype(), get_imports(), get_main(), get_maps(), get_maps_unpatched(), get_symbols(), get_symbols_list(), get_virtual_files(), init(), init_items(), MACH0_(), mach_headerfields(), pa2va(), parse_dysymtab(), parse_segments(), and parse_symtab().
Definition at line 2057 of file mach0.c.
References free(), i, NULL, rz_buf_free(), rz_hash_free(), rz_pvector_free(), and rz_skiplist_free().
Referenced by classes(), destroy(), estimate_slide(), rz_dyldcache_get_objc_opt_info(), rz_kernel_cache_free(), rz_kext_free(), sections_from_bin(), and symbols_from_bin().
Definition at line 3969 of file mach0.c.
Definition at line 3633 of file mach0.c.
References addr, build_version_platform_to_string(), build_version_tool_to_string(), cmd_to_pf_definition(), cmd_to_string(), CPU_TYPE_POWERPC, CPU_TYPE_POWERPC64, eprintf, free(), i, LC_BUILD_VERSION, LC_CODE_SIGNATURE, LC_ENCRYPTION_INFO, LC_ENCRYPTION_INFO_64, LC_ID_DYLIB, LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, LC_MAIN, LC_RPATH, LC_SEGMENT, LC_SEGMENT_64, LC_SYMTAB, LC_UUID, length, MACH0_(), n, off, pa2va(), PFMT32x, PFMT64x, printf(), READWORD, rz_buf_get_string(), rz_buf_read8_at(), rz_buf_read_at(), rz_buf_read_le16_at, rz_buf_read_le32_at, rz_buf_size(), rz_read_ble32(), rz_read_ble64(), and ut64().
Definition at line 81 of file mach0.c.
References rz_bin_object_t::bin_obj, rz_io_bind_t::io, rz_bin_t::iob, MACH0_(), rz_bin_file_t::o, paddr_to_vaddr(), rz_bin_file_t::rbin, rz_return_val_if_fail, and rz_io_t::va.
Referenced by MACH0_(), and mach_headerfields().
Definition at line 67 of file mach0.c.
Referenced by assign_export_symbol_t(), fill_exports_list(), init_items(), pa2va(), and parse_relocation_info().
Definition at line 1474 of file mach0.c.
References eprintf, header, i, malloc(), rz_dyld_chained_starts_in_segment::page_count, rz_dyld_chained_starts_in_segment::page_start, rz_buf_fread_at(), rz_buf_read_le32_at, RZ_NEW0, RZ_NEWS0, and ut64().
Referenced by init_items().
Definition at line 1186 of file mach0.c.
References bprintf, dylib_command::cmd, dylib_command::cmdsize, dylib::compatibility_version, dylib::current_version, dylib_command::dylib, len, memset(), dylib::name, off, realloc(), RZ_BIN_MACH0_STRING_LENGTH, rz_buf_read_at(), rz_read_ble32(), and dylib::timestamp.
Referenced by init_items().
Definition at line 519 of file mach0.c.
References bprintf, calloc(), i, len, MACH0_(), off, rz_buf_read_at(), RZ_FREE, rz_read_ble32(), rz_read_ble64(), and UT32_MUL().
Referenced by init_items().
Definition at line 1138 of file mach0.c.
References bprintf, calloc(), linkedit_data_command::cmd, linkedit_data_command::cmdsize, linkedit_data_command::dataoff, linkedit_data_command::datasize, free(), len, NULL, off, rz_buf_read_at(), and rz_read_ble32().
Referenced by init_items().
|
static |
Definition at line 2477 of file mach0.c.
References symbol_t::addr, bprintf, delta, i, setup::idx, int, symbol_t::is_imported, symbol_t::name, NULL, symbol_t::offset, RZ_BIN_MACH0_SYMBOL_TYPE_LOCAL, S_SYMBOL_STUBS, SECTION_TYPE, symbol_t::size, strdup(), symbol_t::type, and ut64().
Referenced by get_symbols(), and get_symbols_list().
Definition at line 277 of file mach0.c.
References bprintf, i, k, len, MACH0_(), memcpy(), off, realloc(), rz_buf_read_at(), rz_read_ble32(), rz_read_ble64(), sdb_fmt(), sdb_num_set(), sdb_set(), UT32_MUL(), and ut64().
Referenced by init_items().
Definition at line 817 of file mach0.c.
References super_blob_t::blob, bprintf, calloc(), super_blob_t::count, CSSLOT_APPLICATION, CSSLOT_CMS_SIGNATURE, CSSLOT_CODEDIRECTORY, CSSLOT_ENTITLEMENTS, CSSLOT_INFOSLOT, CSSLOT_REQUIREMENTS, CSSLOT_RESOURCEDIR, entitlements(), eprintf, free(), header, i, setup::idx, len, blob_t::length, length, link, mach0_endian, blob_t::magic, NULL, off, blob_index_t::offset, p, parseCodeDirectory(), rz_buf_read_at(), rz_buf_size(), RZ_MIN, rz_read_ble32(), rz_str_ndup(), rz_sys_getenv(), sdb_set(), strdup(), blob_index_t::type, UT16_MAX, ut64(), and verbose.
Referenced by init_items().
Definition at line 442 of file mach0.c.
References calloc(), symtab_command::cmd, symtab_command::cmdsize, Eprintf, error(), Error, i, len, MACH0_(), symtab_command::nsyms, NULL, off, rz_buf_read_at(), RZ_FREE, rz_read_ble16(), rz_read_ble32(), rz_read_ble64(), rz_read_ble8(), symtab_command::stroff, symtab_command::strsize, symtab_command::symoff, UT32_MUL(), and ut64().
Referenced by init_items().
|
static |
Definition at line 975 of file mach0.c.
References bprintf, count, CPU_TYPE_ARM, CPU_TYPE_ARM64, CPU_TYPE_I386, CPU_TYPE_POWERPC, CPU_TYPE_POWERPC64, CPU_TYPE_X86_64, i, len, NULL, off, p, pc, r15, rip(), rz_buf_fread_at(), rz_buf_read_at(), rz_offsetof, rz_read_be64(), rz_read_ble32(), sdb_num_set(), autogen_x86imm::tmp, ut64(), UT64_MAX, X86_THREAD_STATE32, and X86_THREAD_STATE64.
Referenced by init_items().
|
static |
Definition at line 676 of file mach0.c.
References b, calloc(), eprintf, flags, free(), i, setup::idx, k, length, NULL, off, p, PFMT64x, READFIELD, READFIELD8, readString(), rz_buf_read_at(), RZ_FREE, rz_hash_cfg_calculate_small_block(), RZ_MIN, ut64(), and version.
Referenced by parse_signature().
Definition at line 2132 of file mach0.c.
Referenced by get_maps_unpatched(), get_sections(), and get_segments().
Definition at line 669 of file mach0.c.
References len, NULL, off, p, and rz_str_ndup().
Referenced by parseCodeDirectory().
Definition at line 1532 of file mach0.c.
References BIND_IMMEDIATE_MASK, BIND_OPCODE_ADD_ADDR_ULEB, BIND_OPCODE_DO_BIND, BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED, BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB, BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB, BIND_OPCODE_DONE, BIND_OPCODE_MASK, BIND_OPCODE_SET_ADDEND_SLEB, BIND_OPCODE_SET_DYLIB_ORDINAL_IMM, BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB, BIND_OPCODE_SET_DYLIB_SPECIAL_IMM, BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB, BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM, BIND_OPCODE_SET_TYPE_IMM, BIND_OPCODE_THREADED, BIND_SUBOPCODE_THREADED_APPLY, BIND_SUBOPCODE_THREADED_SET_BIND_ORDINAL_TABLE_SIZE_ULEB, bprintf, calloc(), count, done, DYLD_CHAINED_PTR_ARM64E, test_evm::end, imm, malloc(), memset(), NULL, opcodes, p, rz_dyld_chained_starts_in_segment::page_count, page_index, rz_dyld_chained_starts_in_segment::page_size, rz_dyld_chained_starts_in_segment::page_start, PFMT64x, rz_dyld_chained_starts_in_segment::pointer_format, rz_buf_read_at(), RZ_FREE, RZ_NEW0, RZ_NEWS0, rz_sleb128(), skip(), and ut64().
Referenced by init_items().
Definition at line 2378 of file mach0.c.
References rz_list_append(), rz_list_new(), S_ATTR_DEBUG, S_ATTR_EXT_RELOC, S_ATTR_LIVE_SUPPORT, S_ATTR_NO_DEAD_STRIP, S_ATTR_NO_TOC, S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SELF_MODIFYING_CODE, S_ATTR_SOME_INSTRUCTIONS, and S_ATTR_STRIP_STATIC_SYMS.
Definition at line 2347 of file mach0.c.
References PFMT64x, rz_str_new(), rz_str_newf(), S_4BYTE_LITERALS, S_COALESCED, S_CSTRING_LITERALS, S_GB_ZEROFILL, S_LAZY_SYMBOL_POINTERS, S_LITERAL_POINTERS, S_MOD_INIT_FUNC_POINTERS, S_MOD_TERM_FUNC_POINTERS, S_NON_LAZY_SYMBOL_POINTERS, S_REGULAR, S_SYMBOL_STUBS, S_ZEROFILL, and type.
Definition at line 53 of file mach0.c.
References addr, i, and ut64().
Referenced by get_entrypoint(), get_main(), get_symbols(), and get_symbols_list().
|
static |
Definition at line 2586 of file mach0.c.
References calloc(), count, test_evm::end, EXPORT_SYMBOL_FLAGS_REEXPORT, EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER, flags, free(), RTrieState::i, RTrieState::label, len, RTrieState::node, NULL, p, root, rz_buf_read_at(), RZ_FREE, rz_list_free(), rz_list_get_top(), rz_list_length(), rz_list_newf(), rz_list_pop(), rz_list_push(), RZ_LOG_ERROR, RZ_NEW0, rz_return_val_if_fail, rz_str_append(), rz_str_newf(), s, SIZE_MAX, states, tr, ut64(), and UT64_MAX.
Referenced by get_symbols(), and get_symbols_list().