Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_core.h>
#include <rz_config.h>
#include <rz_demangler.h>
#include <rz_util.h>
#include <rz_list.h>
#include <rz_util/rz_time.h>
#include <rz_basefind.h>
#include "core_private.h"
Go to the source code of this file.
Classes | |
struct | arch_ctx |
Macros | |
#define | is_invalid_address_va(va, vaddr, paddr) (((va) && (vaddr) == UT64_MAX) || (!(va) && (paddr) == UT64_MAX)) |
#define | is_invalid_address_va2(va, vaddr, paddr) (((va) != VA_FALSE && (vaddr) == UT64_MAX) || ((va) == VA_FALSE && (paddr) == UT64_MAX)) |
#define | is_in_range(at, from, sz) ((at) >= (from) && (at) < ((from) + (sz))) |
#define | VA_FALSE 0 |
#define | VA_TRUE 1 |
#define | VA_NOREBASE 2 |
#define | LOAD_BSS_MALLOC 0 |
#define | IS_MODE_SET(mode) ((mode)&RZ_MODE_SET) |
#define | IS_MODE_SIMPLE(mode) ((mode)&RZ_MODE_SIMPLE) |
#define | IS_MODE_SIMPLEST(mode) ((mode)&RZ_MODE_SIMPLEST) |
#define | IS_MODE_JSON(mode) ((mode)&RZ_MODE_JSON) |
#define | IS_MODE_RZCMD(mode) ((mode)&RZ_MODE_RIZINCMD) |
#define | IS_MODE_EQUAL(mode) ((mode)&RZ_MODE_EQUAL) |
#define | IS_MODE_NORMAL(mode) (!(mode)) |
#define | IS_MODE_CLASSDUMP(mode) ((mode)&RZ_MODE_CLASSDUMP) |
#define | PAIR_WIDTH "9" |
#define | bprintf |
#define | STR(x) (x) ? (x) : "" |
#define | wrap_mode(header, default_mode, method) |
#define | CASE(T) case RZ_BIN_RELOC_##T: return (T) / 8 |
#define | MAXFLAG_LEN_DEFAULT 128 |
#define | CASE(T) case RZ_BIN_RELOC_##T: return reloc->additive ? "ADD_" #T : "SET_" #T |
#define | CXX_BIN_VISIBILITY_FLAGS (RZ_BIN_METH_PUBLIC | RZ_BIN_METH_PRIVATE | RZ_BIN_METH_PROTECTED) |
#define bprintf |
#define CASE | ( | T | ) | case RZ_BIN_RELOC_##T: return reloc->additive ? "ADD_" #T : "SET_" #T |
#define CXX_BIN_VISIBILITY_FLAGS (RZ_BIN_METH_PUBLIC | RZ_BIN_METH_PRIVATE | RZ_BIN_METH_PROTECTED) |
#define IS_MODE_CLASSDUMP | ( | mode | ) | ((mode)&RZ_MODE_CLASSDUMP) |
#define IS_MODE_EQUAL | ( | mode | ) | ((mode)&RZ_MODE_EQUAL) |
#define IS_MODE_JSON | ( | mode | ) | ((mode)&RZ_MODE_JSON) |
#define IS_MODE_RZCMD | ( | mode | ) | ((mode)&RZ_MODE_RIZINCMD) |
#define IS_MODE_SET | ( | mode | ) | ((mode)&RZ_MODE_SET) |
#define IS_MODE_SIMPLE | ( | mode | ) | ((mode)&RZ_MODE_SIMPLE) |
#define IS_MODE_SIMPLEST | ( | mode | ) | ((mode)&RZ_MODE_SIMPLEST) |
#define wrap_mode | ( | header, | |
default_mode, | |||
method | |||
) |
|
static |
Definition at line 49 of file cbin.c.
References a, arg(), b, malloc(), NULL, and rz_return_val_if_fail.
Referenced by construct_symbol_flagname().
|
static |
Definition at line 340 of file cbin.c.
References rz_cmd_state_output_t::d, free(), rz_cmd_state_output_t::pj, pj_raw(), pj_string(), rz_cmd_state_output_free(), rz_cons_printf(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_LONG_JSON, RZ_OUTPUT_MODE_TABLE, rz_table_tostring(), and s.
Referenced by rz_core_bin_print().
|
static |
Definition at line 356 of file cbin.c.
References rz_cmd_state_output_t::d, header, rz_cmd_state_output_t::mode, rz_cmd_state_output_t::pj, pj_k(), rz_cmd_state_output_init(), rz_cons_printf(), RZ_NEW, RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_LONG_JSON, RZ_OUTPUT_MODE_STANDARD, RZ_OUTPUT_MODE_TABLE, and toupper.
Referenced by rz_core_bin_print().
|
static |
Definition at line 810 of file cbin.c.
References addr, desc, fd, find_reusable_file(), free(), rz_bin_file_t::id, rz_core_t::io, io_create_mem_map(), map(), rz_io_map_t::name, rz_io_desc_t::perm, PFMT32u, prefix, rz_core_io_map_info_new(), rz_io_desc_get(), rz_io_map_add_batch(), rz_io_open_nomap(), RZ_PERM_X, rz_pvector_push(), rz_str_newf(), rz_io_map_t::user, ut64(), and UT64_ADD_OVFCHK.
Referenced by rz_core_bin_apply_maps().
|
static |
Definition at line 3721 of file cbin.c.
References c, f, fn, free(), rz_bin_object_t::lang, n, rz_bin_file_t::o, objc_name_toc(), objc_type_toc(), PFMT64x, r, rz_bin_cur(), RZ_BIN_LANGUAGE_C, RZ_BIN_LANGUAGE_CXX, RZ_BIN_LANGUAGE_OBJC, rz_cons_printf(), rz_core_bin_class_build_flag_name(), rz_core_bin_field_build_flag_name(), rz_core_bin_method_build_flag_name(), rz_core_bin_super_build_flag_name(), and rz_bin_symbol_t::vaddr.
Referenced by rz_core_bin_classes_print().
|
static |
Definition at line 1731 of file cbin.c.
References rz_core_t::analysis, rz_analysis_t::bits, rz_core_t::config, info(), lines(), NULL, rz_bin_file_t::o, rz_bin_dwarf_debug_abbrev_free(), rz_bin_dwarf_debug_info_free(), rz_bin_dwarf_line_info_free(), RZ_BIN_DWARF_LINE_INFO_MASK_LINES, RZ_BIN_DWARF_LINE_INFO_MASK_OPS, rz_bin_dwarf_loc_free(), rz_bin_dwarf_parse_abbrev(), rz_bin_dwarf_parse_aranges(), rz_bin_dwarf_parse_info(), rz_bin_dwarf_parse_line(), rz_bin_dwarf_parse_loc(), rz_config_get_i(), rz_core_bin_dwarf_print_abbrev_section(), rz_core_bin_dwarf_print_aranges(), rz_core_bin_dwarf_print_debug_info(), rz_core_bin_dwarf_print_line_units(), rz_core_bin_dwarf_print_loc(), rz_core_bin_print_source_line_info(), rz_list_free(), RZ_OUTPUT_MODE_STANDARD, and rz_return_val_if_fail.
Referenced by rz_core_bin_dwarf_print().
Definition at line 4425 of file cbin.c.
References bin_elf_versioninfo_verneed(), bin_elf_versioninfo_versym(), IS_MODE_JSON, pj_end(), pj_o(), and r.
Referenced by bin_versioninfo().
Definition at line 4319 of file cbin.c.
References flags, setup::idx, int, IS_MODE_JSON, NULL, PFMT64x, pj_end(), pj_ka(), pj_ki(), pj_kn(), pj_ks(), pj_o(), r, rz_cons_printf(), sdb_const_get(), sdb_fmt(), sdb_ns_path(), sdb_num_get(), and ut64().
Referenced by bin_elf_versioninfo().
Definition at line 4266 of file cbin.c.
References addr, i, IS_MODE_JSON, key, PFMT64u, PFMT64x, pj_end(), pj_ka(), pj_kn(), pj_ks(), pj_o(), r, rz_cons_printf(), sdb_const_get(), sdb_fmt(), sdb_ns_path(), sdb_num_get(), ut64(), and value.
Referenced by bin_elf_versioninfo().
Definition at line 4436 of file cbin.c.
References IS_MODE_JSON, pj_end(), and pj_o().
Referenced by bin_versioninfo().
|
static |
Definition at line 4919 of file cbin.c.
References mem, rz_bin_mem_t::name, PFMT64x, pj_end(), pj_ki(), pj_kn(), pj_ks(), pj_o(), rz_cons_printf(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_TABLE, rz_str_rwx_i(), rz_table_add_rowf(), and rz_warn_if_reached.
Referenced by rz_core_bin_memory_print().
Definition at line 4152 of file cbin.c.
References calloc(), eprintf, free(), IS_MODE_JSON, NULL, PFMT64x, pj_end(), pj_kn(), pj_ko(), pj_ks(), pj_o(), r, rz_cons_newline(), rz_cons_printf(), rz_str_newf(), rz_str_utf16_to_utf8(), sdb_const_get(), sdb_decode(), sdb_fmt(), sdb_ns_path(), and sdb_num_get().
Referenced by bin_versioninfo().
|
static |
Definition at line 1057 of file cbin.c.
References CASE, and rz_bin_reloc_t::type.
Referenced by reloc_set_flag().
|
static |
Definition at line 1825 of file cbin.c.
References CASE, and rz_bin_reloc_t::type.
Referenced by rz_core_bin_relocs_print().
|
static |
Definition at line 5016 of file cbin.c.
References test_evm::end, found, rz_bin_resource_t::index, rz_bin_resource_t::language, rz_bin_resource_t::name, pj_end(), pj_ki(), pj_kn(), pj_ks(), pj_o(), rz_core_bin_create_digests(), rz_bin_resource_t::size, rz_bin_resource_t::time, rz_bin_resource_t::type, and rz_bin_resource_t::vaddr.
Referenced by rz_core_bin_resources_print().
|
static |
Definition at line 4967 of file cbin.c.
References found, rz_bin_resource_t::index, rz_bin_resource_t::language, rz_bin_resource_t::name, NULL, PFMT64x, rz_cons_printf(), rz_core_bin_create_digests(), rz_num_units(), rz_bin_resource_t::size, rz_bin_resource_t::time, rz_bin_resource_t::type, and rz_bin_resource_t::vaddr.
Referenced by rz_core_bin_resources_print().
|
static |
Definition at line 4995 of file cbin.c.
References found, rz_bin_resource_t::index, rz_bin_resource_t::language, rz_bin_resource_t::name, rz_core_bin_create_digests(), rz_table_add_row_columnsf(), rz_table_add_rowf(), rz_bin_resource_t::size, rz_bin_resource_t::time, rz_bin_resource_t::type, and rz_bin_resource_t::vaddr.
Referenced by rz_core_bin_resources_print().
Definition at line 4133 of file cbin.c.
References rz_core_t::bin, rz_bin_trycatch_t::filter, rz_bin_trycatch_t::from, rz_bin_trycatch_t::handler, setup::idx, PFMT64x, rz_bin_cur(), rz_bin_file_get_trycatch(), rz_cons_printf(), rz_bin_trycatch_t::source, rz_bin_trycatch_t::to, and trycatch().
Referenced by rz_core_bin_trycatch_print().
Definition at line 4444 of file cbin.c.
References bin_elf_versioninfo(), bin_mach0_versioninfo(), bin_pe_versioninfo(), info(), IS_MODE_JSON, pj_end(), pj_o(), r, rz_bin_info_t::rclass, rz_bin_get_info(), and rz_cons_println().
Referenced by rz_core_bin_versions_print().
|
static |
Definition at line 3483 of file cbin.c.
References c, f, free(), n, objc_name_toc(), objc_type_toc(), and rz_cons_printf().
Referenced by rz_core_bin_class_as_source_print().
|
static |
Definition at line 3538 of file cbin.c.
References c, CXX_BIN_VISIBILITY_FLAGS, rz_bin_symbol_t::dname, f, is_known_namespace(), rz_bin_symbol_t::method_flags, rz_bin_symbol_t::name, RZ_BIN_METH_CONST, RZ_BIN_METH_PRIVATE, RZ_BIN_METH_PROTECTED, RZ_BIN_METH_PUBLIC, RZ_BIN_METH_STATIC, RZ_BIN_METH_VIRTUAL, rz_cons_newline(), rz_cons_printf(), rz_list_length(), type, rz_bin_symbol_t::type, ut64(), and UT64_MAX.
Referenced by rz_core_bin_class_as_source_print().
|
static |
Definition at line 3664 of file cbin.c.
References c, demangle_class(), demangle_type(), rz_bin_symbol_t::dname, f, free(), rz_bin_symbol_t::name, NULL, resolve_java_visibility(), rz_cons_newline(), rz_cons_printf(), rz_demangler_java(), rz_str_rchr(), rz_str_replace(), strdup(), autogen_x86imm::tmp, and rz_bin_symbol_t::visibility_str.
Referenced by rz_core_bin_class_as_source_print().
|
static |
Definition at line 3499 of file cbin.c.
References c, rz_bin_symbol_t::dname, f, free(), get_rp(), rz_bin_symbol_t::name, rp, rz_bin_symbol_t::rtype, RZ_BIN_TYPE_METH_STR, rz_cons_printf(), rz_regex_match(), and rz_bin_symbol_t::type.
Referenced by rz_core_bin_class_as_source_print().
|
static |
Definition at line 1078 of file cbin.c.
References PFMT64x, rz_strbuf_append(), rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_new(), and rz_strbuf_set().
Referenced by reloc_set_flag(), and rz_core_bin_relocs_print().
|
static |
Definition at line 1304 of file cbin.c.
References __filterQuotedShell(), free(), len, NULL, R, r, rz_name_filter(), and rz_str_newf().
Referenced by rz_core_sym_name_init().
|
static |
Definition at line 2569 of file cbin.c.
References rz_cons_is_breaked().
Referenced by rz_core_bin_basefind_print().
|
static |
Definition at line 2557 of file cbin.c.
References rz_basefind_info_t::current_address, rz_basefind_info_t::end_address, rz_basefind_info_t::n_threads, rz_basefind_info_t::percentage, PFMT64x, rz_cons_flush(), rz_cons_get_cur_line(), rz_cons_gotoxy(), rz_cons_is_breaked(), rz_cons_printf(), and rz_basefind_info_t::thread_idx.
Referenced by rz_core_bin_basefind_print().
|
static |
Definition at line 4551 of file cbin.c.
References rz_bin_info_t::arch, arch, rz_bin_file_load_options_t::baseaddr, rz_core_t::bin, rz_bin_info_t::bits, bits(), rz_bin_object_t::boffset, rz_core_t::config, rz_bin_file_t::fd, rz_bin_file_t::file, rz_bin_file_t::id, info(), rz_bin_object_t::info, NULL, rz_bin_file_t::o, rz_bin_object_t::obj_size, rz_bin_object_t::opts, PFMT64d, PFMT64x, pj_end(), pj_ki(), pj_kN(), pj_ko(), pj_ks(), pj_o(), rz_bin_get_info(), rz_config_get(), rz_cons_printf(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_STANDARD, RZ_OUTPUT_MODE_TABLE, rz_return_if_fail, rz_table_add_rowf(), rz_warn_if_reached, rz_bin_object_t::size, and rz_bin_file_t::size.
Referenced by rz_core_binfiles_print().
|
static |
Strings for the given file, respecting settings like bin.strings
Definition at line 1692 of file cbin.c.
References rz_bin_plugin_t::name, NULL, r, rz_bin_file_cur_plugin(), rz_bin_get_strings(), rz_config_get_i(), and rz_return_val_if_fail.
Referenced by rz_core_bin_apply_strings().
|
inlinestatic |
Definition at line 3628 of file cbin.c.
References rz_str_replace_ch(), and strdup().
Referenced by classdump_java().
|
inlinestatic |
Definition at line 3641 of file cbin.c.
References rz_demangler_java(), and strdup().
Referenced by classdump_java().
|
static |
Definition at line 2350 of file cbin.c.
References k, pj_ks(), rz_return_val_if_fail, and v.
Referenced by sections_print_json().
|
static |
Definition at line 1839 of file cbin.c.
References baddr(), rz_core_t::bin, entries(), rz_core_t::io, rz_bin_t::is_debugger, NULL, rz_bin_file_t::o, PFMT64x, pj_end(), pj_kn(), pj_ks(), pj_o(), rva(), RZ_BIN_ENTRY_TYPE_PROGRAM, rz_bin_entry_type_string(), rz_bin_get_baddr(), rz_bin_get_laddr(), rz_bin_object_get_entries(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), rz_cons_printf(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_TABLE, rz_table_add_rowf(), rz_warn_if_reached, type, ut64(), UT64_MAX, rz_io_t::va, VA_FALSE, and VA_TRUE.
Referenced by rz_core_bin_entries_print(), and rz_core_bin_initfini_print().
|
static |
Definition at line 751 of file cbin.c.
References desc, rz_core_file_t::extra_files, NULL, rz_pvector_foreach, and rz_return_val_if_fail.
Referenced by add_map(), and io_create_mem_map().
Definition at line 3322 of file cbin.c.
References flags, i, PFMT64x, pj_end(), pj_ka(), pj_s(), rz_bin_get_meth_flag_string(), sdb_fmt(), and ut64().
Referenced by rz_core_bin_class_fields_print(), rz_core_bin_class_methods_print(), and rz_core_bin_classes_print().
Definition at line 2929 of file cbin.c.
References desc, rz_bin_info_t::file, and info().
Referenced by rz_core_file_info_print().
|
static |
Definition at line 1286 of file cbin.c.
References rz_bin_symbol_t::is_imported, RZ_BIN_TYPE_NOTYPE_STR, RZ_BIN_TYPE_OBJECT_STR, and rz_bin_symbol_t::type.
Referenced by rz_core_sym_name_init().
|
static |
|
static |
Definition at line 2342 of file cbin.c.
References rz_core_t::bin, rz_core_t::io, rz_bin_t::is_debugger, rva(), RZ_PERM_R, rz_io_t::va, VA_FALSE, VA_NOREBASE, and VA_TRUE.
Referenced by sections_print_json(), and sections_print_table().
|
static |
Definition at line 1433 of file cbin.c.
References handle_arm_hint().
Referenced by rz_core_bin_apply_symbols().
|
static |
Definition at line 1406 of file cbin.c.
References addr, rz_core_t::analysis, rz_bin_info_t::bits, bits(), info(), rz_bin_object_t::info, rva(), rz_analysis_hint_set_bits(), and ut64().
Referenced by handle_arm_entry(), and handle_arm_symbol().
|
static |
Definition at line 1387 of file cbin.c.
References addr, rz_core_t::analysis, rz_core_t::bin, rz_bin_symbol_t::name, rz_bin_symbol_t::paddr, rva(), rz_analysis_hint_set_bits(), RZ_LOG_WARN, ut64(), rz_bin_symbol_t::vaddr, and rz_bin_t::verbose.
Referenced by rz_core_bin_apply_symbols().
|
static |
Definition at line 1429 of file cbin.c.
References rz_bin_symbol_t::bits, handle_arm_hint(), rz_bin_symbol_t::paddr, and rz_bin_symbol_t::vaddr.
Referenced by rz_core_bin_apply_symbols().
|
static |
Create null-map for excessive vsize over psize.
Definition at line 769 of file cbin.c.
References desc, find_reusable_file(), free(), map(), rz_io_map_t::name, NULL, PFMT64u, rz_core_io_map_info_new(), rz_io_desc_close(), rz_io_map_add_batch(), rz_io_open_at(), rz_pvector_push(), rz_return_val_if_fail, rz_str_newf(), rz_io_map_t::user, and ut64().
Referenced by add_map().
|
static |
Definition at line 1716 of file cbin.c.
References rz_bin_info_t::arch, rz_bin_object_t::info, rz_bin_section_t::perm, RZ_PERM_X, rz_return_val_if_fail, and rz_bin_object_t::sections.
Referenced by rz_core_bin_info_print().
|
static |
Definition at line 1053 of file cbin.c.
References is_file_symbol(), and r.
Referenced by rz_core_bin_apply_relocs().
|
static |
Definition at line 1044 of file cbin.c.
References RZ_BIN_TYPE_FILE_STR, and s.
Referenced by is_file_reloc(), and rz_core_bin_apply_symbols().
Definition at line 1925 of file cbin.c.
References addr, and RZ_BETWEEN.
Referenced by rz_core_bin_imports_print(), rz_core_bin_sections_print(), rz_core_bin_segments_print(), and symbols_print().
Definition at line 688 of file cbin.c.
References RZ_BIN_ENTRY_TYPE_FINI, RZ_BIN_ENTRY_TYPE_INIT, and RZ_BIN_ENTRY_TYPE_PREINIT.
Referenced by rz_core_bin_apply_entry().
Definition at line 3530 of file cbin.c.
Referenced by classdump_cpp().
|
static |
Definition at line 1049 of file cbin.c.
References is_section_symbol(), and r.
Referenced by rz_core_bin_apply_relocs().
|
static |
Definition at line 1032 of file cbin.c.
References RZ_BIN_TYPE_SECTION_STR, and s.
Referenced by is_section_reloc(), and rz_core_bin_apply_symbols().
|
static |
Definition at line 1040 of file cbin.c.
References RZ_BIN_TYPE_SPECIAL_SYM_STR, and s.
Referenced by rz_core_bin_apply_symbols().
|
static |
Definition at line 1006 of file cbin.c.
References addr, rz_bin_info_t::bits, info(), rz_bin_object_t::info, map(), NULL, r, rz_bin_reloc_size(), rz_io_map_get(), RZ_PERM_X, and rz_return_val_if_fail.
Referenced by rz_core_bin_apply_relocs().
|
static |
Definition at line 3473 of file cbin.c.
References n, p, rz_str_lchr(), s, and strdup().
Referenced by bin_class_print_rizin(), and classdump_c().
|
static |
Definition at line 3399 of file cbin.c.
References a, b, eprintf, rz_str_newf(), rz_str_startswith(), s, and strdup().
Referenced by bin_class_print_rizin(), and classdump_c().
|
static |
Definition at line 5180 of file cbin.c.
References rz_bin_info_t::cpu, rz_bin_info_t::features, info(), pj_end(), pj_ki(), pj_kn(), pj_ks(), pj_o(), rz_cons_printf(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_TABLE, rz_strf, rz_table_add_rowf(), and rz_warn_if_reached.
Referenced by rz_core_bin_archs_print().
|
static |
Definition at line 1105 of file cbin.c.
References bin_reloc_size(), construct_reloc_name(), free(), NULL, rz_flag_item_t::offset, prefix, r, rz_bin_demangle(), rz_config_get(), rz_config_get_i(), rz_flag_get(), rz_flag_item_set_realname(), RZ_FLAG_NAME_SIZE, rz_flag_set_next(), rz_name_filter(), RZ_STR_ISEMPTY, and snprintf.
Referenced by set_bin_relocs().
Definition at line 4618 of file cbin.c.
References flags, i, rz_bin_get_meth_flag_string(), and rz_strbuf_appendf().
Referenced by rz_core_bin_field_build_flag_name(), and rz_core_bin_method_build_flag_name().
|
static |
Definition at line 77 of file cbin.c.
References rz_bin_object_get_vaddr(), VA_NOREBASE, and VA_TRUE.
Referenced by bin_pe_rva_to_paddr(), bin_pe_rva_to_va(), entries_initfini_print(), find_section(), get_section(), get_section_addr(), handle_arm_hint(), handle_arm_special_symbol(), maps(), read_entry(), read_image_metadata_tilde_header(), rva_to_paddr(), rz_core_bin_apply_entry(), rz_core_bin_apply_imports(), rz_core_bin_apply_maps(), rz_core_bin_apply_relocs(), rz_core_bin_apply_sections(), rz_core_bin_apply_strings(), rz_core_bin_apply_symbols(), rz_core_bin_imports_print(), rz_core_bin_relocs_print(), RZ_PACKED(), rz_sys_aslr(), set_bin_relocs(), strings_print(), and symbols_print().
Definition at line 311 of file cbin.c.
References rz_bin_info_t::arch, arch, baseaddr, rz_bin_info_t::bits, bits(), rz_bin_info_t::cpu, info(), rz_bin_object_t::info, NULL, rz_bin_file_t::o, r, rz_asm_use(), rz_bin_get_baddr(), rz_config_set(), rz_config_set_i(), rz_core_bin_apply_info(), rz_core_bin_set_cur(), rz_return_val_if_fail, sdb_num_add(), and ut64().
Referenced by core_bin_reload(), core_file_do_load_for_debug(), core_file_do_load_for_io_plugin(), map_multi_dex(), rebase_helper(), rz_core_bin_raise(), rz_core_bin_set_arch_bits(), rz_core_binfiles_delete(), rz_main_rizin(), rz_open_binary_add_handler(), rz_open_binary_file_handler(), and rz_open_binary_rebase_handler().
Definition at line 1552 of file cbin.c.
References c, rz_bin_object_t::classes, rz_core_t::config, test_evm::cs, rz_core_t::flags, fn, free(), NULL, rz_bin_file_t::o, rz_config_get_b(), rz_core_bin_method_build_flag_name(), rz_flag_set(), RZ_FLAGS_FS_CLASSES, rz_name_filter(), rz_return_val_if_fail, rz_str_newf(), and rz_bin_symbol_t::vaddr.
Referenced by rz_core_bin_apply_info().
Definition at line 582 of file cbin.c.
References rz_bin_info_t::arch, rz_bin_info_t::big_endian, rz_bin_info_t::bits, rz_bin_info_t::cpu, rz_bin_info_t::dbg_info, rz_bin_info_t::default_cc, rz_bin_info_t::features, free(), info(), rz_bin_object_t::info, rz_bin_info_t::lang, rz_bin_file_t::o, rz_bin_info_t::os, r, rz_bin_info_t::rclass, rz_analysis_archinfo(), RZ_ANALYSIS_ARCHINFO_ALIGN, rz_analysis_cc_exist(), RZ_BIN_DBG_STRIPPED, rz_config_set(), rz_config_set_i(), rz_core_analysis_cc_init(), rz_core_analysis_type_init(), rz_file_exists(), rz_file_path_join(), RZ_FLAG_NAME_SIZE, rz_path_system(), rz_return_val_if_fail, RZ_SDB_TYPES, rz_str_get(), sdb_concat_by_path(), snprintf, cmd_descs_generate::str, and v.
Referenced by rz_core_bin_apply_info().
Definition at line 654 of file cbin.c.
References rz_core_t::analysis, rz_analysis_t::bits, rz_core_t::config, info(), lines(), rz_bin_object_t::lines, NULL, rz_bin_file_t::o, rz_analysis_dwarf_process_info(), rz_bin_dwarf_debug_abbrev_free(), rz_bin_dwarf_debug_info_free(), RZ_BIN_DWARF_LINE_INFO_MASK_LINES, rz_bin_dwarf_loc_free(), rz_bin_dwarf_parse_abbrev(), rz_bin_dwarf_parse_info(), rz_bin_dwarf_parse_line(), rz_bin_dwarf_parse_loc(), rz_config_get_i(), and rz_return_val_if_fail.
Referenced by rz_core_bin_apply_info().
Definition at line 699 of file cbin.c.
References rz_core_t::analysis, entries(), rz_bin_object_t::entries, rz_core_t::flags, i, is_initfini(), is_invalid_address_va, NULL, rz_bin_file_t::o, rva(), RZ_BIN_ENTRY_TYPE_FINI, RZ_BIN_ENTRY_TYPE_INIT, RZ_BIN_ENTRY_TYPE_PREINIT, rz_bin_entry_type_string(), rz_core_seek(), RZ_FLAG_NAME_SIZE, rz_flag_set(), RZ_FLAGS_FS_SYMBOLS, rz_meta_set(), RZ_META_TYPE_DATA, rz_return_val_if_fail, snprintf, cmd_descs_generate::str, type, ut64(), and UT64_MAX.
Referenced by rz_core_bin_apply_info().
Definition at line 1255 of file cbin.c.
References addr, rz_core_t::analysis, rz_bin_info_t::bits, imports(), rz_bin_object_t::imports, info(), rz_bin_object_t::info, is_invalid_address_va, NULL, rz_bin_file_t::o, rz_bin_symbol_t::paddr, rva(), rz_bin_object_get_symbol_of_import(), rz_meta_set(), RZ_META_TYPE_DATA, rz_return_val_if_fail, ut64(), VA_FALSE, VA_TRUE, and rz_bin_symbol_t::vaddr.
Referenced by rz_core_bin_apply_info().
Definition at line 261 of file cbin.c.
References rz_bin_info_t::has_va, info(), rz_bin_object_t::info, mask, NULL, rz_bin_file_t::o, r, rz_config_get_b(), rz_core_bin_apply_classes(), rz_core_bin_apply_config(), rz_core_bin_apply_dwarf(), rz_core_bin_apply_entry(), rz_core_bin_apply_imports(), rz_core_bin_apply_main(), rz_core_bin_apply_maps(), rz_core_bin_apply_relocs(), rz_core_bin_apply_resources(), rz_core_bin_apply_sections(), rz_core_bin_apply_strings(), rz_core_bin_apply_symbols(), and rz_return_val_if_fail.
Referenced by get_bin_info(), rz_core_bin_apply_all_info(), and rz_core_bind().
Definition at line 637 of file cbin.c.
References addr, rz_bin_file_t::o, rz_bin_addr_t::paddr, r, rz_bin_object_addr_with_base(), rz_bin_object_get_special_symbol(), RZ_BIN_SPECIAL_SYMBOL_MAIN, rz_flag_set(), RZ_FLAGS_FS_SYMBOLS, rz_return_val_if_fail, ut64(), and rz_bin_addr_t::vaddr.
Referenced by rz_core_bin_apply_info().
Definition at line 887 of file cbin.c.
References add_map(), addr, desc, rz_bin_file_t::fd, rz_core_t::io, map(), maps(), rz_bin_object_t::maps, rz_bin_file_t::o, rva(), rz_core_file_find_by_fd(), rz_io_desc_get(), rz_io_desc_is_dbg(), RZ_PERM_R, rz_return_val_if_fail, ut64(), VA_FALSE, VA_NOREBASE, and VA_TRUE.
Referenced by rz_core_bin_apply_info().
Definition at line 1206 of file cbin.c.
References addr, rz_core_t::analysis, rz_core_t::flags, i, is_file_reloc(), is_invalid_address_va, is_section_reloc(), meta_for_reloc(), NULL, rz_bin_file_t::o, rz_bin_reloc_t::paddr, relocs(), rz_bin_object_t::relocs, rva(), rz_bin_object_patch_relocs(), rz_bin_reloc_has_target(), RZ_FLAGS_FS_RELOCS, RZ_FREE, rz_meta_set(), RZ_META_TYPE_DATA, rz_return_val_if_fail, sdb_free(), set_bin_relocs(), rz_bin_reloc_t::target_vaddr, ut64(), VA_TRUE, and rz_bin_reloc_t::vaddr.
Referenced by rz_core_bin_apply_info().
Definition at line 1596 of file cbin.c.
References rz_core_t::flags, info(), rz_bin_object_t::info, int, key, NULL, rz_bin_file_t::o, rz_bin_info_t::rclass, rz_flag_set(), RZ_FLAGS_FS_RESOURCES, rz_return_val_if_fail, rz_strf, rz_core_t::sdb, sdb_get(), sdb_ns_path(), sdb_num_get(), and ut64().
Referenced by rz_core_bin_apply_info().
Definition at line 926 of file cbin.c.
References addr, rz_core_t::analysis, rz_core_t::bin, rz_core_t::flags, rz_core_t::io, is_invalid_address_va2, rz_bin_file_t::o, PFMT64d, PFMT64x, rz_bin_t::prefix, rva(), rz_core_cmdf(), rz_flag_set(), RZ_FLAGS_FS_SECTIONS, RZ_FLAGS_FS_SEGMENTS, RZ_FREE, rz_meta_set(), RZ_META_TYPE_COMMENT, rz_name_filter(), RZ_PERM_R, rz_return_val_if_fail, rz_str_newf(), section_perms_str(), sections(), rz_bin_object_t::sections, section::size, cmd_descs_generate::str, type, ut64(), rz_io_t::va, VA_FALSE, VA_NOREBASE, and VA_TRUE.
Referenced by rz_core_bin_apply_info().
Definition at line 531 of file cbin.c.
References core_bin_strings(), free(), rz_bin_info_t::has_va, rz_bin_object_t::info, is_invalid_address_va, rz_bin_string_t::length, NULL, rz_bin_file_t::o, rz_bin_string_t::paddr, r, rva(), rz_bin_string_filter(), rz_cons_break_pop(), rz_cons_break_push(), rz_cons_is_breaked(), rz_flag_set(), RZ_FLAGS_FS_STRINGS, rz_meta_set_with_subtype(), RZ_META_TYPE_STRING, rz_name_filter(), rz_return_val_if_fail, rz_str_newf(), rz_bin_string_t::size, cmd_descs_generate::str, strdup(), rz_bin_string_t::string, rz_bin_string_t::type, ut64(), VA_FALSE, VA_TRUE, and rz_bin_string_t::vaddr.
Referenced by rz_core_bin_apply_info().
Definition at line 1447 of file cbin.c.
References addr, rz_core_t::analysis, rz_bin_info_t::arch, rz_flag_t::base, rz_core_t::bin, bool, rz_bin_sym_names_t::classname, rz_flag_item_t::comment, rz_core_t::config, count, rz_flag_item_t::demangled, rz_bin_sym_names_t::demflag, rz_bin_sym_names_t::demname, rz_bin_object_t::entries, eprintf, rz_core_t::flags, fn, free(), handle_arm_entry(), handle_arm_special_symbol(), handle_arm_symbol(), info(), rz_bin_object_t::info, is_arm(), is_file_symbol(), is_invalid_address_va, is_section_symbol(), is_special_symbol(), rz_analysis_t::meta_spaces, rz_bin_sym_names_t::methflag, rz_bin_sym_names_t::methname, n, rz_bin_symbol_t::name, rz_bin_sym_names_t::nameflag, NULL, rz_bin_file_t::o, rz_flag_item_t::offset, rz_bin_symbol_t::paddr, rz_bin_t::prefix, rva(), rz_bin_get_symbols(), rz_config_get(), rz_config_get_b(), rz_core_sym_name_fini(), rz_core_sym_name_init(), rz_flag_get(), rz_flag_item_set_comment(), rz_flag_item_set_realname(), rz_flag_set(), rz_flag_unset(), RZ_FLAGS_FS_SYMBOLS, RZ_FREE, rz_meta_set(), RZ_META_TYPE_COMMENT, rz_name_filter(), rz_return_val_if_fail, rz_spaces_pop(), rz_spaces_push(), rz_str_newf(), select_flag_space(), rz_bin_symbol_t::size, strdup(), symbols(), ut64(), and rz_bin_symbol_t::vaddr.
Referenced by rz_core_bin_apply_info().
RZ_API bool rz_core_bin_archs_print | ( | RZ_NONNULL RzBin * | bin, |
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 5217 of file cbin.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_object_t::boffset, rz_bin_file_t::curxtr, rz_bin_info_t::head_flag, info(), rz_bin_object_t::info, rz_bin_info_t::machine, rz_bin_xtr_metadata_t::machine, rz_bin_xtr_extract_t::metadata, NULL, rz_bin_file_t::o, rz_bin_object_t::obj_size, rz_bin_xtr_extract_t::offset, print_arch(), rz_bin_cur(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), rz_return_val_if_fail, rz_bin_xtr_extract_t::size, and rz_bin_file_t::xtr_data.
Referenced by rz_cmd_info_archs_handler(), and rz_main_rz_bin().
RZ_API bool rz_core_bin_basefind_print | ( | RzCore * | core, |
ut32 | pointer_size, | ||
RzCmdStateOutput * | state | ||
) |
Definition at line 2573 of file cbin.c.
References rz_basefind_t::candidate, rz_core_t::config, core_basefind_check_ctrl_c(), core_basefind_progess_status(), int, NULL, options, PFMT64x, pj_end(), pj_kn(), pj_o(), rz_basefind(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), rz_config_get_b(), rz_config_get_i(), rz_cons_get_cur_line(), rz_cons_gotoxy(), rz_cons_printf(), rz_list_free(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_TABLE, rz_return_val_if_fail, rz_table_add_rowf(), rz_th_request_physical_cores(), rz_warn_if_reached, and rz_basefind_t::score.
Referenced by rz_basefind_compute_handler(), and rz_core_bin_print().
RZ_API bool rz_core_bin_class_as_source_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
const char * | class_name | ||
) |
Definition at line 3773 of file cbin.c.
References c, classdump_c(), classdump_cpp(), classdump_java(), classdump_objc(), test_evm::cs, found, RZ_BIN_LANGUAGE_BLOCKS, RZ_BIN_LANGUAGE_C, RZ_BIN_LANGUAGE_CXX, RZ_BIN_LANGUAGE_DART, RZ_BIN_LANGUAGE_GROOVY, RZ_BIN_LANGUAGE_JAVA, RZ_BIN_LANGUAGE_KOTLIN, RZ_BIN_LANGUAGE_OBJC, RZ_BIN_LANGUAGE_SWIFT, rz_bin_object_get_classes(), and rz_return_val_if_fail.
Referenced by classes_as_source_print(), and rz_cmd_info_class_as_source_handler().
RZ_API RZ_OWN char* rz_core_bin_class_build_flag_name | ( | RZ_NONNULL RzBinClass * | cls | ) |
Returns the flag name of a class.
Definition at line 4634 of file cbin.c.
References cls(), free(), NULL, rz_name_filter(), rz_return_val_if_fail, rz_str_newf(), rz_str_replace_ch(), and strdup().
Referenced by bin_class_print_rizin().
RZ_API bool rz_core_bin_class_fields_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state, | ||
const char * | class_name | ||
) |
Definition at line 3814 of file cbin.c.
References c, test_evm::cs, f, flags_to_json(), free(), regress::m, NULL, PFMT64x, pj_end(), pj_kN(), pj_ks(), pj_o(), rz_bin_object_get_classes(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), rz_cons_printf(), rz_core_bin_method_flags_str(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_QUIETEST, RZ_OUTPUT_MODE_TABLE, rz_return_val_if_fail, rz_table_add_rowf(), and rz_warn_if_reached.
Referenced by rz_cmd_info_class_fields_handler().
RZ_API bool rz_core_bin_class_methods_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state, | ||
const char * | class_name | ||
) |
Definition at line 3881 of file cbin.c.
References c, test_evm::cs, rz_bin_symbol_t::dname, flags_to_json(), free(), regress::m, rz_bin_symbol_t::method_flags, rz_bin_symbol_t::name, NULL, PFMT64x, pj_end(), pj_kN(), pj_ks(), pj_o(), rz_bin_object_get_classes(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), rz_cons_printf(), rz_core_bin_method_flags_str(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_QUIETEST, RZ_OUTPUT_MODE_TABLE, rz_return_val_if_fail, rz_table_add_rowf(), rz_warn_if_reached, and rz_bin_symbol_t::vaddr.
Referenced by rz_cmd_info_class_methods_handler().
RZ_API bool rz_core_bin_classes_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 3939 of file cbin.c.
References bin_class_print_rizin(), c, test_evm::cs, f, flags_to_json(), rz_bin_symbol_t::method_flags, rz_bin_symbol_t::name, NULL, PFMT64x, pj_end(), pj_ka(), pj_ki(), pj_kN(), pj_ks(), pj_o(), rz_bin_object_get_classes(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), rz_cons_printf(), rz_cons_println(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_QUIETEST, RZ_OUTPUT_MODE_RIZIN, RZ_OUTPUT_MODE_TABLE, rz_return_val_if_fail, rz_table_add_rowf(), rz_warn_if_reached, rz_bin_symbol_t::size, ut64(), UT64_MAX, and rz_bin_symbol_t::vaddr.
Referenced by rz_cmd_info_classes_handler(), and rz_core_bin_print().
RZ_API RZ_OWN HtPP* rz_core_bin_create_digests | ( | RzCore * | core, |
ut64 | paddr, | ||
ut64 | size, | ||
RzList * | digests | ||
) |
Create a hashtable of digests.
Digest names are supplied as a list of char *
strings. Returns the hashtable with keys of digest names and values of strings containing requested digests.
Definition at line 1641 of file cbin.c.
References digests_ht_free(), free(), rz_core_t::hash, rz_core_t::io, malloc(), NULL, r, rz_hash_cfg_calculate_small_block_string(), rz_io_pread_at(), and rz_return_val_if_fail.
Referenced by bin_resources_print_json(), bin_resources_print_standard(), bin_resources_print_table(), sections_print_json(), and sections_print_table().
RZ_API bool rz_core_bin_cur_export_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 2050 of file cbin.c.
References rz_return_val_if_fail, and symbols_print().
Referenced by rz_cmd_info_cur_export_handler().
RZ_API bool rz_core_bin_cur_section_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state, | ||
RzList * | hashes | ||
) |
Definition at line 2541 of file cbin.c.
References rz_core_bin_sections_print(), and rz_return_val_if_fail.
Referenced by rz_cmd_info_cur_section_handler().
RZ_API bool rz_core_bin_cur_segment_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state, | ||
RzList * | hashes | ||
) |
Definition at line 2549 of file cbin.c.
References rz_core_bin_segments_print(), and rz_return_val_if_fail.
Referenced by rz_cmd_info_cur_segment_handler().
RZ_API bool rz_core_bin_cur_symbol_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 2036 of file cbin.c.
References rz_return_val_if_fail, and symbols_print().
Referenced by rz_cmd_info_cur_symbol_handler().
RZ_API bool rz_core_bin_dwarf_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 4880 of file cbin.c.
References bin_dwarf(), and rz_return_val_if_fail.
Referenced by rz_cmd_info_dwarf_handler(), and rz_core_bin_print().
RZ_API bool rz_core_bin_entries_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 1907 of file cbin.c.
References entries_initfini_print(), and rz_return_val_if_fail.
Referenced by rz_cmd_info_entry_handler(), and rz_core_bin_print().
Definition at line 108 of file cbin.c.
References addr, rz_core_t::analysis, rz_core_t::bin, dup, eprintf, rz_core_t::flags, free(), rz_core_t::io, IS_MODE_RZCMD, IS_MODE_SET, k, ls_foreach, malloc(), NULL, rz_core_t::num, off, rz_type_db_t::parser, rz_core_t::print, rz_bin_cur(), rz_cons_printf(), rz_flag_get(), rz_flag_set(), RZ_FREE, rz_io_read_at(), rz_num_get(), rz_num_math(), rz_str_newf(), rz_type_db_format_set(), rz_type_format_data(), rz_type_format_struct_size(), rz_type_parse_string_stateless(), rz_bin_file_t::sdb, sdb_const_get(), sdb_foreach_list(), sdb_ns(), sdbkv_key(), sdbkv_value(), rz_flag_item_t::size, strdup(), rz_analysis_t::typedb, ut64(), and v.
Referenced by rz_cmd_info_kuery(), rz_core_bin_load_structs(), and rz_main_rz_bin().
RZ_API bool rz_core_bin_exports_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state, | ||
RzCoreBinFilter * | filter | ||
) |
Definition at line 2044 of file cbin.c.
References rz_return_val_if_fail, and symbols_print().
Referenced by rz_cmd_info_exports_handler(), and rz_core_bin_print().
RZ_API RZ_OWN char* rz_core_bin_field_build_flag_name | ( | RZ_NONNULL RzBinClass * | cls, |
RZ_NONNULL RzBinField * | field | ||
) |
Returns the flag name of a class field.
Definition at line 4708 of file cbin.c.
References cls(), free(), NULL, resolve_method_flags(), rz_name_filter(), rz_return_val_if_fail, rz_str_replace_ch(), rz_strbuf_appendf(), rz_strbuf_drain_nofree(), rz_strbuf_initf(), and strdup().
Referenced by bin_class_print_rizin().
RZ_API bool rz_core_bin_fields_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 4070 of file cbin.c.
References rz_bin_field_t::comment, fields, rz_bin_field_t::format, rz_bin_field_t::format_named, free(), rz_bin_field_t::name, rz_bin_field_t::paddr, PFMT64x, pj_end(), pj_j(), pj_k(), pj_kN(), pj_ks(), pj_o(), rz_bin_object_get_fields(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), rz_cons_printf(), rz_core_cmd_strf(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_TABLE, rz_return_val_if_fail, RZ_STR_ISNOTEMPTY, rz_str_trim_tail(), rz_table_add_rowf(), rz_warn_if_reached, and rz_bin_field_t::vaddr.
Referenced by rz_cmd_info_fields_handler(), and rz_core_bin_print().
RZ_API RZ_BORROW const char* rz_core_bin_get_compile_time | ( | RZ_NONNULL RzBinFile * | bf | ) |
Get TimeDateStamp string from bf->sdb with key "info.image_file_header.TimeDateStamp_string".
Definition at line 1707 of file cbin.c.
References NULL, rz_return_val_if_fail, sdb_const_get(), and sdb_ns().
Referenced by rz_core_bin_info_print().
RZ_API bool rz_core_bin_headers_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf | ||
) |
Definition at line 4122 of file cbin.c.
References rz_bin_plugin_t::header, rz_bin_cur(), rz_bin_file_cur_plugin(), and rz_return_val_if_fail.
Referenced by rz_cmd_info_headers_handler().
RZ_API bool rz_core_bin_imports_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state, | ||
RzCoreBinFilter * | filter | ||
) |
Definition at line 2058 of file cbin.c.
References addr, free(), imports(), is_in_symbol_range(), NULL, rz_bin_symbol_t::paddr, pj_end(), pj_ki(), pj_kn(), pj_ks(), pj_o(), rva(), rz_bin_demangle(), rz_bin_object_get_imports(), rz_bin_object_get_symbol_of_import(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), rz_config_get_i(), rz_cons_printf(), rz_cons_println(), RZ_FREE, RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_QUIETEST, RZ_OUTPUT_MODE_TABLE, rz_return_val_if_fail, RZ_STR_ISNOTEMPTY, rz_str_newf(), rz_table_add_rowf(), rz_warn_if_reached, strdup(), autogen_x86imm::tmp, ut64(), UT64_MAX, VA_FALSE, VA_TRUE, and rz_bin_symbol_t::vaddr.
Referenced by rz_cmd_info_imports_handler(), and rz_core_bin_print().
RZ_API bool rz_core_bin_info_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 3044 of file cbin.c.
References rz_bin_info_t::actual_checksum, rz_bin_info_t::arch, rz_bin_info_t::bclass, rz_bin_info_t::big_endian, rz_bin_info_t::bits, bits(), rz_bin_info_t::claimed_checksum, rz_bin_info_t::compiler, rz_bin_info_t::cpu, rz_bin_info_t::dbg_info, rz_bin_info_t::debug_file_name, rz_bin_info_t::default_cc, rz_bin_object_t::entries, free(), rz_bin_info_t::guid, h, rz_bin_info_t::has_canary, rz_bin_info_t::has_crypto, rz_bin_info_t::has_nx, rz_bin_info_t::has_pi, rz_bin_info_t::has_retguard, rz_bin_info_t::has_sanitizers, rz_bin_info_t::has_va, i, info(), rz_bin_info_t::intrp, is_executable(), rz_bin_object_t::kv, rz_bin_info_t::lang, rz_bin_info_t::machine, malloc(), rz_bin_plugin_t::name, NULL, rz_bin_info_t::os, rz_bin_info_t::pe_overlay, pj_end(), pj_kb(), pj_ki(), pj_kn(), pj_ko(), pj_ks(), pj_o(), rz_bin_info_t::rclass, rz_bin_info_t::rpath, rz_analysis_archinfo(), RZ_ANALYSIS_ARCHINFO_ALIGN, RZ_ANALYSIS_ARCHINFO_MAX_OP_SIZE, RZ_ANALYSIS_ARCHINFO_MIN_OP_SIZE, RZ_BIN_DBG_LINENUMS, RZ_BIN_DBG_RELOCS, RZ_BIN_DBG_STRIPPED, RZ_BIN_DBG_SYMS, rz_bin_file_cur_plugin(), rz_bin_get_baddr(), rz_bin_get_info(), rz_bin_get_laddr(), rz_bin_get_size(), rz_bin_is_static(), rz_config_get_i(), rz_cons_printf(), rz_core_bin_get_compile_time(), rz_hex_bin2strdup(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_TABLE, rz_return_val_if_fail, RZ_STR_ISNOTEMPTY, rz_table_add_rowf(), rz_table_hide_header(), rz_table_set_columnsf(), rz_warn_if_reached, sdb_get(), sdb_num_get(), rz_bin_info_t::signature, snprintf, str2na(), rz_bin_info_t::subsystem, rz_bin_info_t::sum, table_add_row_bool(), rz_bin_hash_t::type, ut64(), and v.
Referenced by rz_cmd_info_binary_handler(), rz_cmd_info_handler(), and rz_core_bin_print().
RZ_API bool rz_core_bin_initfini_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 1901 of file cbin.c.
References entries_initfini_print(), and rz_return_val_if_fail.
Referenced by rz_cmd_info_entryexits_handler(), and rz_core_bin_print().
RZ_API bool rz_core_bin_libs_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 2163 of file cbin.c.
References libs(), pj_s(), rz_bin_object_get_libs(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), rz_cons_printf(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_TABLE, rz_return_val_if_fail, rz_table_add_rowf(), and rz_warn_if_reached.
Referenced by rz_cmd_info_libs_handler(), and rz_core_bin_print().
RZ_API bool rz_core_bin_load_structs | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL const char * | file | ||
) |
Definition at line 236 of file cbin.c.
References eprintf, rz_bin_file_delete(), rz_bin_open(), rz_core_bin_export_info(), RZ_MODE_SET, and rz_return_val_if_fail.
Referenced by reopen_nobin_headers(), and rz_main_rizin().
RZ_API bool rz_core_bin_main_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 2192 of file cbin.c.
References addr, rz_bin_addr_t::paddr, PFMT64d, pj_end(), pj_kn(), pj_o(), rz_bin_object_addr_with_base(), rz_bin_object_get_special_symbol(), RZ_BIN_SPECIAL_SYMBOL_MAIN, rz_cmd_state_output_set_columnsf(), rz_cons_printf(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_TABLE, rz_return_val_if_fail, rz_table_add_rowf(), rz_warn_if_reached, ut64(), VA_FALSE, VA_TRUE, and rz_bin_addr_t::vaddr.
Referenced by rz_cmd_info_main_handler(), and rz_core_bin_print().
RZ_API bool rz_core_bin_memory_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 4955 of file cbin.c.
References bin_memory_print_rec(), NULL, rz_bin_object_get_mem(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), and rz_return_val_if_fail.
Referenced by rz_cmd_info_memory_handler(), and rz_core_bin_print().
RZ_API RZ_OWN char* rz_core_bin_method_build_flag_name | ( | RZ_NONNULL RzBinClass * | cls, |
RZ_NONNULL RzBinSymbol * | meth | ||
) |
Returns the flag name of a class method.
Definition at line 4680 of file cbin.c.
References cls(), free(), NULL, resolve_method_flags(), rz_name_filter(), rz_return_val_if_fail, rz_str_replace_ch(), rz_strbuf_appendf(), rz_strbuf_drain_nofree(), rz_strbuf_initf(), and strdup().
Referenced by bin_class_print_rizin(), and rz_core_bin_apply_classes().
Definition at line 4731 of file cbin.c.
References flags, i, IS_MODE_JSON, len, out, PFMT64x, pj_a(), pj_end(), pj_free(), pj_new(), pj_s(), pj_string(), rz_bin_get_meth_flag_string(), rz_strbuf_append(), rz_strbuf_drain(), rz_strbuf_new(), sdb_fmt(), and ut64().
Referenced by rz_core_bin_class_fields_print(), rz_core_bin_class_methods_print(), and show_class().
RZ_API void rz_core_bin_options_init | ( | RzCore * | core, |
RZ_OUT RzBinOptions * | opts, | ||
int | fd, | ||
ut64 | baseaddr, | ||
ut64 | loadaddr | ||
) |
Definition at line 87 of file cbin.c.
References baseaddr, rz_core_t::config, fd, patch_relocs(), rz_bin_options_init(), rz_config_get_b(), and rz_return_if_fail.
Referenced by core_file_do_load_for_io_plugin(), map_multi_dex(), rz_main_rizin(), rz_open_binary_add_handler(), and rz_open_binary_file_handler().
RZ_API RZ_OWN char* rz_core_bin_pdb_get_filename | ( | RZ_NONNULL RzCore * | core | ) |
Definition at line 4886 of file cbin.c.
References basename, rz_bin_info_t::debug_file_name, free(), rz_bin_info_t::guid, info(), NULL, rz_bin_get_info(), rz_config_get(), rz_file_dirname(), rz_file_dos_basename(), rz_file_exists(), rz_str_newf(), RZ_SYS_DIR, and strdup().
Referenced by rz_cmd_info_pdb_load_handler(), and rz_cmd_info_pdb_show_handler().
RZ_API bool rz_core_bin_pdb_load | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL const char * | filename | ||
) |
Definition at line 5264 of file cbin.c.
References free(), rz_bin_pdb_free(), RZ_CMD_STATUS_OK, rz_cons_get_buffer(), rz_cons_pop(), rz_cons_push(), rz_core_cmd_rzshell(), rz_core_pdb_load_info(), s, status, and strdup().
Referenced by rz_cmd_info_pdb_load_handler().
RZ_IPI RzCmdStatus rz_core_bin_plugin_print | ( | const RzBinPlugin * | bp, |
RzCmdStateOutput * | state | ||
) |
Definition at line 4783 of file cbin.c.
References rz_bin_plugin_t::author, rz_bin_plugin_t::desc, rz_bin_plugin_t::license, rz_bin_plugin_t::name, pj_end(), pj_ks(), pj_o(), rz_cmd_state_output_set_columnsf(), RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_NONEXISTINGCMD, RZ_CMD_STATUS_OK, rz_cons_printf(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_STANDARD, RZ_OUTPUT_MODE_TABLE, rz_return_val_if_fail, rz_table_add_rowf(), rz_warn_if_reached, and rz_bin_plugin_t::version.
Referenced by rz_cmd_info_plugins_handler(), and rz_core_bin_plugins_print().
RZ_API RzCmdStatus rz_core_bin_plugins_print | ( | RzBin * | bin, |
RzCmdStateOutput * | state | ||
) |
Definition at line 4855 of file cbin.c.
References rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_OK, rz_core_bin_plugin_print(), rz_core_binxtr_plugin_print(), rz_return_val_if_fail, and status.
Referenced by __listPlugins(), rz_cmd_info_plugins_handler(), and rz_plugins_bin_print_handler().
RZ_API bool rz_core_bin_print | ( | RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
ut32 | mask, | ||
RzCoreBinFilter * | filter, | ||
RzCmdStateOutput * | state, | ||
RzList * | hashes | ||
) |
Print (to RzCons or inside RzCmdStateOutput) the binary information specified in mask
.
This function can be used to print information from the current binary file. What type of information to print depends on the value of mask
, which can be a mix of RZ_CORE_BIN_ACC_ defines. When filter
is NULL, all informations are printed. When filter
is not NULL some information (e.g. symbols, sections, imports, etc.) are filtered by name and/or address.
The argument state
is used to specify the output mode you want the info.
core | RzCore instance |
bf | RzBinFile to consider |
mask | Mask of info you want to print, see RZ_CORE_BIN_ACC_ defines |
filter | When specified it filter some of the info by name and/or address |
state | RzCmdStateOutput instance specifying the output mode |
hashes | List of strings with name of hashes that RZ_CORE_BIN_ACC_SECTIONS/SEGMENTS should print |
Definition at line 386 of file cbin.c.
References add_footer(), add_header(), rz_core_t::analysis, rz_core_t::bin, rz_bin_t::file, mask, rz_bin_pdb_free(), rz_cmd_state_output_free(), rz_core_bin_basefind_print(), rz_core_bin_classes_print(), rz_core_bin_dwarf_print(), rz_core_bin_entries_print(), rz_core_bin_exports_print(), rz_core_bin_fields_print(), rz_core_bin_imports_print(), rz_core_bin_info_print(), rz_core_bin_initfini_print(), rz_core_bin_libs_print(), rz_core_bin_main_print(), rz_core_bin_memory_print(), rz_core_bin_relocs_print(), rz_core_bin_resources_print(), rz_core_bin_sections_mapping_print(), rz_core_bin_sections_print(), rz_core_bin_segments_print(), rz_core_bin_signatures_print(), rz_core_bin_size_print(), rz_core_bin_strings_print(), rz_core_bin_symbols_print(), rz_core_bin_trycatch_print(), rz_core_bin_versions_print(), rz_core_pdb_info_print(), rz_core_pdb_load_info(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_QUIETEST, RZ_OUTPUT_MODE_RIZIN, RZ_OUTPUT_MODE_STANDARD, RZ_OUTPUT_MODE_TABLE, rz_return_val_if_fail, rz_analysis_t::typedb, and wrap_mode.
Referenced by get_bin_info(), rz_cmd_debug_dmi(), rz_cmd_info_all_handler(), and rz_main_rz_bin().
RZ_API void rz_core_bin_print_source_line_info | ( | RzCore * | core, |
const RzBinSourceLineInfo * | li, | ||
RzCmdStateOutput * | state | ||
) |
Definition at line 1811 of file cbin.c.
References i, NULL, rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cons_break_pop(), rz_cons_break_push(), rz_cons_is_breaked(), rz_core_bin_print_source_line_sample(), rz_return_if_fail, rz_bin_source_line_info_t::samples, and rz_bin_source_line_info_t::samples_count.
Referenced by bin_dwarf(), and print_source_info().
RZ_API void rz_core_bin_print_source_line_sample | ( | RzCore * | core, |
const RzBinSourceLineSample * | s, | ||
RzCmdStateOutput * | state | ||
) |
Definition at line 1778 of file cbin.c.
References rz_core_t::config, free(), NULL, PFMT32u, PFMT64x, pj_end(), pj_kn(), pj_ks(), pj_o(), rz_config_get_i(), rz_cons_printf(), RZ_OUTPUT_MODE_JSON, rz_return_if_fail, rz_str_lchr(), s, strdup(), and ut64().
Referenced by print_source_info(), and rz_core_bin_print_source_line_info().
Definition at line 4524 of file cbin.c.
References rz_core_t::bin, rz_bin_file_t::fd, rz_core_t::io, rz_bin_cur(), rz_bin_select_bfid(), rz_core_bin_apply_all_info(), rz_core_block_read(), and rz_io_use_fd().
Referenced by prioritize_file(), rz_core_bin_load(), rz_open_binary_select_fd_handler(), rz_open_binary_select_id_handler(), and rz_open_use_handler().
RZ_API bool rz_core_bin_relocs_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 2224 of file cbin.c.
References rz_bin_reloc_t::addend, addr, bin_reloc_type_name(), construct_reloc_name(), free(), i, rz_bin_reloc_t::import, rz_bin_reloc_t::is_ifunc, rz_bin_symbol_t::name, rz_bin_import_t::name, NULL, rz_bin_reloc_t::paddr, PFMT64x, pj_end(), pj_kb(), pj_kn(), pj_ks(), pj_o(), relocs(), rva(), rz_bin_demangle(), rz_bin_object_patch_relocs(), rz_bin_reloc_has_target(), rz_bin_reloc_storage_targets_available(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), rz_config_get(), rz_config_get_i(), rz_cons_printf(), RZ_FREE, RZ_LOG_WARN, RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_TABLE, rz_return_val_if_fail, rz_str_get(), RZ_STR_ISEMPTY, RZ_STR_ISNOTEMPTY, rz_strbuf_append(), rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_is_empty(), rz_strbuf_new(), rz_table_add_rowf(), rz_warn_if_reached, strdup(), rz_bin_reloc_t::symbol, rz_bin_reloc_t::target_vaddr, ut64(), VA_TRUE, rz_bin_symbol_t::vaddr, and rz_bin_reloc_t::vaddr.
Referenced by rz_cmd_info_relocs_handler(), and rz_core_bin_print().
RZ_API bool rz_core_bin_resources_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state, | ||
RZ_NULLABLE RzList * | hashes | ||
) |
Definition at line 5045 of file cbin.c.
References bin_resources_print_json(), bin_resources_print_standard(), bin_resources_print_table(), rz_hash_plugin_t::name, NULL, rz_bin_object_get_resources(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), rz_hash_plugin_by_name(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_STANDARD, RZ_OUTPUT_MODE_TABLE, rz_return_val_if_fail, and rz_warn_if_reached.
Referenced by rz_cmd_info_resources_handler(), and rz_core_bin_print().
RZ_API bool rz_core_bin_sections_mapping_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 5117 of file cbin.c.
References map(), maps(), rz_bin_section_t::name, NULL, rz_bin_object_sections_mapping_list(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), RZ_OUTPUT_MODE_TABLE, rz_pvector_foreach, rz_return_val_if_fail, rz_strbuf_appendf(), rz_strbuf_free(), rz_strbuf_get(), rz_strbuf_new(), rz_table_add_row_columnsf(), rz_table_add_rowf(), rz_vector_foreach, rz_vector_free(), rz_warn_if_fail, and sb.
Referenced by rz_core_bin_print().
RZ_API bool rz_core_bin_sections_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state, | ||
RzCoreBinFilter * | filter, | ||
RzList * | hashes | ||
) |
Definition at line 2472 of file cbin.c.
References err, free(), is_in_symbol_range(), rz_bin_object_get_sections(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cons_printf(), rz_list_free(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_TABLE, rz_return_val_if_fail, rz_table_free(), rz_table_new(), rz_table_query(), rz_table_tostring(), rz_warn_if_reached, s, sections(), sections_headers_setup(), sections_print_json(), sections_print_table(), section::size, and UT64_MAX.
Referenced by rz_cmd_info_sections_handler(), rz_core_bin_cur_section_print(), and rz_core_bin_print().
RZ_API bool rz_core_bin_segments_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state, | ||
RzCoreBinFilter * | filter, | ||
RzList * | hashes | ||
) |
Definition at line 2633 of file cbin.c.
References is_in_symbol_range(), rz_bin_section_t::name, rz_hash_plugin_t::name, rz_bin_section_t::paddr, rz_bin_object_get_segments(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), rz_hash_plugin_by_name(), rz_list_free(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_TABLE, rz_return_val_if_fail, rz_warn_if_reached, sections_print_json(), sections_print_table(), rz_bin_section_t::size, UT64_MAX, rz_bin_section_t::vaddr, and rz_bin_section_t::vsize.
Referenced by rz_cmd_info_segments_handler(), rz_core_bin_cur_segment_print(), and rz_core_bin_print().
RZ_API int rz_core_bin_set_arch_bits | ( | RzCore * | r, |
const char * | name, | ||
const char * | arch, | ||
ut16 | bits | ||
) |
Definition at line 4467 of file cbin.c.
References rz_bin_info_t::arch, arch, rz_bin_info_t::bits, bits(), rz_bin_file_t::curxtr, desc, fd, free(), rz_bin_object_t::info, NULL, rz_bin_file_t::o, r, rz_asm_is_valid(), rz_bin_cur(), rz_bin_file_find_by_arch_bits(), rz_bin_use_arch(), rz_core_bin_apply_all_info(), rz_core_bin_set_cur(), rz_io_desc_get(), rz_io_fd_get_current(), and strdup().
Referenced by core_file_do_load_for_debug(), core_file_do_load_for_io_plugin(), rz_core_bin_load(), rz_core_bin_update_arch_bits(), and rz_open_arch_bits_handler().
Definition at line 100 of file cbin.c.
References rz_core_t::bin, rz_bin_cur(), rz_bin_file_set_cur_by_fd(), and rz_core_bin_set_cur().
Referenced by rz_core_file_set_by_fd().
Definition at line 253 of file cbin.c.
References rz_core_t::bin, rz_bin_cur(), rz_bin_file_set_cur_by_name(), and rz_core_bin_set_cur().
RZ_API bool rz_core_bin_set_cur | ( | RZ_NONNULL RzCore * | core, |
RZ_NULLABLE RzBinFile * | binfile | ||
) |
Set binfile
as current binfile.
core | The RzCore instance |
binfile | RzBinFile, it will find by current fd if NULL |
Definition at line 1673 of file cbin.c.
References fd, NULL, rz_bin_file_find_by_fd(), rz_bin_file_set_cur_binfile(), rz_core_file_cur_fd(), and rz_return_val_if_fail.
Referenced by rz_core_bin_apply_all_info(), rz_core_bin_set_arch_bits(), rz_core_bin_set_by_fd(), and rz_core_bin_set_by_name().
RZ_API bool rz_core_bin_signatures_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 4038 of file cbin.c.
References free(), pj_end(), pj_k(), pj_o(), pj_raw(), rz_bin_cur(), rz_bin_file_cur_plugin(), rz_cons_println(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_STANDARD, rz_return_val_if_fail, rz_warn_if_reached, signature(), and rz_bin_plugin_t::signature.
Referenced by rz_cmd_info_signature_handler(), and rz_core_bin_print().
RZ_API bool rz_core_bin_size_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 5151 of file cbin.c.
References PFMT64u, pj_n(), rz_bin_get_size(), rz_cons_printf(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_RIZIN, RZ_OUTPUT_MODE_STANDARD, rz_return_val_if_fail, rz_warn_if_reached, and ut64().
Referenced by rz_cmd_info_guess_size_handler(), and rz_core_bin_print().
RZ_API bool rz_core_bin_strings_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 2853 of file cbin.c.
References list(), rz_bin_object_get_strings(), rz_return_val_if_fail, and strings_print().
Referenced by rz_cmd_info_strings_handler(), and rz_core_bin_print().
RZ_API RZ_OWN char* rz_core_bin_super_build_flag_name | ( | RZ_NONNULL RzBinClass * | cls | ) |
Returns the flag name of a super class.
Definition at line 4657 of file cbin.c.
References cls(), free(), NULL, rz_name_filter(), rz_return_val_if_fail, rz_str_newf(), rz_str_replace_ch(), and strdup().
Referenced by bin_class_print_rizin().
RZ_API bool rz_core_bin_symbols_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state, | ||
RzCoreBinFilter * | filter | ||
) |
Definition at line 2030 of file cbin.c.
References rz_return_val_if_fail, and symbols_print().
Referenced by rz_cmd_info_symbols_handler(), and rz_core_bin_print().
RZ_API bool rz_core_bin_trycatch_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 5102 of file cbin.c.
References bin_trycatch(), NULL, RZ_MODE_PRINT, RZ_OUTPUT_MODE_RIZIN, rz_return_val_if_fail, and rz_warn_if_reached.
Referenced by rz_cmd_info_trycatch_handler(), and rz_core_bin_print().
Definition at line 4503 of file cbin.c.
References arch, bits(), rz_bin_file_t::curxtr, rz_bin_file_t::file, NULL, r, rz_analysis_hint_clear(), rz_bin_cur(), and rz_core_bin_set_arch_bits().
Referenced by rz_core_file_reopen(), rz_diff_load_file_with_core(), rz_main_rz_bin(), and rz_main_rz_sign().
RZ_API bool rz_core_bin_versions_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 5084 of file cbin.c.
References bin_versioninfo(), NULL, RZ_MODE_JSON, RZ_MODE_PRINT, RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_STANDARD, rz_return_val_if_fail, and rz_warn_if_reached.
Referenced by rz_cmd_info_versions_handler(), and rz_core_bin_print().
RZ_API RZ_OWN RzList* rz_core_bin_whole_strings | ( | RZ_NONNULL RzCore * | core, |
RZ_NULLABLE RzBinFile * | bf | ||
) |
Definition at line 2866 of file cbin.c.
References desc, free(), int, min, NULL, rz_bin_file_strings(), rz_buf_free(), rz_buf_new_with_io_fd(), rz_buf_write_at(), rz_config_get_i(), rz_io_desc_get(), rz_io_desc_size(), rz_io_read_at(), RZ_LOG_ERROR, RZ_NEW0, RZ_NEWS, rz_return_val_if_fail, strdup(), autogen_x86imm::tmp, and UT64_MAX.
Referenced by rz_core_bin_whole_strings_print().
RZ_API bool rz_core_bin_whole_strings_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | bf, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 2917 of file cbin.c.
References rz_core_bin_whole_strings(), rz_list_free(), rz_return_val_if_fail, and strings_print().
Referenced by rz_cmd_info_whole_strings_handler().
Close an opened binary file.
core | Reference to RzCore instance |
bf | Reference to RzBinFile to delete |
Definition at line 4542 of file cbin.c.
References rz_core_t::bin, rz_bin_file_t::fd, rz_core_t::io, rz_core_t::offset, rz_bin_file_at(), rz_bin_file_delete(), rz_core_bin_apply_all_info(), rz_core_block_read(), and rz_io_use_fd().
Referenced by rz_open_binary_del_handler().
RZ_API bool rz_core_binfiles_print | ( | RzCore * | core, |
RzCmdStateOutput * | state | ||
) |
Print all the opened binary files according to state
.
core | Reference to RzCore instance |
state | Reference to RzCmdStateOutput containing all the data to print data in the right format |
Definition at line 4603 of file cbin.c.
References rz_core_t::bin, rz_bin_t::binfiles, core_bin_file_print(), NULL, rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), and rz_return_val_if_fail.
Referenced by rz_open_binary_list_handler().
RZ_IPI RzCmdStatus rz_core_binxtr_plugin_print | ( | const RzBinXtrPlugin * | bx, |
RzCmdStateOutput * | state | ||
) |
Definition at line 4823 of file cbin.c.
References rz_bin_xtr_plugin_t::desc, rz_bin_xtr_plugin_t::license, rz_bin_xtr_plugin_t::name, NULL, pj_end(), pj_ks(), pj_o(), rz_cmd_state_output_set_columnsf(), RZ_CMD_STATUS_ERROR, RZ_CMD_STATUS_NONEXISTINGCMD, RZ_CMD_STATUS_OK, rz_cons_printf(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_STANDARD, RZ_OUTPUT_MODE_TABLE, rz_return_val_if_fail, rz_table_add_rowf(), and rz_warn_if_reached.
Referenced by rz_cmd_info_plugins_handler(), and rz_core_bin_plugins_print().
RZ_API bool rz_core_file_info_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzBinFile * | binfile, | ||
RZ_NONNULL RzCmdStateOutput * | state | ||
) |
Definition at line 2943 of file cbin.c.
References desc, RzStrEscOptions::esc_bslash, fd, free(), get_filename(), info(), rz_bin_plugin_t::name, NULL, pj_end(), pj_kb(), pj_ki(), pj_kN(), pj_kr(), pj_ks(), pj_o(), rz_bin_file_cur_plugin(), rz_bin_get_info(), rz_cmd_state_output_set_columnsf(), rz_config_get_i(), rz_io_desc_get(), rz_io_desc_size(), rz_io_fd_get_current(), rz_num_units(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_TABLE, RZ_PERM_RWX, RZ_PERM_W, rz_return_val_if_fail, rz_str_escape_utf8_keep_printable(), rz_str_is_utf8(), rz_str_rwx_i(), rz_table_add_rowf(), rz_table_hide_header(), rz_warn_if_reached, RzStrEscOptions::show_asciidot, table_add_row_bool(), rz_bin_info_t::type, ut64(), and UT64_MAX.
Referenced by rz_cmd_info_handler().
RZ_API bool rz_core_sym_is_export | ( | RZ_NONNULL RzBinSymbol * | s | ) |
Is RzBinSymbol exported?
Definition at line 1916 of file cbin.c.
References RZ_BIN_BIND_GLOBAL_STR, rz_return_val_if_fail, and s.
Referenced by symbols_print().
RZ_API void rz_core_sym_name_fini | ( | RZ_NULLABLE RzBinSymNames * | sn | ) |
RZ_FREE all member of sn
(sn->*)
sn | Symbol names |
Definition at line 1371 of file cbin.c.
References RZ_FREE.
Referenced by rz_core_bin_apply_symbols(), and symbols_print().
RZ_API void rz_core_sym_name_init | ( | RZ_NONNULL RzCore * | r, |
RZ_OUT RzBinSymNames * | sn, | ||
RZ_NONNULL RzBinSymbol * | sym, | ||
RZ_NULLABLE const char * | lang | ||
) |
Initlize sn
.
r | The RzCore instance | |
[out] | sn | The RzBinSymNames to output |
sym | Symbol info | |
lang | Language info |
Definition at line 1322 of file cbin.c.
References construct_symbol_flagname(), free(), get_prefix_for_sym(), MAXFLAG_LEN_DEFAULT, name::name, NULL, r, rz_bin_demangle(), rz_bin_symbol_name(), rz_config_get_b(), rz_name_filter(), rz_return_if_fail, rz_str_escape_utf8(), rz_str_newf(), RzStrEscOptions::show_asciidot, strdup(), and autogen_x86imm::tmp.
Referenced by rz_core_bin_apply_symbols(), and symbols_print().
Definition at line 575 of file cbin.c.
References path, s, sdb_close(), sdb_free(), sdb_merge(), and sdb_new().
Referenced by rz_core_bin_apply_config().
|
static |
Write a section-specific permission string like srwx.
dst | must be at least 5 bytes large |
Definition at line 918 of file cbin.c.
References dst, RZ_PERM_R, RZ_PERM_SHAR, RZ_PERM_W, and RZ_PERM_X.
Referenced by rz_core_bin_apply_sections(), sections_print_json(), and sections_print_table().
|
static |
Definition at line 2458 of file cbin.c.
References rz_core_t::hash, rz_hash_plugin_t::name, rz_cmd_state_output_set_columnsf(), and rz_hash_plugin_by_name().
Referenced by rz_core_bin_sections_print().
|
static |
Definition at line 2357 of file cbin.c.
References addr, section::align, rz_core_t::bin, digests_pj_cb(), section::flags, flags, free(), get_section_addr(), pj_end(), pj_ka(), pj_kN(), pj_ks(), pj_o(), pj_s(), pos, rz_bin_section_flag_to_list(), rz_bin_section_type_to_string(), rz_core_bin_create_digests(), rz_list_free(), section_perms_str(), section::size, and ut64().
Referenced by rz_core_bin_sections_print(), and rz_core_bin_segments_print().
|
static |
Definition at line 2404 of file cbin.c.
References addr, section::align, rz_core_t::bin, cleanup(), section::flags, found, free(), get_section_addr(), NULL, rz_bin_t::prefix, rz_bin_section_flag_to_list(), rz_bin_section_type_to_string(), rz_core_bin_create_digests(), rz_list_free(), rz_str_list_join(), rz_str_newf(), rz_table_add_row_columnsf(), rz_table_add_rowf(), section_perms_str(), section::size, and ut64().
Referenced by rz_core_bin_sections_print(), and rz_core_bin_segments_print().
|
static |
Definition at line 1437 of file cbin.c.
References rz_core_t::flags, rz_bin_symbol_t::is_imported, RZ_BIN_TYPE_SECTION_STR, RZ_FLAGS_FS_IMPORTS, RZ_FLAGS_FS_SYMBOLS, RZ_FLAGS_FS_SYMBOLS_SECTIONS, and rz_bin_symbol_t::type.
Referenced by rz_core_bin_apply_symbols().
|
static |
Definition at line 1144 of file cbin.c.
References addr, free(), rz_bin_reloc_t::import, rz_bin_import_t::libname, rz_bin_import_t::name, NULL, rz_bin_reloc_t::paddr, r, reloc_set_flag(), resolveModuleOrdinal(), rva(), rz_analysis_hint_set_size(), rz_bin_reloc_has_target(), rz_file_exists(), RZ_FREE, RZ_JOIN_3_PATHS, rz_meta_set(), RZ_META_TYPE_DATA, rz_path_system(), RZ_SDB_FORMAT, rz_str_case(), rz_str_newf(), rz_str_startswith(), sdb_free(), sdb_new(), strdup(), rz_bin_reloc_t::target_vaddr, ut64(), and rz_bin_reloc_t::vaddr.
Referenced by rz_core_bin_apply_relocs().
Definition at line 3040 of file cbin.c.
References RZ_STR_ISEMPTY, and s.
Referenced by rz_core_bin_info_print().
|
static |
Definition at line 2684 of file cbin.c.
References rz_core_t::bin, rz_core_t::config, rz_print_t::esc_bslash, RzStrEscOptions::esc_bslash, RzStrEscOptions::esc_double_quotes, free(), rz_core_t::io, rz_bin_t::is_debugger, IS_PRINTABLE, rz_bin_string_t::length, list(), memcpy(), NULL, rz_bin_string_t::ordinal, PFMT64x, pj_a(), pj_end(), pj_k(), pj_kn(), pj_ks(), pj_o(), pj_s(), rz_core_t::print, rva(), rz_base64_decode_dyn(), rz_bin_cur_object(), rz_bin_get_section_at(), rz_bin_string_filter(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), rz_config_get_i(), rz_cons_printf(), RZ_FREE, RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_LONG_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_QUIETEST, RZ_OUTPUT_MODE_TABLE, rz_str_enc_as_string(), rz_str_escape_utf8_keep_printable(), rz_strbuf_append(), rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_new(), rz_strf, RZ_STRING_ENC_MUTF8, RZ_STRING_ENC_UTF16LE, RZ_STRING_ENC_UTF32LE, RZ_STRING_ENC_UTF8, rz_table_add_rowf(), rz_utf_block_list(), rz_utf_block_name(), rz_warn_if_reached, s, RzStrEscOptions::show_asciidot, rz_bin_string_t::size, cmd_descs_generate::str, strdup(), rz_bin_string_t::string, rz_bin_string_t::type, ut64(), UT64_MAX, rz_io_t::va, VA_FALSE, VA_TRUE, and rz_bin_string_t::vaddr.
Referenced by rz_core_bin_strings_print(), and rz_core_bin_whole_strings_print().
|
static |
Definition at line 1935 of file cbin.c.
References addr, rz_core_t::bin, rz_bin_symbol_t::bind, rz_core_t::config, rz_bin_sym_names_t::demname, rz_core_t::io, rz_bin_t::is_debugger, rz_bin_symbol_t::is_imported, is_in_symbol_range(), rz_bin_symbol_t::libname, rz_bin_sym_names_t::libname, rz_bin_symbol_t::name, rz_bin_sym_names_t::nameflag, NULL, rz_bin_file_t::o, rz_bin_symbol_t::ordinal, rz_bin_symbol_t::paddr, PFMT64u, PFMT64x, pj_end(), pj_kb(), pj_ki(), pj_kn(), pj_ks(), pj_o(), rva(), rz_bin_object_get_symbols(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), rz_config_get(), rz_config_get_i(), rz_cons_printf(), rz_core_sym_is_export(), rz_core_sym_name_fini(), rz_core_sym_name_init(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_QUIETEST, RZ_OUTPUT_MODE_TABLE, rz_str_get(), rz_str_get_null(), rz_strf, rz_table_add_rowf(), rz_warn_if_reached, rz_bin_symbol_t::size, rz_bin_sym_names_t::symbolname, symbols(), rz_bin_symbol_t::type, ut64(), UT64_MAX, rz_io_t::va, VA_FALSE, VA_TRUE, and rz_bin_symbol_t::vaddr.
Referenced by rz_core_bin_cur_export_print(), rz_core_bin_cur_symbol_print(), rz_core_bin_exports_print(), and rz_core_bin_symbols_print().
Definition at line 43 of file cbin.c.
References b, key, rz_str_bool(), rz_table_add_rowf(), rz_table_type(), typeString(), and val.
Referenced by rz_core_bin_info_print(), and rz_core_file_info_print().