Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Macros | |
#define | CMP(addr, part) |
#define | IO_EXTEND_BLOCK_SZ 256 |
Typedefs | |
typedef int(* | cbOnIterMap) (RzIO *io, int fd, ut64 addr, ut8 *buf, int len, RzIOMap *map, void *user) |
#define CMP | ( | addr, | |
part | |||
) |
#define IO_EXTEND_BLOCK_SZ 256 |
|
static |
Definition at line 18 of file io.c.
References addr, fd, len, and rz_io_fd_read_at().
Referenced by rz_io_nread_at(), rz_io_read_at_mapped(), and rz_io_vread_at_mapped().
|
static |
Definition at line 22 of file io.c.
References addr, fd, len, and rz_io_fd_write_at().
Referenced by rz_io_vwrite_at().
|
static |
Definition at line 30 of file io.c.
References addr, rz_interval_t::addr, CMP, i, rz_skyline_item_t::itv, len, map(), rz_io_t::map_skyline, NULL, op, rz_io_t::p_cache, rz_itv_end(), RZ_MIN, rz_vector_index_ptr(), rz_vector_len(), rz_vector_lower_bound, st64, rz_skyline_item_t::user, ut64(), and rz_skyline_t::v.
Referenced by rz_io_nread_at(), rz_io_read_at_mapped(), rz_io_vread_at_mapped(), and rz_io_vwrite_at().
Definition at line 550 of file io.c.
References rz_io_bind_t::addr_is_mapped, rz_io_bind_t::close, rz_io_bind_t::desc_get, rz_io_bind_t::desc_size, rz_io_bind_t::desc_use, rz_io_bind_t::fd_close, rz_io_bind_t::fd_get_current, rz_io_bind_t::fd_get_map, rz_io_bind_t::fd_get_name, rz_io_bind_t::fd_getbuf, rz_io_bind_t::fd_is_dbg, rz_io_bind_t::fd_open, rz_io_bind_t::fd_read, rz_io_bind_t::fd_read_at, rz_io_bind_t::fd_remap, rz_io_bind_t::fd_resize, rz_io_bind_t::fd_seek, rz_io_bind_t::fd_size, rz_io_bind_t::fd_write, rz_io_bind_t::fd_write_at, rz_io_bind_t::init, rz_io_bind_t::io, rz_io_bind_t::is_valid_offset, rz_io_bind_t::map_add, rz_io_bind_t::map_get, rz_io_bind_t::map_get_paddr, rz_io_bind_t::open, rz_io_bind_t::open_at, rz_io_bind_t::p2v, rz_io_bind_t::read_at, rz_io_addr_is_mapped(), rz_io_desc_get(), rz_io_desc_size(), rz_io_fd_close(), rz_io_fd_get_buf(), rz_io_fd_get_current(), rz_io_fd_get_name(), rz_io_fd_is_dbg(), rz_io_fd_open(), rz_io_fd_read(), rz_io_fd_read_at(), rz_io_fd_resize(), rz_io_fd_seek(), rz_io_fd_size(), rz_io_fd_write(), rz_io_fd_write_at(), rz_io_is_valid_offset(), rz_io_map_add(), rz_io_map_get(), rz_io_map_get_for_fd(), rz_io_map_get_paddr(), rz_io_map_remap_fd(), rz_io_open_at(), rz_io_open_nomap(), rz_io_p2v(), rz_io_read_at(), rz_io_system(), rz_io_use_fd(), rz_io_v2p(), rz_io_write_at(), rz_return_if_fail, rz_io_bind_t::system, rz_io_bind_t::v2p, and rz_io_bind_t::write_at.
Referenced by __open(), download_pdb(), rz_core_file_reopen(), rz_core_init(), rz_diff_file_open(), and rzfind_open_file().
Definition at line 258 of file io.c.
References rz_io_cache_fini(), rz_io_desc_fini(), rz_io_desc_init(), and rz_io_map_reset().
Referenced by __close_file_cb(), file_load(), rz_core_io_file_open(), and rz_open_close_all_handler().
Extend the RzIODesc at addr
by inserting size
0 bytes.
io | Reference to RzIO instance |
addr | Address where to insert new 0 bytes |
size | Number of 0 bytes to insert |
Definition at line 453 of file io.c.
References addr, rz_io_t::desc, free(), IO_EXTEND_BLOCK_SZ, rz_io_desc_t::perm, rz_io_desc_t::plugin, rz_io_desc_size(), rz_io_pread_at(), rz_io_pwrite_at(), rz_io_resize(), RZ_MAX, RZ_NEWS, RZ_NEWS0, RZ_PERM_RW, rz_return_val_if_fail, autogen_x86imm::tmp, ut64(), and UT64_ADD_OVFCHK.
Referenced by rz_core_extend_at().
Definition at line 724 of file io.c.
References rz_io_t::envprofile, rz_io_t::event, free(), rz_io_t::plugins, ptrace_wrap_instance_stop(), rz_io_t::runprofile, rz_event_free(), RZ_FREE, rz_io_cache_fini(), rz_io_desc_cache_fini_all(), rz_io_desc_fini(), rz_io_map_fini(), rz_list_free(), and w32dbg_wrap_free().
Referenced by rz_io_free().
Definition at line 126 of file io.c.
References free(), and rz_io_fini().
Referenced by download_pdb(), hash_context_run(), rz_core_fini(), rz_diff_io_close(), rz_diff_io_open(), and rzfind_open_file().
Definition at line 114 of file io.c.
References rz_io_t::addrbytes, rz_io_t::event, rz_io_t::map_skyline, NULL, rz_event_new(), rz_io_cache_init(), rz_io_desc_init(), rz_io_map_init(), rz_io_plugin_init(), rz_return_val_if_fail, and rz_skyline_init().
Referenced by rz_io_new().
Definition at line 404 of file io.c.
References rz_io_t::desc, rz_io_plugin_t::listener, and rz_io_desc_t::plugin.
Referenced by rz_core_file_open(), and rz_core_rtr_rap_run().
Definition at line 110 of file io.c.
References rz_io_init(), and RZ_NEW0.
Referenced by download_pdb(), hash_context_run(), rz_core_init(), rz_diff_io_open(), and rzfind_open_file().
Definition at line 338 of file io.c.
References addr, rz_io_t::cached, fd_read_at_wrap(), rz_io_t::ff, len, memset(), on_map_skyline(), rz_io_t::Oxff, rz_io_cache_read(), rz_io_pread_at(), RZ_PERM_R, rz_return_val_if_fail, and rz_io_t::va.
Referenced by core_recover_golang_functions_go_1_16(), core_recover_golang_functions_go_1_18(), core_recover_golang_functions_go_1_2(), decode_from_table(), decode_ldr_set_addr(), GH(), go_offset(), op_at_phys(), read_at_kernel_virtual(), recover_string_at(), rizin_compare_words(), rz_cmd_cmp_hex_block_handler(), rz_cmd_cmp_hex_block_hexdiff_handler(), rz_cmd_cmp_hex_diff_lines_handler(), rz_cmd_heap_chunks_print_handler(), rz_core_analysis_recover_golang_functions(), rz_core_analysis_resolve_golang_strings(), rz_core_cmp_disasm(), rz_core_cmp_mem_data(), rz_core_cmp_mem_mem(), rz_core_cmpwatch_add(), rz_core_cmpwatch_update(), rz_core_transform_op(), rz_core_write_duplicate_at(), rz_heap_tcache_content(), and type_match().
Definition at line 156 of file io.c.
References desc, NULL, rz_io_desc_size(), rz_io_map_new(), rz_io_open_nomap(), and rz_return_val_if_fail.
Referenced by rz_open_binary_file_handler().
RZ_API RzIODesc* rz_io_open_at | ( | RzIO * | io, |
const char * | uri, | ||
int | perm, | ||
int | mode, | ||
ut64 | at, | ||
RZ_NULLABLE RZ_OUT RzIOMap ** | map | ||
) |
Open a file and directly map it at the given offset.
This executes both rz_io_open_nomap() and rz_io_map_new() and returns their results without updating the skyline.
uri | file uri to open |
at | where to map the file |
map | optionally returns the created RzIOMap |
Definition at line 177 of file io.c.
References desc, io_map_new(), regress::m, map(), NULL, rz_io_desc_size(), rz_io_map_new(), rz_io_open_nomap(), rz_return_val_if_fail, ut64(), and UT64_MAX.
Referenced by io_create_mem_map(), open_nobin_file(), and rz_io_bind().
Definition at line 133 of file io.c.
References b, desc, free(), PFMT64d, rz_buf_data(), rz_buf_size(), rz_io_desc_write(), rz_io_open_nomap(), rz_str_newf(), autogen_x86imm::tmp, and ut64().
Referenced by handle_tmp_desc(), and rz_core_cmd_subst_i().
Definition at line 201 of file io.c.
References rz_io_plugin_t::close, desc, rz_io_t::desc, rz_io_t::files, NULL, rz_io_plugin_t::open_many, rz_io_desc_add(), rz_io_plugin_resolve(), rz_return_val_if_fail, and strdup().
Referenced by rz_core_file_open_many().
Definition at line 145 of file io.c.
References rz_io_t::autofd, desc, rz_io_t::desc, NULL, rz_io_desc_open(), and rz_return_val_if_fail.
Referenced by add_map(), hash_context_create_desc_io_stdin(), hash_context_create_desc_io_string(), hash_context_run(), perform_mapped_file_yank(), reopen_in_malloc_cb(), rz_core_file_open(), rz_core_rtr_rap_run(), rz_diff_io_open(), rz_io_bind(), rz_io_open(), rz_io_open_at(), rz_io_open_buffer(), rz_io_reopen(), and rzfind_open_file().
Definition at line 533 of file io.c.
References map(), rz_io_map_get_paddr(), and UT64_MAX.
Referenced by annotated_hexdump(), rz_cmd_help(), rz_io_bind(), and rz_print_hexdump_bits_handler().
Definition at line 269 of file io.c.
References rz_io_t::desc, rz_io_t::ff, len, memset(), rz_io_t::Oxff, rz_io_desc_read_at(), and rz_return_val_if_fail.
Referenced by basefind_create_pointer_map(), calculate_decrypt(), calculate_encrypt(), calculate_hash(), find_next_diff(), find_prev_diff(), rz_core_bin_create_digests(), rz_diff_draw_tui(), rz_diff_slurp_file(), rz_io_desc_cache_list(), rz_io_extend_at(), rz_io_nread_at(), rz_io_read_at(), rz_io_read_at_mapped(), and rzfind_open_file().
Definition at line 277 of file io.c.
References rz_io_t::desc, len, rz_io_desc_write_at(), and rz_return_val_if_fail.
Referenced by __desc_cache_commit_cb(), hash_context_create_desc_io_stdin(), hash_context_create_desc_io_string(), rz_io_extend_at(), and rz_io_write_at().
Definition at line 300 of file io.c.
References addr, rz_io_t::cached, len, rz_io_cache_read(), rz_io_pread_at(), rz_io_vread_at_mapped(), RZ_PERM_R, rz_return_val_if_fail, and rz_io_t::va.
Referenced by __analysis_esil_function(), __core_cmd_search_asm_byteswap(), __core_cmd_search_asm_infinite(), _analysis_calls(), _cb_hit(), cmd_aea(), cmd_debug_backtrace(), cmd_p_minus_e(), cmd_print_bars(), cmd_print_pxA(), cmd_write_bits(), core_analysis_graph_construct_nodes(), core_walk_function_blocks(), disassembly_as_table(), do_analysis_search(), do_debug_trace_calls(), do_ref_search(), do_section_search(), do_string_search(), do_syscall_search(), ds_print_ptr(), ds_show_refs(), dump_maps(), esilbreak_mem_read(), func_walk_blocks(), get_ptr(), get_ptr_ble(), getpcfromstack(), graph_construct_nodes(), ioMemcpy(), is_string_at(), jemalloc_get_bins(), jemalloc_get_chunks(), jemalloc_print_narenas(), meta_string_8bit_add(), myregwrite(), num_callback(), objc_build_refs(), perform_mapped_file_yank(), prevop_addr(), print_cmd_analysis_after_traps_print(), print_double_linked_list_bin_graph(), print_double_linked_list_bin_simple(), print_format_values(), print_heap_chunk(), print_malloc_info(), print_rop(), propagate_types_among_used_variables(), readDword(), readQword(), rz_analysis_try_get_fcn(), rz_analysis_xrefs_from_list_handler(), rz_cmd_analysis(), rz_cmd_debug_step_prog_handler(), rz_cmd_disassemble_ropchain_handler(), rz_cmd_disassembly_basic_block_as_text_json_handler(), rz_cmd_disassembly_basic_block_handler(), rz_cmd_disassembly_function_handler(), rz_cmd_print(), rz_core_analysis_bytes(), rz_core_analysis_data(), rz_core_analysis_esil(), rz_core_analysis_esil_emulate(), rz_core_analysis_hasrefs_to_depth(), rz_core_analysis_hint_set_offset(), rz_core_analysis_name(), rz_core_analysis_op(), rz_core_analysis_read_at(), rz_core_analysis_rename(), rz_core_analysis_search(), rz_core_analysis_search_xrefs(), rz_core_arg_get(), rz_core_asm_back_disassemble(), rz_core_asm_back_disassemble_all(), rz_core_asm_bwdisassemble(), rz_core_asm_strsearch(), rz_core_bin_export_info(), rz_core_bin_whole_strings(), rz_core_block_read(), rz_core_debug_step_skip(), rz_core_disasm_instruction(), rz_core_dump(), rz_core_esil_step(), rz_core_link_stroff(), rz_core_op_analysis(), rz_core_op_str(), rz_core_print_disasm(), rz_core_print_disasm_all(), rz_core_print_dump_str(), rz_core_print_function_disasm_json(), rz_core_print_hexdump_byline_str(), rz_core_print_hexdump_diff_str(), rz_core_print_hexdump_or_hexdiff_str(), rz_core_rtr_gdb_cb(), rz_core_search_cb(), rz_core_search_prelude(), rz_core_search_rop(), rz_core_shift_block(), rz_core_syscall_as_string(), rz_core_visual_asm(), rz_core_yank(), rz_core_yank_string(), rz_heap_bin_content(), rz_heap_chunks_list(), rz_heap_fastbin_content(), rz_heap_update_main_arena(), rz_io_bind(), rz_io_cache_write(), rz_io_read(), rz_io_read_i(), rz_io_shift(), rz_open_malloc_handler(), rz_print_byte_bitstream_handler(), rz_print_hexdump_hexless_words_handler(), rz_write_from_io_xchg_handler(), search_hash(), search_similar_pattern_in(), step_until_inst(), step_until_optype(), stringAt(), tcache_chunk_size(), and tcache_read().
Definition at line 318 of file io.c.
References addr, rz_io_t::cached, fd_read_at_wrap(), rz_io_t::ff, len, memset(), on_map_skyline(), rz_io_t::Oxff, rz_io_cache_read(), rz_io_pread_at(), RZ_PERM_R, rz_return_val_if_fail, and rz_io_t::va.
Referenced by read_ahead(), rz_core_esil_step(), rz_core_search_value_in_range(), and rz_core_write_value_inc_at().
Definition at line 231 of file io.c.
References rz_io_plugin_t::close, fd, rz_io_desc_t::fd, rz_io_desc_t::plugin, rz_io_desc_t::referer, rz_io_desc_close(), rz_io_desc_del(), rz_io_desc_exchange(), rz_io_desc_get(), rz_io_open_nomap(), and rz_io_desc_t::uri.
Referenced by rz_core_file_reopen_debug(), rz_core_io_file_open(), and rz_core_io_file_reopen().
Definition at line 418 of file io.c.
References rz_io_t::desc, rz_io_desc_t::fd, rz_io_map_t::id, rz_io_map_t::itv, maps(), rz_io_desc_resize(), rz_io_fd_size(), rz_io_map_get_for_fd(), rz_io_map_resize(), rz_list_free(), rz_interval_t::size, and ut64().
Referenced by file_resize(), and rz_io_extend_at().
Definition at line 632 of file io.c.
References rz_io_t::desc, rz_io_t::off, rz_io_desc_seek(), RZ_IO_SEEK_CUR, RZ_IO_SEEK_END, and RZ_IO_SEEK_SET.
Referenced by perform_mapped_file_yank(), rz_core_seek(), and rzfind_open_file().
Set a mask that is used on all following write operations.
io | Reference to RzIo instance |
mask | Mask to apply |
len | Number of bytes in the mask |
Definition at line 517 of file io.c.
References free(), len, malloc(), mask, memcpy(), NULL, rz_return_val_if_fail, rz_io_t::write_mask, and rz_io_t::write_mask_len.
Referenced by rz_write_mask_reset_handler(), and rz_write_mask_set_handler().
Definition at line 596 of file io.c.
References calloc(), chunksize, rz_io_t::desc, test_evm::end, free(), rz_io_t::off, rz_io_desc_seek(), rz_io_read_at(), RZ_IO_SEEK_SET, rz_io_write_at(), rz_num_abs(), src, start, and ut64().
Referenced by file_resize().
Definition at line 399 of file io.c.
References rz_io_t::desc, and rz_io_desc_size().
Referenced by basefind_create_pointer_map(), core_search_for_xrefs_in_boundaries(), flagbar_foreach(), perform_mapped_file_yank(), rz_basefind(), rz_core_get_boundaries_prot(), rz_core_shift_block(), rz_core_visual_title(), and rzfind_open_file().
Definition at line 411 of file io.c.
References cmd, rz_io_t::desc, NULL, rz_io_desc_t::plugin, RZ_STR_ISNOTEMPTY, and rz_io_plugin_t::system.
Referenced by __rap_continue(), __rap_reg_profile(), __rap_reg_read(), __rap_step(), cb_dbg_gdb_page_size(), cb_dbg_gdb_retries(), handle_ts_stmt(), rz_cmd_remote(), rz_core_cmd_subst_i(), rz_core_debug_attach(), rz_debug_select(), rz_io_bind(), and rz_io_system_run_oldhandler().
Definition at line 541 of file io.c.
References delta, map(), rz_io_map_get(), st64, and UT64_MAX.
Referenced by add_new_bin_string(), add_new_func_symbol(), meta_string_guess_add(), rz_cmd_help(), rz_core_meta_pascal_string_add(), and rz_io_bind().
Definition at line 283 of file io.c.
References fd_read_at_wrap(), rz_io_t::ff, len, memset(), on_map_skyline(), rz_io_t::Oxff, RZ_PERM_R, and rz_return_val_if_fail.
Referenced by rz_io_read_at().
Definition at line 291 of file io.c.
References fd_write_at_wrap(), len, on_map_skyline(), and RZ_PERM_W.
Referenced by rz_io_write_at().
Definition at line 358 of file io.c.
References addr, rz_io_t::cached, free(), i, len, rz_io_cache_write(), rz_io_pwrite_at(), rz_io_vwrite_at(), rz_mem_dup(), RZ_PERM_W, rz_return_val_if_fail, rz_io_t::va, rz_io_t::write_mask, and rz_io_t::write_mask_len.
Referenced by ioMemcpy(), op_at_phys(), rz_cmd_debug_dml_handler(), rz_core_shift_block(), rz_core_visual_asm(), rz_core_visual_cmd(), rz_core_write_at(), rz_heap_write_heap_chunk(), rz_io_bind(), rz_io_cache_commit(), rz_io_cache_invalidate(), rz_io_shift(), rz_io_write(), rz_io_write_i(), rz_main_rizin(), rz_write_from_file_handler(), rz_write_from_io_xchg_handler(), rz_write_from_socket_handler(), and rzfind_open_file().
RZ_LIB_VERSION | ( | rz_io | ) |