Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
|
static |
Definition at line 11 of file bfile.c.
References rz_bin_object_t::classes_ht, NULL, rz_bin_file_t::o, and rz_return_val_if_fail.
Referenced by rz_bin_file_add_class().
|
static |
Definition at line 16 of file bfile.c.
References rz_bin_object_t::methods_ht, NULL, rz_bin_file_t::o, rz_return_val_if_fail, and sdb_fmt().
Referenced by rz_bin_file_add_method().
Definition at line 371 of file bfile.c.
References fh, list(), benchmark::md, NULL, rz_hash_cfg_get_result(), rz_hex_bin2str(), rz_list_push(), RZ_LOG_ERROR, RZ_NEW0, rz_read_be_double(), rz_strf, and strdup().
Referenced by rz_bin_file_compute_hashes().
Definition at line 400 of file bfile.c.
References rz_hash_cfg_update().
Referenced by rz_bin_file_compute_hashes().
|
static |
Definition at line 74 of file bfile.c.
References NULL, rz_bin_get_binplugin_by_buffer(), rz_bin_get_binplugin_by_filename(), and rz_bin_get_binplugin_by_name().
Referenced by rz_bin_file_new_from_buffer(), and rz_bin_file_object_new_from_xtr_data().
RZ_IPI void rz_bin_class_free | ( | RzBinClass * | k | ) |
Definition at line 512 of file bfile.c.
References free(), k, and rz_list_free().
Referenced by parse_categories(), parse_classes(), and rz_bin_object_new().
RZ_IPI RzBinClass* rz_bin_class_new | ( | const char * | name, |
const char * | super, | ||
int | view | ||
) |
Definition at line 499 of file bfile.c.
References c, NULL, rz_list_new(), RZ_NEW0, rz_return_val_if_fail, and strdup().
Referenced by rz_bin_file_add_class().
RZ_API RzBinClass* rz_bin_file_add_class | ( | RzBinFile * | bf, |
const char * | name, | ||
const char * | super, | ||
int | view | ||
) |
Definition at line 523 of file bfile.c.
References __getClass(), c, rz_bin_object_t::classes, rz_bin_object_t::classes_ht, free(), NULL, rz_bin_file_t::o, rz_bin_class_new(), rz_list_append(), rz_list_length(), rz_return_val_if_fail, and strdup().
Referenced by classes_from_symbols(), and rz_bin_file_add_method().
RZ_API RzBinSymbol* rz_bin_file_add_method | ( | RzBinFile * | bf, |
const char * | klass, | ||
const char * | method, | ||
int | nargs | ||
) |
Definition at line 543 of file bfile.c.
References __getMethod(), c, rz_bin_object_t::methods_ht, rz_bin_symbol_t::name, NULL, rz_bin_file_t::o, rz_bin_file_add_class(), rz_list_append(), RZ_LOG_ERROR, RZ_NEW0, rz_return_val_if_fail, sdb_fmt(), and strdup().
Definition at line 359 of file bfile.c.
References rz_bin_file_free(), rz_id_storage_delete(), rz_id_storage_take(), and rz_return_val_if_fail.
Return a list of RzBinFileHash structures with the hashes md5, sha1, sha256, crc32 and entropy computed over the whole bf
.
Definition at line 411 of file bfile.c.
References add_file_hash(), buf_compute_hashes(), buf_size, rz_bin_file_t::fd, rz_bin_plugin_t::hashes, limit, benchmark::md, NULL, rz_bin_file_t::o, rz_bin_object_t::plugin, rz_bin_file_hash_free(), rz_buf_free(), rz_buf_fwd_scan(), rz_buf_new_with_io_fd(), rz_buf_size(), rz_hash_cfg_configure(), rz_hash_cfg_final(), rz_hash_cfg_free(), rz_hash_cfg_init(), rz_hash_cfg_new(), rz_list_free(), rz_list_join(), rz_list_newf(), RZ_LOG_ERROR, RZ_LOG_WARN, rz_return_val_if_fail, and ut64().
Referenced by rz_cmd_info_hashes_handler(), and rz_main_rizin().
RZ_API RzBinPlugin* rz_bin_file_cur_plugin | ( | RzBinFile * | bf | ) |
Definition at line 348 of file bfile.c.
References NULL, rz_bin_file_t::o, and rz_bin_object_t::plugin.
Referenced by __getname(), __getoffset(), core_bin_strings(), core_file_do_load_for_debug(), core_file_do_load_for_io_plugin(), create_string_search_thread(), ds_build_op_str(), rabin_do_operation(), rz_bin_file_free(), rz_bin_file_set_obj(), rz_bin_section_flag_to_list(), rz_bin_section_type_to_string(), rz_core_bin_headers_print(), rz_core_bin_info_print(), rz_core_bin_load(), rz_core_bin_signatures_print(), rz_core_file_info_print(), and rz_diff_file_open().
Definition at line 213 of file bfile.c.
References NULL, RZ_EVENT_BIN_FILE_DEL, rz_event_send(), rz_list_delete(), rz_list_find_ptr(), and rz_return_val_if_fail.
Referenced by get_bin_info(), get_va_symbol(), GetHeapGlobalsOffset(), rz_bin_reload(), rz_core_bin_load_structs(), rz_core_binfiles_delete(), rz_core_file_close(), and rz_core_file_reopen().
Definition at line 199 of file bfile.c.
References counter, NULL, RZ_EVENT_BIN_FILE_DEL, rz_event_send(), rz_list_length(), rz_list_purge(), rz_return_val_if_fail, and ut64().
Referenced by __close_file_cb(), file_load(), rz_core_io_file_open(), rz_open_binary_del_all_handler(), and rz_open_close_all_handler().
Definition at line 163 of file bfile.c.
References arch, bits(), NULL, rz_bin_xtr_extract_t::obj_opts, rz_bin_file_object_new_from_xtr_data(), rz_return_val_if_fail, rz_bin_file_t::xtr_data, and xtr_metadata_match().
Referenced by rz_bin_select(), rz_bin_use_arch(), and rz_core_bin_set_arch_bits().
Definition at line 226 of file bfile.c.
References rz_bin_file_t::fd, NULL, and rz_return_val_if_fail.
Referenced by core_bin_reload(), prioritize_file(), resolve_import_cb(), rz_bin_file_set_cur_by_fd(), rz_core_bin_set_cur(), rz_core_file_reopen(), rz_core_file_reopen_debug(), rz_open_binary_select_fd_handler(), and rz_open_use_handler().
Definition at line 188 of file bfile.c.
References rz_bin_file_t::id, and NULL.
Referenced by rz_bin_file_set_cur_by_id(), rz_bin_select_bfid(), rz_open_binary_del_handler(), and vf_open().
Definition at line 239 of file bfile.c.
References rz_bin_file_t::file, NULL, and rz_return_val_if_fail.
Referenced by rz_bin_file_set_cur_by_name(), and rz_bin_file_xtr_load_buffer().
RZ_IPI void rz_bin_file_free | ( | void * | _bf | ) |
Definition at line 44 of file bfile.c.
References rz_bin_file_t::buf, rz_bin_t::cur, rz_bin_file_t::curxtr, rz_bin_xtr_plugin_t::destroy, rz_bin_plugin_t::destroy, rz_bin_file_t::file, free(), rz_bin_xtr_plugin_t::free_xtr, rz_bin_file_t::id, rz_bin_t::ids, NULL, rz_bin_file_t::o, rz_id_storage_t::pool, rz_bin_file_t::rbin, rz_bin_file_cur_plugin(), rz_bin_object_free(), rz_buf_free(), rz_id_pool_kick_id(), rz_list_free(), rz_bin_file_t::sdb, sdb_free(), rz_bin_file_t::xtr_data, and rz_bin_file_t::xtr_obj.
Referenced by rz_bin_file_close(), and rz_bin_new().
Definition at line 352 of file bfile.c.
References rz_bin_file_load_options_t::baseaddr, rz_bin_file_t::o, rz_bin_object_t::opts, and UT64_MAX.
Referenced by rz_bin_get_baddr().
Definition at line 572 of file bfile.c.
References NULL, rz_bin_file_t::o, rz_bin_object_get_symbols(), and rz_return_val_if_fail.
Referenced by resolve_import_cb().
RZ_API RzList* rz_bin_file_get_trycatch | ( | RZ_NONNULL RzBinFile * | bf | ) |
Definition at line 564 of file bfile.c.
References NULL, and rz_return_val_if_fail.
Referenced by bin_trycatch().
RZ_IPI RzBinFile* rz_bin_file_new | ( | RzBin * | bin, |
const char * | file, | ||
ut64 | file_sz, | ||
int | fd, | ||
const char * | xtrname, | ||
bool | steal_ptr | ||
) |
Definition at line 22 of file bfile.c.
References rz_bin_file_t::curxtr, fd, rz_bin_file_t::fd, rz_bin_file_t::file, rz_bin_file_t::id, NULL, rz_bin_file_t::rbin, rz_bin_get_xtrplugin_by_name(), rz_bin_xtrdata_free(), rz_id_pool_grab_id(), rz_list_newf(), RZ_NEW0, RZ_STR_DUP, rz_bin_file_t::sdb, sdb_new0(), rz_bin_file_t::size, rz_bin_file_t::xtr_data, and rz_bin_file_t::xtr_obj.
Referenced by rz_bin_file_new_from_buffer(), and rz_bin_file_xtr_load_buffer().
RZ_IPI RzBinFile* rz_bin_file_new_from_buffer | ( | RzBin * | bin, |
const char * | file, | ||
RzBuffer * | buf, | ||
RzBinObjectLoadOptions * | opts, | ||
int | fd, | ||
const char * | pluginname | ||
) |
Definition at line 139 of file bfile.c.
References rz_bin_file_t::buf, fd, get_plugin_from_buffer(), NULL, rz_bin_file_new(), rz_bin_object_new(), rz_buf_ref(), rz_buf_size(), rz_list_append(), rz_list_delete(), rz_return_val_if_fail, and rz_bin_object_t::size.
Referenced by rz_bin_open_buf().
RZ_API bool rz_bin_file_object_new_from_xtr_data | ( | RzBin * | bin, |
RzBinFile * | bf, | ||
RzBinObjectLoadOptions * | opts, | ||
RzBinXtrData * | data | ||
) |
Definition at line 94 of file bfile.c.
References rz_bin_info_t::arch, rz_bin_xtr_metadata_t::arch, rz_bin_info_t::bits, rz_bin_xtr_metadata_t::bits, rz_bin_file_t::buf, rz_bin_xtr_extract_t::buf, rz_bin_info_t::file, rz_bin_file_t::file, rz_bin_xtr_extract_t::file_count, free(), get_plugin_from_buffer(), rz_bin_info_t::has_crypto, rz_bin_object_t::info, rz_bin_xtr_extract_t::loaded, rz_bin_info_t::machine, rz_bin_xtr_metadata_t::machine, rz_bin_xtr_extract_t::metadata, rz_bin_file_t::narch, NULL, rz_bin_file_t::o, rz_bin_xtr_extract_t::offset, rz_bin_object_new(), rz_buf_ref(), RZ_NEW0, rz_return_val_if_fail, rz_bin_object_t::size, rz_bin_xtr_extract_t::size, strdup(), rz_bin_info_t::type, rz_bin_xtr_metadata_t::type, and ut64().
Referenced by rabin_do_operation(), rz_bin_file_find_by_arch_bits(), and rz_bin_use_arch().
Definition at line 337 of file bfile.c.
References rz_bin_file_t::buf, bytes, NULL, rz_buf_free(), rz_buf_new_with_bytes(), rz_buf_new_with_pointers(), and rz_return_val_if_fail.
Definition at line 288 of file bfile.c.
References rz_bin_file_t::o, rz_bin_file_set_obj(), and rz_return_val_if_fail.
Referenced by get_bin_info(), get_va_symbol(), GetHeapGlobalsOffset(), rz_bin_file_set_cur_by_fd(), rz_bin_file_set_cur_by_id(), rz_bin_file_set_cur_by_name(), rz_bin_open_buf(), rz_core_bin_set_cur(), and rz_core_file_bin_raise().
Definition at line 258 of file bfile.c.
References rz_bin_file_find_by_fd(), and rz_bin_file_set_cur_binfile().
Referenced by rz_core_bin_set_by_fd().
Definition at line 253 of file bfile.c.
References rz_bin_file_find_by_id(), and rz_bin_file_set_cur_binfile().
Referenced by rz_open_maps_prioritize_binid_handler().
Definition at line 293 of file bfile.c.
References rz_bin_file_find_by_name(), rz_bin_file_set_cur_binfile(), and rz_return_val_if_fail.
Referenced by rz_core_bin_set_by_name().
Set file_hashes
on current RzBinInfo.
Definition at line 488 of file bfile.c.
References rz_bin_info_t::file_hashes, info(), rz_bin_object_t::info, NULL, rz_bin_file_t::o, and rz_return_val_if_fail.
Referenced by rz_cmd_info_hashes_handler(), and rz_main_rizin().
RZ_IPI bool rz_bin_file_set_obj | ( | RzBin * | bin, |
RzBinFile * | bf, | ||
RzBinObject * | obj | ||
) |
Definition at line 263 of file bfile.c.
References rz_bin_file_t::file, rz_bin_object_t::info, rz_bin_info_t::lang, rz_bin_object_t::lang, rz_bin_plugin_t::minstrlen, rz_bin_file_t::narch, rz_bin_file_t::o, rz_bin_file_cur_plugin(), rz_bin_language_to_string(), and rz_return_val_if_fail.
Referenced by rz_bin_file_set_cur_binfile(), rz_bin_object_new(), rz_bin_select(), rz_bin_select_bfid(), rz_bin_select_object(), and rz_bin_use_arch().
RZ_IPI RzBinFile* rz_bin_file_xtr_load_buffer | ( | RzBin * | bin, |
RzBinXtrPlugin * | xtr, | ||
const char * | filename, | ||
RzBuffer * | buf, | ||
RzBinObjectLoadOptions * | obj_opts, | ||
int | idx, | ||
int | fd | ||
) |
Definition at line 299 of file bfile.c.
References bytes, rz_bin_xtr_plugin_t::extractall_from_buffer, rz_bin_xtr_plugin_t::extractall_from_bytes, fd, rz_bin_file_load_options_t::loadaddr, rz_bin_file_t::loadaddr, rz_bin_xtr_plugin_t::name, NULL, rz_bin_file_find_by_name(), rz_bin_file_new(), rz_buf_data(), rz_buf_size(), rz_list_append(), rz_list_free(), RZ_LOG_INFO, rz_return_val_if_fail, ut64(), x, and rz_bin_file_t::xtr_data.
Referenced by rz_bin_open_buf().
|
static |
Definition at line 130 of file bfile.c.
References rz_bin_xtr_metadata_t::arch, arch, rz_bin_xtr_metadata_t::bits, bits(), rz_bin_xtr_extract_t::loaded, and rz_bin_xtr_extract_t::metadata.
Referenced by rz_bin_file_find_by_arch_bits().