Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Macros | |
#define | CMP_CHECK(member) |
Functions | |
RZ_API void | rz_bin_string_decode_base64 (RZ_NONNULL RzBinString *bstr) |
Tries to decode the base64 string hold by RzBinString and overwrites it. More... | |
static void | bin_object_decode_all_base64_strings (RzList *strings) |
RZ_API void | rz_bin_mem_free (void *data) |
RZ_API ut64 | rz_bin_reloc_size (RzBinReloc *reloc) |
size of the reloc (where it is supposed to be patched) in bits More... | |
static int | reloc_cmp (const void *a, const void *b) |
static int | reloc_target_cmp (const void *a, const void *b) |
RZ_API RzBinRelocStorage * | rz_bin_reloc_storage_new (RZ_OWN RzList *relocs) |
RZ_API void | rz_bin_reloc_storage_free (RzBinRelocStorage *storage) |
static int | reloc_vaddr_cmp (ut64 ref, RzBinReloc *reloc) |
RZ_API RzBinReloc * | rz_bin_reloc_storage_get_reloc_in (RzBinRelocStorage *storage, ut64 vaddr, ut64 size) |
Get the reloc with the lowest vaddr that starts inside the given interval. More... | |
static int | reloc_target_vaddr_cmp (ut64 ref, RzBinReloc *reloc) |
RZ_API RzBinReloc * | rz_bin_reloc_storage_get_reloc_to (RzBinRelocStorage *storage, ut64 vaddr) |
Get a reloc that points exactly to vaddr or NULL. More... | |
RZ_IPI void | rz_bin_object_free (RzBinObject *o) |
static char * | swiftField (const char *dn, const char *cn) |
static RzList * | classes_from_symbols (RzBinFile *bf) |
RZ_IPI RzBinObject * | rz_bin_object_new (RzBinFile *bf, RzBinPlugin *plugin, RzBinObjectLoadOptions *opts, ut64 offset, ut64 sz) |
static void | filter_classes (RzBinFile *bf, RzList *list) |
static void | rz_bin_object_rebuild_classes_ht (RzBinObject *o) |
RZ_API int | rz_bin_object_set_items (RzBinFile *bf, RzBinObject *o) |
RZ_API RzBinRelocStorage * | rz_bin_object_patch_relocs (RzBinFile *bf, RzBinObject *o) |
RZ_API RzBinSymbol * | rz_bin_object_get_symbol_of_import (RzBinObject *o, RzBinImport *imp) |
Find the symbol that represents the given import This is necessary for example to determine the address of an import. More... | |
RZ_API RzBinVirtualFile * | rz_bin_object_get_virtual_file (RzBinObject *o, const char *name) |
RZ_IPI RzBinObject * | rz_bin_object_get_cur (RzBin *bin) |
RZ_IPI RzBinObject * | rz_bin_object_find_by_arch_bits (RzBinFile *bf, const char *arch, int bits, const char *name) |
RZ_API ut64 | rz_bin_object_addr_with_base (RzBinObject *o, ut64 addr) |
Put the given address on top of o's base address. More... | |
RZ_API ut64 | rz_bin_object_get_vaddr (RzBinObject *o, ut64 paddr, ut64 vaddr) |
RZ_API const RzBinAddr * | rz_bin_object_get_special_symbol (RzBinObject *o, RzBinSpecialSymbol sym) |
Return the RzBinAddr structure representing the special symbol sym . More... | |
RZ_API const RzList * | rz_bin_object_get_entries (RZ_NONNULL RzBinObject *obj) |
Get list of RzBinAddr representing the entry points of the binary object. More... | |
RZ_API const RzList * | rz_bin_object_get_fields (RZ_NONNULL RzBinObject *obj) |
Get list of RzBinField representing the fields of the binary object. More... | |
RZ_API const RzList * | rz_bin_object_get_imports (RZ_NONNULL RzBinObject *obj) |
Get list of RzBinImport representing the imports of the binary object. More... | |
RZ_API const RzBinInfo * | rz_bin_object_get_info (RZ_NONNULL RzBinObject *obj) |
Get the RzBinInfo of the binary object. More... | |
RZ_API const RzList * | rz_bin_object_get_libs (RZ_NONNULL RzBinObject *obj) |
Get list of char* representing the libraries used by the binary object. More... | |
RZ_API const RzList * | rz_bin_object_get_sections_all (RZ_NONNULL RzBinObject *obj) |
Get list of RzBinSection representing both the sections and the segments of the binary object. More... | |
static RzList * | get_sections_or_segment (RzBinObject *obj, bool is_segment) |
RZ_API RZ_OWN RzList * | rz_bin_object_get_sections (RZ_NONNULL RzBinObject *obj) |
Get list of RzBinSection representing only the sections of the binary object. More... | |
RZ_API RZ_OWN RzList * | rz_bin_object_get_segments (RZ_NONNULL RzBinObject *obj) |
Get list of RzBinSection representing only the segments of the binary object. More... | |
RZ_API const RzList * | rz_bin_object_get_classes (RZ_NONNULL RzBinObject *obj) |
Get list of RzBinClass representing the classes (e.g. C++ classes) defined in the binary object. More... | |
RZ_API const RzList * | rz_bin_object_get_strings (RZ_NONNULL RzBinObject *obj) |
Get list of RzBinString representing the strings identified in the binary object. More... | |
RZ_API const RzList * | rz_bin_object_get_mem (RZ_NONNULL RzBinObject *obj) |
Get list of RzBinMem representing the memory regions identified in the binary object. More... | |
RZ_API const RzList * | rz_bin_object_get_symbols (RZ_NONNULL RzBinObject *obj) |
Get list of RzBinSymbol representing the symbols in the binary object. More... | |
RZ_API const RzList * | rz_bin_object_get_resources (RZ_NONNULL RzBinObject *obj) |
Get a list of RzBinResource representing the resources in the binary object. More... | |
RZ_API bool | rz_bin_object_reset_strings (RZ_NONNULL RzBin *bin, RZ_NONNULL RzBinFile *bf, RZ_NONNULL RzBinObject *obj) |
Remove all previously identified strings in the binary object and scan it again for strings. More... | |
RZ_API RZ_BORROW RzBinString * | rz_bin_object_get_string_at (RZ_NONNULL RzBinObject *obj, ut64 address, bool is_va) |
Return RzBinString if at address there is an entry in the RzBinObject string database. More... | |
RZ_API bool | rz_bin_object_is_big_endian (RZ_NONNULL RzBinObject *obj) |
Return true if the binary object obj is big endian. More... | |
RZ_API bool | rz_bin_object_is_static (RZ_NONNULL RzBinObject *obj) |
Return true if the binary object obj is detected as statically compiled. More... | |
static void | bin_section_map_fini (void *e, void *user) |
RZ_API RZ_OWN RzVector * | rz_bin_object_sections_mapping_list (RZ_NONNULL RzBinObject *obj) |
Get the mapping between segments and sections in the binary. More... | |
static ut64 | map_p2v (RzBinMap *m, ut64 paddr) |
RZ_API ut64 | rz_bin_object_p2v (RZ_NONNULL RzBinObject *obj, ut64 paddr) |
Convert offset in the file to virtual address according to binary mappings. More... | |
RZ_API RzVector * | rz_bin_object_p2v_all (RZ_NONNULL RzBinObject *obj, ut64 paddr) |
Convert offset in the file to all possible virtual addresses according to binary mappings. More... | |
RZ_API ut64 | rz_bin_object_v2p (RZ_NONNULL RzBinObject *obj, ut64 vaddr) |
Convert virtual address to offset in the file according to binary mappings. More... | |
RZ_API RZ_OWN RzBinStrDb * | rz_bin_string_database_new (RZ_NULLABLE RZ_OWN RzList *list) |
Allocates and initializes the RzBinStrDb structure with the given list of strings. More... | |
RZ_API void | rz_bin_string_database_free (RZ_NULLABLE RzBinStrDb *db) |
Frees a RzBinStrDb structure. More... | |
RZ_API bool | rz_bin_string_database_add (RZ_NONNULL RzBinStrDb *db, RZ_NONNULL RzBinString *bstr) |
{ function_description } More... | |
RZ_API bool | rz_bin_string_database_remove (RZ_NONNULL RzBinStrDb *db, ut64 address, bool is_va) |
Return true if the given address has been removed to the RzBinObject string database. More... | |
#define CMP_CHECK | ( | member | ) |
|
static |
Definition at line 39 of file bobj.c.
References rz_bin_string_decode_base64(), rz_return_if_fail, and strings().
Referenced by rz_bin_object_reset_strings(), and rz_bin_object_set_items().
|
static |
Definition at line 891 of file bobj.c.
References e, rz_pvector_fini(), and rz_bin_section_map_t::sections.
Referenced by rz_bin_object_sections_mapping_list().
Definition at line 243 of file bobj.c.
References c, rz_bin_object_t::classes, rz_bin_symbol_t::classname, rz_bin_symbol_t::dname, f, fn, free(), rz_bin_symbol_t::name, NULL, rz_bin_file_t::o, rz_bin_symbol_t::paddr, rz_bin_field_new(), rz_bin_file_add_class(), rz_list_append(), rz_bin_symbol_t::size, swiftField(), rz_bin_object_t::symbols, and rz_bin_symbol_t::vaddr.
Referenced by rz_bin_object_set_items().
Definition at line 337 of file bobj.c.
References cls(), free(), list(), malloc(), rz_bin_symbol_t::name, p, rz_bin_filter_name(), rz_bin_filter_sym(), RZ_LOG_ERROR, and rz_bin_symbol_t::vaddr.
Referenced by rz_bin_object_set_items().
|
static |
Definition at line 755 of file bobj.c.
References test_group_name::all, rz_bin_section_t::is_segment, NULL, rz_bin_object_get_sections_all(), rz_list_append(), and rz_list_new().
Referenced by rz_bin_object_get_sections(), and rz_bin_object_get_segments().
Definition at line 955 of file bobj.c.
References delta, regress::m, ut64(), and UT64_MAX.
Referenced by rz_bin_object_p2v(), and rz_bin_object_p2v_all().
Definition at line 83 of file bobj.c.
References a, ar, b, br, CMP_CHECK, and type.
Referenced by rz_bin_reloc_storage_new().
|
static |
Definition at line 168 of file bobj.c.
References RZ_NUM_CMP, and rz_bin_reloc_t::target_vaddr.
Referenced by rz_bin_reloc_storage_get_reloc_to().
|
static |
Definition at line 149 of file bobj.c.
References RZ_NUM_CMP, and rz_bin_reloc_t::vaddr.
Referenced by rz_bin_reloc_storage_get_reloc_in().
RZ_API void rz_bin_mem_free | ( | void * | data | ) |
Definition at line 49 of file bobj.c.
References free(), mem, NULL, and rz_list_free().
Referenced by mem().
RZ_API ut64 rz_bin_object_addr_with_base | ( | RzBinObject * | o, |
ut64 | addr | ||
) |
Put the given address on top of o's base address.
Definition at line 661 of file bobj.c.
References addr, and rz_bin_object_t::baddr_shift.
Referenced by rz_bin_get_section_at(), rz_bin_object_get_map_at(), rz_bin_object_get_maps_at(), rz_bin_object_get_vaddr(), rz_core_bin_apply_main(), and rz_core_bin_main_print().
RZ_IPI RzBinObject* rz_bin_object_find_by_arch_bits | ( | RzBinFile * | bf, |
const char * | arch, | ||
int | bits, | ||
const char * | name | ||
) |
Definition at line 644 of file bobj.c.
References rz_bin_info_t::arch, arch, rz_bin_info_t::bits, bits(), rz_bin_info_t::file, info(), rz_bin_object_t::info, NULL, rz_bin_file_t::o, and rz_return_val_if_fail.
Referenced by rz_bin_select(), rz_bin_select_object(), and rz_bin_use_arch().
RZ_IPI void rz_bin_object_free | ( | RzBinObject * | o | ) |
Definition at line 188 of file bobj.c.
References rz_bin_object_t::addrzklassmethod, rz_bin_object_t::binsym, rz_bin_object_t::classes, rz_bin_object_t::classes_ht, rz_bin_object_t::entries, rz_bin_object_t::fields, free(), i, rz_bin_object_t::import_name_symbols, rz_bin_object_t::imports, rz_bin_object_t::info, rz_bin_object_t::libs, rz_bin_object_t::lines, rz_bin_object_t::maps, rz_bin_object_t::mem, rz_bin_object_t::methods_ht, rz_bin_object_t::regstate, rz_bin_object_t::relocs, rz_bin_info_free(), rz_bin_reloc_storage_free(), rz_bin_source_line_info_free(), RZ_BIN_SPECIAL_SYMBOL_LAST, rz_bin_string_database_free(), rz_list_free(), rz_bin_object_t::sections, rz_bin_object_t::strings, rz_bin_object_t::symbols, and rz_bin_object_t::vfiles.
Referenced by rz_bin_file_free(), and rz_bin_object_new().
RZ_API const RzList* rz_bin_object_get_classes | ( | RZ_NONNULL RzBinObject * | obj | ) |
Get list of RzBinClass
representing the classes (e.g. C++ classes) defined in the binary object.
Definition at line 790 of file bobj.c.
References NULL, and rz_return_val_if_fail.
Referenced by rz_core_bin_class_as_source_print(), rz_core_bin_class_fields_print(), rz_core_bin_class_methods_print(), and rz_core_bin_classes_print().
RZ_IPI RzBinObject* rz_bin_object_get_cur | ( | RzBin * | bin | ) |
Definition at line 639 of file bobj.c.
References NULL, and rz_return_val_if_fail.
RZ_API const RzList* rz_bin_object_get_entries | ( | RZ_NONNULL RzBinObject * | obj | ) |
Get list of RzBinAddr
representing the entry points of the binary object.
Definition at line 710 of file bobj.c.
References NULL, and rz_return_val_if_fail.
Referenced by entries_initfini_print(), and rz_bin_get_entries().
RZ_API const RzList* rz_bin_object_get_fields | ( | RZ_NONNULL RzBinObject * | obj | ) |
Get list of RzBinField
representing the fields of the binary object.
Definition at line 718 of file bobj.c.
References NULL, and rz_return_val_if_fail.
Referenced by rz_bin_get_fields(), and rz_core_bin_fields_print().
RZ_API const RzList* rz_bin_object_get_imports | ( | RZ_NONNULL RzBinObject * | obj | ) |
Get list of RzBinImport
representing the imports of the binary object.
Definition at line 726 of file bobj.c.
References NULL, and rz_return_val_if_fail.
Referenced by rz_bin_get_imports(), rz_core_bin_imports_print(), and rzfind_open_file().
RZ_API const RzBinInfo* rz_bin_object_get_info | ( | RZ_NONNULL RzBinObject * | obj | ) |
Get the RzBinInfo
of the binary object.
Definition at line 734 of file bobj.c.
References NULL, and rz_return_val_if_fail.
Referenced by rz_bin_get_info().
RZ_API const RzList* rz_bin_object_get_libs | ( | RZ_NONNULL RzBinObject * | obj | ) |
Get list of char*
representing the libraries used by the binary object.
Definition at line 742 of file bobj.c.
References NULL, and rz_return_val_if_fail.
Referenced by rz_bin_get_libs(), and rz_core_bin_libs_print().
RZ_API const RzList* rz_bin_object_get_mem | ( | RZ_NONNULL RzBinObject * | obj | ) |
Get list of RzBinMem
representing the memory regions identified in the binary object.
Definition at line 809 of file bobj.c.
References NULL, and rz_return_val_if_fail.
Referenced by rz_bin_get_mem(), and rz_core_bin_memory_print().
RZ_API const RzList* rz_bin_object_get_resources | ( | RZ_NONNULL RzBinObject * | obj | ) |
Get a list of RzBinResource
representing the resources in the binary object.
Definition at line 825 of file bobj.c.
References NULL, and rz_return_val_if_fail.
Referenced by rz_core_bin_resources_print().
RZ_API RZ_OWN RzList* rz_bin_object_get_sections | ( | RZ_NONNULL RzBinObject * | obj | ) |
Get list of RzBinSection
representing only the sections of the binary object.
Definition at line 774 of file bobj.c.
References get_sections_or_segment(), NULL, and rz_return_val_if_fail.
Referenced by rz_bin_file_golang_compiler(), rz_cmd_info_section_bars_handler(), and rz_core_bin_sections_print().
RZ_API const RzList* rz_bin_object_get_sections_all | ( | RZ_NONNULL RzBinObject * | obj | ) |
Get list of RzBinSection
representing both the sections and the segments of the binary object.
Definition at line 750 of file bobj.c.
References NULL, and rz_return_val_if_fail.
Referenced by get_sections_or_segment(), rz_bin_get_sections(), and rz_bin_object_sections_mapping_list().
RZ_API RZ_OWN RzList* rz_bin_object_get_segments | ( | RZ_NONNULL RzBinObject * | obj | ) |
Get list of RzBinSection
representing only the segments of the binary object.
Definition at line 782 of file bobj.c.
References get_sections_or_segment(), NULL, and rz_return_val_if_fail.
Referenced by rz_core_bin_segments_print().
RZ_API const RzBinAddr* rz_bin_object_get_special_symbol | ( | RzBinObject * | o, |
RzBinSpecialSymbol | sym | ||
) |
Return the RzBinAddr
structure representing the special symbol sym
.
Definition at line 699 of file bobj.c.
References rz_bin_object_t::binsym, NULL, RZ_BIN_SPECIAL_SYMBOL_LAST, and rz_return_val_if_fail.
Referenced by rz_core_analysis_all(), rz_core_bin_apply_main(), and rz_core_bin_main_print().
RZ_API RZ_BORROW RzBinString* rz_bin_object_get_string_at | ( | RZ_NONNULL RzBinObject * | obj, |
ut64 | address, | ||
bool | is_va | ||
) |
Return RzBinString if at address
there
is an entry in the RzBinObject string database.
Definition at line 861 of file bobj.c.
References NULL, and rz_return_val_if_fail.
Referenced by add_new_bin_string(), and rz_analysis_set_stringrefs().
RZ_API const RzList* rz_bin_object_get_strings | ( | RZ_NONNULL RzBinObject * | obj | ) |
Get list of RzBinString
representing the strings identified in the binary object.
Definition at line 798 of file bobj.c.
References NULL, and rz_return_val_if_fail.
Referenced by add_new_bin_string(), rz_bin_get_strings(), rz_core_bin_strings_print(), and rz_diff_strings_new().
RZ_API RzBinSymbol* rz_bin_object_get_symbol_of_import | ( | RzBinObject * | o, |
RzBinImport * | imp | ||
) |
Find the symbol that represents the given import This is necessary for example to determine the address of an import.
Definition at line 616 of file bobj.c.
References rz_bin_object_t::import_name_symbols, rz_bin_import_t::name, NULL, and rz_return_val_if_fail.
Referenced by rz_core_analysis_importxrefs(), rz_core_bin_apply_imports(), and rz_core_bin_imports_print().
RZ_API const RzList* rz_bin_object_get_symbols | ( | RZ_NONNULL RzBinObject * | obj | ) |
Get list of RzBinSymbol
representing the symbols in the binary object.
Definition at line 817 of file bobj.c.
References NULL, and rz_return_val_if_fail.
Referenced by rz_analyze_symbols_entries_handler(), rz_bin_file_get_symbols(), rz_bin_get_symbols(), rzfind_open_file(), and symbols_print().
RZ_API ut64 rz_bin_object_get_vaddr | ( | RzBinObject * | o, |
ut64 | paddr, | ||
ut64 | vaddr | ||
) |
Definition at line 669 of file bobj.c.
References rz_bin_info_t::arch, rz_bin_info_t::bits, rz_bin_info_t::has_va, rz_bin_object_t::info, rz_bin_get_section_at(), rz_bin_object_addr_with_base(), RZ_PERM_X, rz_return_val_if_fail, s, and UT64_MAX.
Referenced by print_bin_string(), print_string(), rva(), rz_core_analysis_all(), and rz_core_analysis_importxrefs().
RZ_API RzBinVirtualFile* rz_bin_object_get_virtual_file | ( | RzBinObject * | o, |
const char * | name | ||
) |
Definition at line 624 of file bobj.c.
References rz_bin_virtual_file_t::name, NULL, rz_return_val_if_fail, and rz_bin_object_t::vfiles.
RZ_API bool rz_bin_object_is_big_endian | ( | RZ_NONNULL RzBinObject * | obj | ) |
Return true if the binary object obj
is big endian.
Definition at line 875 of file bobj.c.
References rz_return_val_if_fail.
RZ_API bool rz_bin_object_is_static | ( | RZ_NONNULL RzBinObject * | obj | ) |
Return true if the binary object obj
is detected as statically compiled.
Definition at line 883 of file bobj.c.
References RZ_BIN_DBG_STATIC, rz_list_length(), and rz_return_val_if_fail.
Referenced by rz_bin_is_static().
RZ_IPI RzBinObject* rz_bin_object_new | ( | RzBinFile * | bf, |
RzBinPlugin * | plugin, | ||
RzBinObjectLoadOptions * | opts, | ||
ut64 | offset, | ||
ut64 | sz | ||
) |
Definition at line 278 of file bobj.c.
References rz_bin_object_t::baddr_shift, rz_bin_file_load_options_t::baseaddr, rz_bin_object_t::boffset, rz_bin_file_t::buf, rz_bin_object_t::classes, rz_bin_object_t::classes_ht, rz_bin_file_t::fd, free(), rz_bin_object_t::kv, rz_bin_plugin_t::load_buffer, rz_bin_file_load_options_t::loadaddr, rz_bin_object_t::methods_ht, rz_bin_plugin_t::name, NULL, rz_bin_object_t::obj_size, rz_bin_object_t::opts, rz_bin_object_t::plugin, rz_bin_file_t::rbin, sdb_t::refs, rz_bin_object_t::regstate, rz_bin_class_free(), rz_bin_file_set_obj(), rz_bin_object_free(), rz_bin_object_set_items(), rz_bin_set_baddr(), rz_buf_size(), rz_list_newf(), RZ_LOG_ERROR, RZ_LOG_WARN, RZ_NEW0, rz_return_val_if_fail, rz_str_newf(), rz_bin_file_t::sdb, rz_bin_t::sdb, sdb_ns_set(), ut64(), UT64_MAX, and rz_bin_t::verbose.
Referenced by rz_bin_file_new_from_buffer(), and rz_bin_file_object_new_from_xtr_data().
RZ_API ut64 rz_bin_object_p2v | ( | RZ_NONNULL RzBinObject * | obj, |
ut64 | paddr | ||
) |
Convert offset in the file to virtual address according to binary mappings.
obj | Reference to RzBinObject |
paddr | Offset in the file |
Definition at line 970 of file bobj.c.
References regress::m, map_p2v(), rz_bin_object_get_map_at(), rz_return_val_if_fail, and UT64_MAX.
Referenced by search_string_thread_runner().
RZ_API RzVector* rz_bin_object_p2v_all | ( | RZ_NONNULL RzBinObject * | obj, |
ut64 | paddr | ||
) |
Convert offset in the file to all possible virtual addresses according to binary mappings.
obj | Reference to RzBinObject |
paddr | Offset in the file |
ut64
values of all possible virtual addresses Definition at line 987 of file bobj.c.
References map(), map_p2v(), maps(), NULL, rz_bin_object_get_maps_at(), rz_pvector_foreach, rz_pvector_free(), rz_return_val_if_fail, rz_vector_new(), rz_vector_push(), ut64(), and UT64_MAX.
RZ_API RzBinRelocStorage* rz_bin_object_patch_relocs | ( | RzBinFile * | bf, |
RzBinObject * | o | ||
) |
Definition at line 590 of file bobj.c.
References rz_bin_t::is_reloc_patched, NULL, rz_bin_plugin_t::patch_relocs, rz_bin_object_t::plugin, rz_bin_file_t::rbin, REBASE_PADDR, rz_bin_object_t::relocs, rz_bin_reloc_storage_free(), rz_bin_reloc_storage_new(), rz_return_val_if_fail, and autogen_x86imm::tmp.
Referenced by rz_core_bin_apply_relocs(), and rz_core_bin_relocs_print().
|
static |
Definition at line 371 of file bobj.c.
References rz_bin_object_t::classes, rz_bin_object_t::classes_ht, rz_bin_class_t::methods, rz_bin_object_t::methods_ht, rz_bin_class_t::name, rz_bin_symbol_t::name, and sdb_fmt().
Referenced by rz_bin_object_set_items().
RZ_API bool rz_bin_object_reset_strings | ( | RZ_NONNULL RzBin * | bin, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzBinObject * | obj | ||
) |
Remove all previously identified strings in the binary object and scan it again for strings.
Definition at line 833 of file bobj.c.
References bin_object_decode_all_base64_strings(), NULL, REBASE_PADDR, rz_bin_file_strings(), rz_bin_string_database_free(), rz_bin_string_database_new(), RZ_FREE_CUSTOM, rz_return_val_if_fail, strings(), and rz_bin_plugin_t::strings.
Referenced by cb_binmaxstr(), cb_binmaxstrbuf(), cb_binminstr(), and cb_binstrenc().
RZ_API RZ_OWN RzVector* rz_bin_object_sections_mapping_list | ( | RZ_NONNULL RzBinObject * | obj | ) |
Get the mapping between segments and sections in the binary.
Definition at line 902 of file bobj.c.
References test_group_name::all, bin_section_map_fini(), err, list(), map(), NULL, rz_bin_object_get_sections_all(), rz_itv_begin(), rz_itv_end(), rz_list_append(), rz_list_free(), rz_list_length(), rz_list_new(), rz_pvector_init(), rz_pvector_push(), rz_return_val_if_fail, rz_vector_new(), rz_vector_push(), rz_vector_reserve(), sections(), rz_bin_section_t::size, UT64_MAX, and rz_bin_section_t::vaddr.
Referenced by rz_core_bin_sections_mapping_print().
RZ_API int rz_bin_object_set_items | ( | RzBinFile * | bf, |
RzBinObject * | o | ||
) |
Definition at line 392 of file bobj.c.
References rz_bin_object_t::addrzklassmethod, bin_object_decode_all_base64_strings(), rz_bin_object_t::binsym, rz_bin_object_t::boffset, classes(), rz_bin_object_t::classes, classes_from_symbols(), rz_bin_info_t::compiler, rz_bin_object_t::entries, rz_bin_object_t::fields, filter_classes(), rz_list_t::free, free(), i, if(), rz_bin_object_t::import_name_symbols, rz_bin_object_t::imports, rz_bin_object_t::info, rz_bin_symbol_t::is_imported, rz_bin_object_t::kv, rz_bin_info_t::lang, rz_bin_object_t::lang, rz_bin_object_t::libs, rz_bin_object_t::lines, rz_bin_file_load_options_t::loadaddr, rz_bin_object_t::maps, rz_bin_object_t::mem, rz_bin_class_t::methods, rz_bin_t::minstrlen, rz_bin_symbol_t::name, NULL, rz_bin_file_t::o, rz_bin_object_t::opts, p, rz_bin_addr_t::paddr, rz_bin_object_t::plugin, rz_bin_file_t::rbin, REBASE_PADDR, rz_bin_object_t::regstate, rz_bin_object_t::relocs, rz_bin_object_t::resources, rz_bin_file_golang_compiler(), rz_bin_file_strings(), rz_bin_filter_sections(), rz_bin_filter_symbols(), rz_bin_language_detect(), RZ_BIN_LANGUAGE_SWIFT, rz_bin_object_rebuild_classes_ht(), rz_bin_reloc_storage_new(), RZ_BIN_REQ_CLASSES, RZ_BIN_REQ_CLASSES_SOURCES, RZ_BIN_REQ_IMPORTS, RZ_BIN_REQ_RELOCS, RZ_BIN_REQ_STRINGS, RZ_BIN_SPECIAL_SYMBOL_LAST, rz_bin_string_database_new(), RZ_BIN_TYPE_CORE, rz_list_free(), rz_return_val_if_fail, RZ_STR_ISEMPTY, rz_warn_if_fail, sdb_free(), rz_bin_object_t::sections, rz_bin_object_t::size, rz_bin_object_t::strings, strings(), rz_bin_object_t::symbols, type, rz_bin_symbol_t::vaddr, and rz_bin_object_t::vfiles.
Referenced by rz_bin_object_new(), and rz_core_bin_rebase().
RZ_API ut64 rz_bin_object_v2p | ( | RZ_NONNULL RzBinObject * | obj, |
ut64 | vaddr | ||
) |
Convert virtual address to offset in the file according to binary mappings.
obj | Reference to RzBinObject |
paddr | Virtual address |
Definition at line 1015 of file bobj.c.
References delta, regress::m, rz_bin_object_get_map_at(), rz_return_val_if_fail, ut64(), and UT64_MAX.
Referenced by io_read_va_at(), and string_scan_range_cfstring().
RZ_API ut64 rz_bin_reloc_size | ( | RzBinReloc * | reloc | ) |
size of the reloc (where it is supposed to be patched) in bits
Definition at line 60 of file bobj.c.
References RZ_BIN_RELOC_16, RZ_BIN_RELOC_24, RZ_BIN_RELOC_32, RZ_BIN_RELOC_64, RZ_BIN_RELOC_8, and rz_bin_reloc_t::type.
Referenced by meta_for_reloc().
RZ_API void rz_bin_reloc_storage_free | ( | RzBinRelocStorage * | storage | ) |
Definition at line 137 of file bobj.c.
References free(), i, rz_bin_reloc_storage_t::relocs, rz_bin_reloc_storage_t::relocs_count, rz_bin_reloc_free(), and rz_bin_reloc_storage_t::target_relocs.
Referenced by rz_bin_object_free(), and rz_bin_object_patch_relocs().
RZ_API RzBinReloc* rz_bin_reloc_storage_get_reloc_in | ( | RzBinRelocStorage * | storage, |
ut64 | vaddr, | ||
ut64 | size | ||
) |
Get the reloc with the lowest vaddr that starts inside the given interval.
Definition at line 154 of file bobj.c.
References i, NULL, r, reloc_vaddr_cmp(), rz_bin_reloc_storage_t::relocs, rz_bin_reloc_storage_t::relocs_count, rz_array_lower_bound, and rz_return_val_if_fail.
Referenced by rz_core_getreloc().
RZ_API RzBinReloc* rz_bin_reloc_storage_get_reloc_to | ( | RzBinRelocStorage * | storage, |
ut64 | vaddr | ||
) |
Get a reloc that points exactly to vaddr or NULL.
Definition at line 173 of file bobj.c.
References i, NULL, r, reloc_target_vaddr_cmp(), rz_array_upper_bound, rz_return_val_if_fail, rz_bin_reloc_storage_t::target_relocs, and rz_bin_reloc_storage_t::target_relocs_count.
Referenced by rz_core_get_reloc_to().
RZ_API RzBinRelocStorage* rz_bin_reloc_storage_new | ( | RZ_OWN RzList * | relocs | ) |
Definition at line 105 of file bobj.c.
References rz_list_t::free, NULL, reloc_cmp(), reloc_target_cmp(), relocs(), rz_bin_reloc_storage_t::relocs, rz_bin_reloc_storage_t::relocs_count, rz_bin_reloc_has_target(), rz_list_free(), rz_list_length(), RZ_NEW0, rz_pvector_fini(), rz_pvector_flush(), rz_pvector_init(), rz_pvector_len(), rz_pvector_push(), rz_pvector_reserve(), rz_pvector_sort(), rz_bin_reloc_storage_t::target_relocs, and rz_bin_reloc_storage_t::target_relocs_count.
Referenced by rz_bin_object_patch_relocs(), and rz_bin_object_set_items().
RZ_API bool rz_bin_string_database_add | ( | RZ_NONNULL RzBinStrDb * | db, |
RZ_NONNULL RzBinString * | bstr | ||
) |
{ function_description }
db | The database |
bstr | The bstr |
Definition at line 1094 of file bobj.c.
References rz_list_append(), RZ_LOG_ERROR, and rz_return_val_if_fail.
Referenced by add_new_bin_string().
RZ_API void rz_bin_string_database_free | ( | RZ_NULLABLE RzBinStrDb * | db | ) |
Frees a RzBinStrDb structure.
db | The string database to free |
Definition at line 1076 of file bobj.c.
References free(), and rz_list_free().
Referenced by rz_bin_object_free(), rz_bin_object_reset_strings(), and rz_bin_string_database_new().
RZ_API RZ_OWN RzBinStrDb* rz_bin_string_database_new | ( | RZ_NULLABLE RZ_OWN RzList * | list | ) |
Allocates and initializes the RzBinStrDb structure with the given list of strings.
list | The list of strings to initialize the database with |
Definition at line 1036 of file bobj.c.
References fail, rz_bin_string_database_t::list, list(), NULL, rz_bin_string_t::paddr, rz_bin_string_database_t::phys, rz_bin_string_database_free(), rz_bin_string_free(), rz_list_free(), rz_list_newf(), RZ_LOG_ERROR, RZ_NEW0, rz_bin_string_t::vaddr, and rz_bin_string_database_t::virt.
Referenced by rz_bin_object_reset_strings(), and rz_bin_object_set_items().
RZ_API bool rz_bin_string_database_remove | ( | RZ_NONNULL RzBinStrDb * | db, |
ut64 | address, | ||
bool | is_va | ||
) |
Return true if the given address
has
been removed to the RzBinObject string database.
Definition at line 1117 of file bobj.c.
References NULL, rz_bin_string_t::paddr, rz_list_delete_data(), rz_return_val_if_fail, and rz_bin_string_t::vaddr.
RZ_API void rz_bin_string_decode_base64 | ( | RZ_NONNULL RzBinString * | bstr | ) |
Tries to decode the base64 string hold by RzBinString and overwrites it.
bstr | The RzBinString to decode |
Definition at line 15 of file bobj.c.
References free(), rz_base64_decode_dyn(), rz_return_if_fail, rz_str_is_printable(), RZ_STRING_ENC_BASE64, and autogen_x86imm::tmp.
Referenced by bin_object_decode_all_base64_strings().
Definition at line 217 of file bobj.c.
References NULL, p, r, and strdup().
Referenced by classes_from_symbols().