Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_types.h>
#include <rz_util.h>
#include <rz_lib.h>
#include <rz_bin.h>
#include <rz_core.h>
#include <rz_io.h>
#include "../format/mach0/dyldcache.h"
#include "objc/mach0_classes.h"
Go to the source code of this file.
Macros | |
#define | RZ_DYLDCACHE_VFILE_NAME_REBASED "rebased" |
Functions | |
static ut64 | bin_obj_va2pa (ut64 p, ut32 *offset, ut32 *left, RzBinFile *bf) |
static struct | MACH0_ (obj_t) |
static bool | check_buffer (RzBuffer *buf) |
static bool | load_buffer (RzBinFile *bf, RzBinObject *obj, RzBuffer *buf, Sdb *sdb) |
static RzList * | entries (RzBinFile *bf) |
static RzBinInfo * | info (RzBinFile *bf) |
static ut64 | baddr (RzBinFile *bf) |
void | symbols_from_bin (RzDyldCache *cache, RzList *ret, RzBinFile *bf, RzDyldBinImage *bin, SetU *hash) |
static bool | __is_data_section (const char *name) |
static void | sections_from_bin (RzList *ret, RzBinFile *bf, RzDyldBinImage *bin) |
static RzList * | virtual_files (RzBinFile *bf) |
static int | prot2perm (int x) |
static RzList * | maps (RzBinFile *bf) |
static RzList * | sections (RzBinFile *bf) |
static RzList * | symbols (RzBinFile *bf) |
static void | destroy (RzBinFile *bf) |
static RzList * | classes (RzBinFile *bf) |
static void | header (RzBinFile *bf) |
Variables | |
RzBinPlugin | rz_bin_plugin_dyldcache |
RZ_API RzLibStruct | rizin_plugin |
#define RZ_DYLDCACHE_VFILE_NAME_REBASED "rebased" |
Definition at line 14 of file bin_dyldcache.c.
Definition at line 172 of file bin_dyldcache.c.
Referenced by sections_from_bin().
Definition at line 128 of file bin_dyldcache.c.
Definition at line 16 of file bin_dyldcache.c.
References rz_bin_object_t::bin_obj, MACH0_(), rz_bin_file_t::o, p, and rz_dyldcache_va2pa().
Definition at line 58 of file bin_dyldcache.c.
References rz_buf_read_at(), rz_buf_size(), and rz_dyldcache_check_magic().
Definition at line 365 of file bin_dyldcache.c.
References addr, rz_bin_object_t::bin_obj, rz_dyldcache_t::bins, rz_bin_file_t::buf, rz_bin_class_t::fields, free(), get_category_t(), get_class_t(), get_sections(), i, if(), MACH0_(), mach0_free(), malloc(), rz_bin_class_t::methods, rz_bin_class_t::name, NULL, rz_bin_file_t::o, rz_dyldcache_t::objc_opt_info_loaded, rz_dyldcache_t::oi, rz_buf_free(), rz_buf_read_at(), rz_dyldcache_get_objc_opt_info(), rz_dyldcache_needs_rebasing(), rz_dyldcache_new_rebasing_buf(), rz_dyldcache_va2pa(), RZ_FREE, rz_list_append(), rz_list_free(), rz_list_new(), rz_list_newf(), RZ_LOG_ERROR, RZ_NEW0, rz_read_le64(), rz_str_newf(), sections(), and ut64().
|
static |
Definition at line 360 of file bin_dyldcache.c.
References rz_bin_object_t::bin_obj, rz_bin_file_t::o, and rz_dyldcache_free().
Definition at line 81 of file bin_dyldcache.c.
References free(), NULL, rz_list_append(), rz_list_newf(), and RZ_NEW0.
|
static |
Definition at line 491 of file bin_dyldcache.c.
References rz_dyldcache_t::accel, cache_hdr_t::accelerateInfoAddr, cache_hdr_t::accelerateInfoSize, rz_dyld_rebase_info_3_t::auth_value_add, rz_bin_object_t::bin_obj, cache_accel_t::bottomUpListOffset, cache_hdr_t::branchPoolsCount, cache_hdr_t::branchPoolsOffset, rz_dyldcache_t::buf, cache_hdr_t::cacheType, cache_hdr_t::codeSignatureOffset, cache_hdr_t::codeSignatureSize, rz_dyld_rebase_info_2_t::delta_mask, rz_dyld_rebase_info_2_t::delta_shift, cache_accel_t::depListCount, cache_accel_t::depListOffset, cache_accel_t::dofSectionsCount, cache_accel_t::dofSectionsOffset, cache_hdr_t::dyldBaseAddress, cache_accel_t::dyldSectionAddr, cache_accel_t::dylibTrieOffset, cache_accel_t::dylibTrieSize, rz_dyld_rebase_infos_entry_t::end, rz_dyld_rebase_infos_t::entries, rz_dyld_rebase_info_1_t::entries_size, free(), rz_dyldcache_t::hdr, i, if(), cache_accel_t::imageExtrasCount, cache_hdr_t::imagesCount, cache_accel_t::imagesExtrasOffset, cache_hdr_t::imagesOffset, cache_hdr_t::imagesTextCount, cache_hdr_t::imagesTextOffset, rz_dyld_rebase_infos_entry_t::info, cache_accel_t::initializersCount, cache_accel_t::initializersOffset, rz_dyld_rebase_infos_t::length, cache_text_info_t::loadAddress, cache_hdr_t::localSymbolsOffset, cache_hdr_t::localSymbolsSize, cache_hdr_t::magic, malloc(), cache_hdr_t::mappingCount, cache_hdr_t::mappingOffset, rz_bin_file_t::o, p, rz_dyld_rebase_info_2_t::page_extras_count, rz_dyld_rebase_info_3_t::page_size, rz_dyld_rebase_info_2_t::page_size, rz_dyld_rebase_info_3_t::page_starts_count, rz_dyld_rebase_info_2_t::page_starts_count, cache_text_info_t::pathOffset, pj_a(), pj_end(), pj_free(), pj_k(), pj_kn(), pj_ks(), pj_new(), pj_o(), pj_string(), cache_accel_t::rangeTableCount, cache_accel_t::rangeTableOffset, rz_bin_file_t::rbin, rz_dyldcache_t::rebase_infos, cache_accel_t::reExportCount, cache_accel_t::reExportListOffset, rz_buf_fread_at(), rz_buf_read_at(), rz_dyldcache_get_slide(), rz_hex_bin2str(), cache_hdr_t::slideInfoOffset, cache_hdr_t::slideInfoSize, rz_dyld_rebase_infos_entry_t::start, cache_text_info_t::textSegmentSize, rz_dyld_rebase_info_1_t::toc_count, ut64(), cache_hdr_t::uuid, cache_text_info_t::uuid, rz_dyld_rebase_info_2_t::value_add, rz_dyld_rebase_info_2_t::value_mask, rz_dyld_rebase_info_t::version, and cache_accel_t::version.
Definition at line 93 of file bin_dyldcache.c.
References rz_bin_info_t::arch, rz_bin_info_t::bclass, rz_bin_info_t::big_endian, rz_bin_object_t::bin_obj, rz_bin_info_t::bits, rz_bin_info_t::dbg_info, rz_bin_info_t::file, rz_bin_file_t::file, rz_bin_info_t::has_va, rz_dyldcache_t::hdr, if(), rz_bin_info_t::machine, cache_hdr_t::magic, NULL, rz_bin_file_t::o, rz_bin_info_t::os, RZ_NEW0, strdup(), rz_bin_info_t::subsystem, and rz_bin_info_t::type.
|
static |
Definition at line 72 of file bin_dyldcache.c.
References rz_bin_object_t::bin_obj, and rz_dyldcache_new_buf().
|
static |
Definition at line 16 of file bin_dyldcache.c.
Referenced by bin_obj_va2pa(), classes(), sections_from_bin(), and symbols_from_bin().
Definition at line 271 of file bin_dyldcache.c.
References cache_map_t::address, rz_bin_object_t::bin_obj, cache_map_t::fileOffset, i, if(), cache_map_t::initProt, map(), rz_dyldcache_t::maps, rz_dyldcache_t::n_maps, NULL, rz_bin_file_t::o, prot2perm(), rz_bin_map_free(), rz_dyldcache_get_slide(), rz_dyldcache_range_needs_rebasing(), RZ_DYLDCACHE_VFILE_NAME_REBASED, rz_list_append(), rz_list_free(), rz_list_newf(), RZ_NEW0, rz_str_newf(), cache_map_t::size, strdup(), and ut64().
Definition at line 301 of file bin_dyldcache.c.
References rz_bin_object_t::bin_obj, rz_dyldcache_t::bins, if(), NULL, rz_bin_file_t::o, rz_bin_section_free(), rz_dyldcache_get_slide(), rz_list_newf(), sections_from_bin(), and ut64().
Referenced by classes(), and sections_from_bin().
|
static |
Definition at line 191 of file bin_dyldcache.c.
References __is_data_section(), addr, rz_bin_object_t::bin_obj, rz_bin_section_t::format, free(), get_sections(), i, if(), rz_bin_section_t::is_data, len, MACH0_(), mach0_free(), rz_bin_section_t::name, NULL, rz_bin_file_t::o, rz_bin_section_t::paddr, rz_bin_section_t::perm, rz_dyldcache_va2pa(), rz_list_append(), RZ_NEW0, rz_str_newf(), sections(), rz_bin_section_t::size, rz_bin_section_t::vaddr, and rz_bin_section_t::vsize.
Referenced by sections().
Definition at line 325 of file bin_dyldcache.c.
References rz_bin_object_t::bin_obj, rz_dyldcache_t::bins, if(), NULL, rz_bin_file_t::o, rz_bin_symbol_free(), rz_dyldcache_get_slide(), rz_dyldcache_symbols_from_locsym(), rz_list_free(), rz_list_newf(), set_u_free(), set_u_new(), symbols_from_bin(), ut64(), and rz_bin_symbol_t::vaddr.
Referenced by symbols_from_bin().
void symbols_from_bin | ( | RzDyldCache * | cache, |
RzList * | ret, | ||
RzBinFile * | bf, | ||
RzDyldBinImage * | bin, | ||
SetU * | hash | ||
) |
Definition at line 133 of file bin_dyldcache.c.
References addr, rz_bin_symbol_t::bind, rz_bin_object_t::boffset, rz_bin_symbol_t::forwarder, get_symbols(), i, MACH0_(), mach0_free(), rz_bin_symbol_t::name, rz_bin_file_t::o, rz_bin_symbol_t::ordinal, rz_bin_symbol_t::paddr, RZ_BIN_BIND_GLOBAL_STR, RZ_BIN_BIND_LOCAL_STR, RZ_BIN_MACH0_SYMBOL_TYPE_LOCAL, RZ_BIN_TYPE_FUNC_STR, rz_list_append(), RZ_NEW0, set_u_add(), rz_bin_symbol_t::size, strdup(), symbols(), rz_bin_symbol_t::type, and rz_bin_symbol_t::vaddr.
Referenced by symbols().
Definition at line 238 of file bin_dyldcache.c.
References rz_bin_object_t::bin_obj, rz_bin_virtual_file_t::buf, rz_bin_virtual_file_t::buf_owned, if(), rz_bin_virtual_file_t::name, NULL, rz_bin_file_t::o, rz_bin_virtual_file_free(), rz_dyldcache_needs_rebasing(), rz_dyldcache_new_rebasing_buf(), RZ_DYLDCACHE_VFILE_NAME_REBASED, rz_list_newf(), rz_list_push(), RZ_NEW0, and strdup().
RZ_API RzLibStruct rizin_plugin |
Definition at line 662 of file bin_dyldcache.c.
RzBinPlugin rz_bin_plugin_dyldcache |
Definition at line 643 of file bin_dyldcache.c.