Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_core.h>
#include <stdlib.h>
#include <string.h>
#include "core_private.h"
#include "core_private_base.h"
Go to the source code of this file.
Classes | |
struct | __rebase_struct |
struct | RzCoreFileData |
struct | RzCoreLinkData |
Macros | |
#define | __is_inside_section(item_addr, section) (item_addr >= old_base + section->vaddr && item_addr <= old_base + section->vaddr + section->vsize) |
Definition at line 123 of file cfile.c.
References __is_inside_section, __rebase_flags(), __rebase_xrefs(), rz_analysis_function_t::addr, rz_analysis_bb_t::addr, rz_core_t::analysis, rz_bin_object_t::baddr_shift, rz_analysis_function_t::bbs, rz_core_t::bin, __rebase_struct::core, rz_bin_t::cur, rz_core_t::dbg, __rebase_struct::diff, rz_analysis_bb_t::fail, rz_analysis_t::fcns, rz_core_t::flags, rz_analysis_t::ht_xrefs_from, rz_analysis_t::ht_xrefs_to, rz_analysis_bb_t::jump, NULL, rz_bin_file_t::o, __rebase_struct::old_base, __rebase_struct::old_sections, rz_analysis_block_relocate(), rz_analysis_function_rebase_vars(), rz_analysis_function_relocate(), rz_analysis_xrefs_init(), rz_debug_bp_rebase(), rz_flag_foreach(), rz_meta_rebase(), rz_analysis_bb_t::size, ut64(), UT64_MAX, rz_bin_section_t::vaddr, and rz_bin_section_t::vsize.
Referenced by rz_core_file_reopen_debug(), rz_core_file_reopen_remote_debug(), and rz_core_io_file_open().
|
static |
Definition at line 93 of file cfile.c.
References __is_inside_section, __rebase_struct::core, __rebase_struct::diff, rz_core_t::flags, rz_flag_item_t::name, rz_flag_item_t::offset, __rebase_struct::old_base, __rebase_struct::old_sections, rz_flag_set(), rz_flag_item_t::size, and ut64().
Referenced by __rebase_everything().
Definition at line 117 of file cfile.c.
References __rebase_xrefs_i(), and v.
Referenced by __rebase_everything().
Definition at line 108 of file cfile.c.
References rz_core_t::analysis, __rebase_struct::core, __rebase_struct::diff, rz_analysis_ref_t::from, rz_analysis_xrefs_set(), rz_analysis_ref_t::to, rz_analysis_ref_t::type, and v.
Referenced by __rebase_xrefs().
Definition at line 56 of file cfile.c.
References rz_core_t::bin, rz_bin_section_t::format, rz_list_t::free, rz_bin_section_t::name, NULL, rz_bin_get_sections(), rz_list_append(), rz_list_new(), RZ_LOG_WARN, RZ_NEW0, sections(), and strdup().
Referenced by rz_core_file_reopen_debug(), rz_core_file_reopen_remote_debug(), and rz_core_io_file_open().
Definition at line 1492 of file cfile.c.
References desc, rz_core_file_t::fd, rz_core_t::file, and rz_core_file_close_fd().
Referenced by rz_core_file_close_all_but().
|
static |
Definition at line 633 of file cfile.c.
References rz_bin_info_t::arch, baseaddr, rz_core_file_t::binfiles, rz_bin_info_t::bits, desc, fd, rz_core_file_t::fd, rz_bin_file_t::file, get_base_from_maps(), info(), rz_bin_object_t::info, rz_bin_plugin_t::name, NULL, r, rz_bin_cur_object(), rz_bin_file_cur_plugin(), rz_bin_open(), rz_bin_options_init(), rz_config_get(), rz_config_get_b(), rz_config_get_i(), rz_config_set_i(), rz_core_bin_apply_all_info(), rz_core_bin_set_arch_bits(), rz_core_cmd0(), rz_core_file_cur(), rz_debug_reg_profile_sync(), rz_debug_select(), rz_io_desc_get(), rz_io_desc_get_base(), rz_io_fd_get_pid(), rz_io_fd_get_tid(), RZ_LOG_ERROR, rz_pvector_push(), ut64(), and UT64_MAX.
Referenced by rz_core_bin_load().
Definition at line 714 of file cfile.c.
References rz_bin_info_t::arch, baseaddr, rz_core_file_t::binfiles, rz_bin_info_t::bits, fd, rz_core_file_t::fd, rz_bin_file_t::file, info(), rz_bin_object_t::info, rz_bin_plugin_t::name, NULL, r, rz_bin_cur_object(), rz_bin_file_cur_plugin(), rz_bin_open_io(), rz_config_get_i(), rz_core_bin_apply_all_info(), rz_core_bin_options_init(), rz_core_bin_set_arch_bits(), rz_core_file_cur(), rz_io_use_fd(), RZ_LOG_WARN, and rz_pvector_push().
Referenced by rz_core_bin_load().
|
static |
Definition at line 13 of file cfile.c.
References fd, NULL, r, RZ_NEW0, and rz_pvector_init().
Referenced by rz_core_file_open(), and rz_core_file_open_many().
Definition at line 873 of file cfile.c.
References filecb(), rz_io_t::files, RzCoreFileData::found, rz_core_t::io, and rz_id_storage_foreach().
Referenced by rz_core_bin_load().
Definition at line 488 of file cfile.c.
References rz_core_t::blocksize, __rebase_struct::core, delta, rz_core_file_t::fd, rz_core_t::file, rz_core_t::io, rz_core_t::offset, rz_core_block_read(), rz_io_fd_size(), rz_io_resize(), rz_io_shift(), RZ_LOG_ERROR, and ut64().
Referenced by rz_core_file_resize(), and rz_core_file_resize_delta().
Definition at line 864 of file cfile.c.
References desc, RzCoreFileData::found, and RzCoreFileData::name.
Referenced by file_is_loaded().
Definition at line 576 of file cfile.c.
References b, __rebase_struct::core, rz_core_t::dbg, map(), rz_debug_t::maps, rz_debug_map_sync(), and ut64().
Referenced by core_file_do_load_for_debug().
Definition at line 836 of file cfile.c.
References __rebase_struct::core, file, files, free(), RZ_BINRC, rz_core_run_script(), rz_file_path_join(), rz_list_free(), RZ_LOG_INFO, rz_path_home_prefix(), rz_strf, rz_sys_dir(), and autogen_x86imm::tmp.
Referenced by rz_core_bin_load().
|
static |
Definition at line 40 of file cfile.c.
References __isMips(), addr, rz_core_t::analysis, rz_core_t::config, rz_core_t::num, rz_core_t::rasm, rz_analysis_t::reg, rz_config_set(), rz_config_set_i(), rz_core_debug_step_one(), rz_core_seek_opt(), rz_num_math(), rz_reg_getv(), ut64(), and UT64_MAX.
Referenced by rz_core_bin_load(), and rz_core_file_reopen().
Definition at line 903 of file cfile.c.
References rz_core_t::bin, rz_core_file_t::binfiles, desc, rz_bin_file_t::fd, rz_core_t::io, rz_bin_file_t::loadaddr, NULL, PFMT64x, rz_bin_open_io(), rz_core_align_base_address, RZ_CORE_BASE_ADDRESS_DEX, rz_core_bin_apply_all_info(), rz_core_bin_options_init(), rz_core_file_cur(), rz_io_desc_get(), rz_io_desc_size(), rz_io_use_fd(), RZ_LOG_ERROR, RZ_LOG_INFO, rz_pvector_empty(), rz_pvector_push(), rz_pvector_tail(), rz_return_val_if_fail, rz_str_endswith(), and ut64().
Referenced by rz_core_bin_load().
|
static |
Definition at line 885 of file cfile.c.
References RzCoreLinkData::addr, RzCoreLinkData::bin, desc, RzCoreLinkData::name, rz_bin_symbol_t::name, rz_bin_file_find_by_fd(), rz_bin_file_get_symbols(), rz_return_val_if_fail, symbols(), and rz_bin_symbol_t::vaddr.
Referenced by rz_core_bin_load().
RZ_API bool rz_core_bin_load | ( | RZ_NONNULL RzCore * | r, |
RZ_NULLABLE const char * | filenameuri, | ||
ut64 | baddr | ||
) |
Definition at line 942 of file cfile.c.
References a, RzCoreLinkData::addr, rz_bin_info_t::arch, arch, b, baddr(), rz_bin_info_t::bits, bits(), core_file_do_load_for_debug(), core_file_do_load_for_io_plugin(), desc, rz_bin_file_t::fd, rz_core_file_t::fd, rz_bin_file_t::file, file_is_loaded(), rz_bin_plugin_t::file_type, free(), rz_bin_info_t::has_va, imports(), inf(), info(), rz_bin_object_t::info, rz_bin_plugin_t::info, libs(), load_scripts_for(), loadGP(), map_multi_dex(), rz_bin_object_t::maps, msg, rz_bin_plugin_t::name, rz_bin_import_t::name, NULL, rz_bin_file_t::o, rz_flag_item_t::offset, PFMT64x, r, rz_bin_object_t::regstate, resolve_import_cb(), RZ_ANALYSIS_XREF_TYPE_NULL, rz_analysis_xrefs_set(), rz_bin_cur(), rz_bin_cur_object(), rz_bin_file_cur_plugin(), rz_bin_get_imports(), rz_bin_get_libs(), rz_bin_info_free(), RZ_BIN_TYPE_CORE, rz_config_get(), rz_config_get_b(), rz_config_get_i(), rz_config_set(), rz_config_set_b(), rz_config_set_i(), rz_core_bin_raise(), rz_core_bin_set_arch_bits(), rz_core_cmd(), rz_core_file_cur(), rz_core_file_loadlib(), rz_core_seek(), rz_flag_get(), rz_id_storage_foreach(), rz_io_desc_get(), rz_io_desc_is_dbg(), rz_io_desc_size(), rz_io_map_location(), rz_io_map_new(), rz_io_use_fd(), RZ_LOG_ERROR, RZ_LOG_INFO, RZ_LOG_WARN, rz_name_filter(), rz_num_math(), RZ_PERM_X, rz_reg_arena_set_bytes(), rz_return_val_if_fail, RZ_STR_ISEMPTY, rz_str_newf(), rz_str_startswith(), rz_bin_plugin_t::strfilter, ut64(), and UT64_MAX.
Referenced by open_core_file(), rz_core_file_open_load(), rz_core_file_open_many(), rz_core_file_reopen(), rz_core_file_reopen_remote_debug(), rz_core_io_file_open(), rz_core_rtr_gdb_run(), rz_core_serve(), rz_diff_load_file_with_core(), rz_main_rizin(), rz_main_rz_sign(), rz_open_malloc_handler(), try_load_file(), and try_loadlib().
Definition at line 822 of file cfile.c.
References baddr(), rz_bin_file_load_options_t::baseaddr, rz_core_t::bin, __rebase_struct::core, rz_bin_t::cur, rz_bin_file_load_options_t::loadaddr, rz_bin_file_t::o, rz_bin_object_t::opts, rz_bin_object_set_items(), and UT64_MAX.
Referenced by rz_open_binary_rebase_handler().
Definition at line 1290 of file cfile.c.
References rz_core_file_t::binfiles, rz_core_t::files, and rz_pvector_remove_data().
Referenced by ev_binfiledel_cb().
Definition at line 1451 of file cfile.c.
References rz_core_t::bin, rz_bin_file_t::fd, rz_core_t::io, rz_bin_file_set_cur_binfile(), rz_core_file_set_by_fd(), rz_io_use_fd(), and rz_list_get_n().
Definition at line 1465 of file cfile.c.
References rz_core_t::bin, count, desc, rz_io_t::desc, fd, rz_bin_file_t::fd, rz_core_t::file, rz_core_t::io, NULL, rz_cons_printf(), rz_core_file_get_by_fd(), rz_core_file_set_by_file(), rz_io_desc_get(), and RZ_PERM_W.
RZ_API void rz_core_file_close | ( | RzCoreFile * | fh | ) |
Definition at line 1299 of file cfile.c.
References desc, fh, map(), NULL, r, rz_bin_file_delete(), rz_io_desc_close(), rz_io_desc_get(), rz_io_map_del(), rz_list_delete(), rz_list_find_ptr(), rz_pvector_at(), rz_pvector_empty(), rz_pvector_len(), and rz_return_if_fail.
Referenced by rz_core_file_close_fd(), rz_core_file_reopen(), and rz_main_rz_bin().
Definition at line 1505 of file cfile.c.
References close_but_cb(), rz_io_t::files, rz_core_t::io, and rz_id_storage_foreach().
Referenced by rz_core_file_reopen().
Definition at line 1510 of file cfile.c.
References fd, file::fd, file, rz_core_t::files, rz_core_t::io, rz_core_file_close(), rz_io_fd_close(), and rz_list_first().
Referenced by __close_file_cb(), close_but_cb(), file_load(), rz_open_close_all_handler(), and rz_open_close_handler().
RZ_API RzCoreFile* rz_core_file_cur | ( | RzCore * | r | ) |
Definition at line 1591 of file cfile.c.
References r.
Referenced by core_bin_reload(), core_file_do_load_for_debug(), core_file_do_load_for_io_plugin(), map_multi_dex(), and rz_core_bin_load().
Definition at line 1584 of file cfile.c.
References rz_core_file_t::fd, rz_core_t::file, and UT32_MAX.
Referenced by rz_core_bin_set_cur().
RZ_API RzCoreFile* rz_core_file_find_by_fd | ( | RzCore * | core, |
ut64 | fd | ||
) |
Definition at line 1528 of file cfile.c.
References fd, rz_core_file_t::fd, rz_core_t::files, and NULL.
Referenced by rz_core_bin_apply_maps().
RZ_API RzCoreFile* rz_core_file_find_by_name | ( | RzCore * | core, |
const char * | name | ||
) |
Definition at line 1540 of file cfile.c.
References desc, rz_core_file_t::fd, rz_core_t::files, rz_core_t::io, NULL, and rz_io_desc_get().
Referenced by rz_core_file_set_by_name().
RZ_IPI void rz_core_file_free | ( | RzCoreFile * | cf | ) |
Definition at line 26 of file cfile.c.
References rz_core_file_t::binfiles, rz_core_file_t::extra_files, free(), rz_core_file_t::maps, and rz_pvector_fini().
Referenced by rz_core_init().
RZ_API RzCoreFile* rz_core_file_get_by_fd | ( | RzCore * | core, |
int | fd | ||
) |
Definition at line 1328 of file cfile.c.
References fd, file::fd, file, rz_core_t::files, and NULL.
Referenced by rz_core_file_binlist().
Definition at line 1271 of file cfile.c.
References desc, rz_core_file_t::extra_files, rz_core_t::files, and rz_pvector_remove_data().
Referenced by ev_iodescclose_cb().
Definition at line 1280 of file cfile.c.
References rz_core_t::files, map(), rz_core_file_t::maps, rz_core_io_map_info_free(), and rz_pvector_remove_data().
Referenced by ev_iomapdel_cb().
Definition at line 777 of file cfile.c.
References rz_core_t::config, __rebase_struct::core, free(), NULL, rz_config_get(), rz_path_libdir(), rz_str_newf(), RZ_SYS_DIR, s, and try_loadlib().
Referenced by rz_core_bin_load().
RZ_API RZ_BORROW RzCoreFile* rz_core_file_open | ( | RZ_NONNULL RzCore * | r, |
RZ_NONNULL const char * | file, | ||
int | flags, | ||
ut64 | loadaddr | ||
) |
Tries to open the file as is, otherwise tries as is a compilation of files.
Calls rz_io_open_nomap but if it fails, then tries with rz_core_file_open_many; Also, loadaddr is rizin -m (mapaddr)
Definition at line 1182 of file cfile.c.
References core_file_new(), fd, fh, flags, free(), NULL, r, rz_config_get(), rz_config_get_b(), rz_config_get_i(), rz_config_set(), rz_config_set_i(), rz_cons_is_breaked(), rz_core_cmd(), rz_core_cmd0(), rz_core_file_open_many(), rz_core_serve(), rz_debug_use(), rz_file_abspath(), rz_io_desc_free(), rz_io_desc_get(), rz_io_is_listener(), rz_io_open_nomap(), rz_io_use_fd(), rz_list_append(), rz_list_find_ptr(), RZ_LOG_ERROR, RZ_PERM_R, RZ_PERM_W, rz_return_val_if_fail, rz_str_ndup(), rz_time_now_mono(), ut64(), and UT64_MAX.
Referenced by open_core_file(), rz_core_file_open_load(), rz_core_file_reopen(), rz_core_file_reopen_remote_debug(), rz_core_io_file_open(), rz_core_rtr_gdb_run(), rz_core_serve(), rz_diff_load_file_with_core(), rz_main_rizin(), rz_main_rz_bin(), rz_main_rz_sign(), rz_open_malloc_handler(), try_load_file(), and try_loadlib().
RZ_API bool rz_core_file_open_load | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL const char * | filepath, | ||
ut64 | addr, | ||
int | perms, | ||
bool | write_mode | ||
) |
Tries to open the file, load binary info and make RzIOMap.
Definition at line 189 of file cfile.c.
References addr, benchmark::cfile, __rebase_struct::core, desc, rz_core_t::io, map(), rz_core_t::num, rz_core_bin_load(), rz_core_block_read(), rz_core_file_open(), rz_io_desc_get(), RZ_LOG_ERROR, RZ_LOG_WARN, RZ_PERM_W, RZ_PERM_WX, rz_pvector_foreach, rz_return_val_if_fail, UT64_MAX, and rz_num_t::value.
Referenced by rz_open_handler(), and rz_open_write_handler().
RZ_API RZ_BORROW RzCoreFile* rz_core_file_open_many | ( | RZ_NONNULL RzCore * | r, |
RZ_NULLABLE const char * | file, | ||
int | perm, | ||
ut64 | base_address | ||
) |
Open the file as a compilation of files.
Calls rz_io_open_many and maps all the file descriptors to an RzCoreFile
Definition at line 1133 of file cfile.c.
References core_file_new(), desc, fh, NULL, PFMT64x, r, rz_core_align_base_address, RZ_CORE_BASE_ADDRESS_DEFAULT, rz_core_bin_load(), rz_io_desc_add(), rz_io_desc_free(), rz_io_desc_size(), rz_io_open_many(), rz_list_append(), rz_list_first(), rz_list_free(), RZ_LOG_ERROR, RZ_LOG_INFO, and ut64().
Referenced by rz_core_file_open().
RZ_API bool rz_core_file_print | ( | RzCore * | core, |
RzOutputMode | mode | ||
) |
Definition at line 1372 of file cfile.c.
References rz_core_t::bin, rz_bin_t::binfiles, count, desc, rz_io_t::desc, f, rz_bin_file_t::fd, rz_io_desc_t::fd, rz_core_t::files, free(), from, rz_core_t::io, NULL, PFMT64d, PFMT64u, PFMT64x, pj_a(), pj_end(), pj_free(), pj_kb(), pj_ki(), pj_kn(), pj_ks(), pj_new(), pj_o(), pj_string(), rz_cons_printf(), rz_cons_println(), rz_file_abspath(), rz_io_desc_get(), rz_io_desc_size(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_RIZIN, RZ_PERM_W, ut64(), and UT64_MAX.
Definition at line 322 of file cfile.c.
References rz_core_t::analysis, args, baddr(), rz_core_t::bin, rz_core_t::config, __rebase_struct::core, rz_bin_t::cur, rz_core_t::dbg, rz_core_file_t::fd, rz_io_desc_t::fd, file::fd, rz_bin_file_t::file, rz_core_t::file, free(), rz_core_t::io, rz_analysis_t::iob, loadGP(), rz_debug_t::main_pid, memset(), NULL, rz_core_t::num, rz_core_t::offset, ofile, path, rz_debug_t::pid, rz_debug_t::reason, rz_debug_t::recoil_mode, rz_io_desc_t::referer, rz_bin_file_delete(), rz_bin_file_find_by_fd(), rz_config_get_b(), rz_config_get_i(), rz_config_set_i(), rz_core_bin_load(), rz_core_bin_update_arch_bits(), rz_core_block_read(), rz_core_debug_map_update_flags(), rz_core_file_close(), rz_core_file_close_all_but(), rz_core_file_open(), rz_core_file_set_by_file(), rz_core_reg_update_flags(), rz_core_seek(), rz_core_seek_to_register(), rz_core_setup_debugger(), RZ_DBG_RECOIL_NONE, rz_debug_continue(), rz_debug_detach(), rz_debug_get_baddr(), rz_debug_is_dead(), rz_debug_kill(), rz_debug_select(), rz_io_bind(), rz_io_desc_get(), rz_io_fd_get_pid(), rz_io_fd_get_tid(), rz_io_use_fd(), RZ_LOG_ERROR, rz_num_math(), RZ_PERM_W, strdup(), rz_debug_t::tid, rz_io_desc_t::uri, ut64(), and UT64_MAX.
Referenced by reopen_nobin_headers(), rz_core_file_reopen_debug(), rz_reopen_binary_handler(), rz_reopen_nobin_handler(), and rz_reopen_nobin_write_handler().
Definition at line 269 of file cfile.c.
References __rebase_everything(), __save_old_sections(), args, rz_bin_object_t::baddr_shift, rz_core_t::bin, rz_asm_t::bits, bits(), rz_core_t::config, __rebase_struct::core, rz_bin_t::cur, rz_core_t::dbg, desc, rz_io_t::desc, rz_io_desc_t::fd, rz_bin_file_t::file, rz_core_t::file, free(), rz_core_t::io, rz_debug_t::main_arena_resolved, NULL, rz_bin_file_t::o, ofile, __rebase_struct::old_base, __rebase_struct::old_sections, rz_core_t::rasm, rz_bin_file_find_by_fd(), rz_config_get_i(), rz_config_set_b(), rz_config_set_i(), rz_core_file_reopen(), rz_core_io_file_open(), rz_core_seek_to_register(), rz_file_abspath(), rz_file_exists(), rz_io_desc_get(), rz_io_reopen(), rz_list_free(), RZ_LOG_ERROR, RZ_PERM_R, RZ_PERM_W, rz_str_arg_escape(), rz_str_newf(), strdup(), and ut64().
Referenced by __reload_cb(), rz_core_rtr_gdb_run(), rz_reopen_debug_handler(), and rz_reopen_debug_rzrun_handler().
Definition at line 222 of file cfile.c.
References __rebase_everything(), __save_old_sections(), addr, rz_bin_object_t::baddr_shift, rz_core_t::bin, rz_asm_t::bits, bits(), rz_core_t::config, __rebase_struct::core, rz_bin_t::cur, rz_core_t::dbg, desc, fd, file::fd, file, rz_core_t::file, rz_core_t::io, rz_debug_t::main_arena_resolved, rz_core_t::num, rz_bin_file_t::o, ofile, __rebase_struct::old_base, __rebase_struct::old_sections, rz_core_t::rasm, rz_bin_get_baddr(), rz_config_get_i(), rz_config_set_b(), rz_config_set_i(), rz_core_bin_load(), rz_core_block_read(), rz_core_file_open(), rz_core_seek_to_register(), rz_debug_get_baddr(), rz_io_desc_get(), rz_list_free(), RZ_LOG_ERROR, RZ_PERM_R, RZ_PERM_W, strdup(), ut64(), and rz_num_t::value.
Referenced by rz_reopen_debug_file_handler().
Definition at line 518 of file cfile.c.
References __rebase_struct::core, and file_resize().
Referenced by rz_resize_handler().
Definition at line 522 of file cfile.c.
References __rebase_struct::core, delta, and file_resize().
Referenced by insert_mode_enabled(), and resize_helper().
Definition at line 1559 of file cfile.c.
References fd, rz_core_t::io, rz_core_bin_set_by_fd(), and rz_io_use_fd().
Referenced by rz_core_file_bin_raise(), and rz_core_file_set_by_file().
RZ_API int rz_core_file_set_by_file | ( | RzCore * | core, |
RzCoreFile * | cf | ||
) |
Definition at line 1573 of file cfile.c.
References rz_core_file_t::fd, rz_core_t::file, and rz_core_file_set_by_fd().
Referenced by rz_core_file_binlist(), rz_core_file_reopen(), and rz_core_file_set_by_name().
Definition at line 1568 of file cfile.c.
References rz_core_file_find_by_name(), and rz_core_file_set_by_file().
RZ_API void rz_core_io_file_open | ( | RZ_NONNULL RzCore * | core, |
int | fd | ||
) |
Open file use read-only Permission.
core | RzCore instance |
fd | File descriptor |
Definition at line 1601 of file cfile.c.
References __rebase_everything(), __save_old_sections(), benchmark::cfile, fd, rz_bin_file_t::file, free(), rz_bin_cur(), rz_bin_file_delete_all(), rz_config_get_b(), rz_config_set_b(), rz_core_bin_load(), rz_core_block_read(), rz_core_file_open(), rz_file_exists(), rz_io_close_all(), rz_io_reopen(), rz_list_free(), RZ_LOG_ERROR, RZ_LOG_WARN, RZ_PERM_R, rz_return_if_fail, rz_str_path_escape(), ut64(), and UT64_MAX.
Referenced by __debugger_cb(), rz_core_debug_process_close(), rz_core_file_reopen_debug(), and rz_reopen_handler().
RZ_API void rz_core_io_file_reopen | ( | RZ_NONNULL RzCore * | core, |
int | fd, | ||
int | perms | ||
) |
Reopen file.
core | RzCore instance |
fd | File descriptor |
perms | Permission \s RZ_PERM_R |
Definition at line 1650 of file cfile.c.
References fd, map(), maps(), rz_io_maps(), rz_io_reopen(), RZ_PERM_WX, rz_pvector_foreach_prev, and rz_return_if_fail.
Referenced by __rw_cb(), and rz_reopen_write_handler().
RZ_IPI void rz_core_io_map_info_free | ( | RzCoreIOMapInfo * | info | ) |
RZ_IPI RzCoreIOMapInfo* rz_core_io_map_info_new | ( | RzCoreFile * | cf, |
int | perm_orig | ||
) |
Definition at line 1669 of file cfile.c.
References info(), NULL, and RZ_NEW.
Referenced by add_map(), and io_create_mem_map().
Definition at line 1339 of file cfile.c.
References rz_interval_t::addr, rz_core_t::bin, rz_bin_t::binfiles, desc, f, rz_bin_file_t::fd, rz_core_t::files, free(), rz_core_t::io, rz_io_map_t::itv, maps(), PFMT64x, rz_cons_printf(), rz_file_abspath(), rz_io_desc_get(), rz_io_map_get_for_fd(), and rz_list_free().
Definition at line 540 of file cfile.c.
References rz_asm_t::big_endian, rz_core_t::blocksize, close, rz_core_t::config, __rebase_struct::core, desc, rz_core_file_t::fd, rz_core_t::file, free(), rz_core_t::io, NULL, rz_core_t::offset, PFMT64d, PFMT64x, rz_core_t::rasm, rz_config_get(), rz_config_get_b(), rz_config_get_i(), rz_config_serialize(), rz_file_mkstemp(), rz_io_desc_get(), rz_io_desc_size(), rz_sys_setenv(), sdb_fmt(), sdb_free(), sdb_new(), and sdb_sync().
Referenced by lang_run_file(), and rz_core_cmd_command().
Definition at line 526 of file cfile.c.
References free(), NULL, rz_file_rm(), rz_sys_getenv(), and rz_sys_setenv().
Referenced by rz_core_cmd_command().
Definition at line 769 of file cfile.c.
References addr, __rebase_struct::core, NULL, rz_core_bin_load(), and rz_core_file_open().
Referenced by rz_core_file_loadlib().