Rizin
unix-like reverse engineering framework and cli tools
|
#include <string.h>
#include <rz_types.h>
#include <rz_list.h>
#include <rz_flag.h>
#include <rz_core.h>
#include <rz_bin.h>
#include <ht_uu.h>
#include <rz_util/rz_graph_drawable.h>
#include <rz_util/rz_path.h>
#include "core_private.h"
Go to the source code of this file.
Classes | |
struct | HintNode |
struct | BlockRecurseCtx |
struct | block_flags_stat_t |
struct | EsilBreakCtx |
struct | IterCtx |
struct | RzCoreAnalPaths |
struct | core_noretl |
Macros | |
#define | MAX_SCAN_SIZE 0x7ffffff |
#define | MINLEN 1 |
#define | HINTCMD_ADDR(hint, fmt, x) rz_cons_printf(fmt " @ 0x%" PFMT64x "\n", x, (hint)->addr) |
#define | END_ADDR |
#define | USE_ID 1 |
#define | REG_SET_SIZE (RZ_ANALYSIS_CC_MAXARG + 2) |
#define | OPSZ 8 |
#define | CHECKREF(x) ((refptr && (x) == refptr) || !refptr) |
#define | CALL_BUF_SIZE 32 |
Enumerations | |
enum | { RZ_ARCH_THUMB , RZ_ARCH_ARM32 , RZ_ARCH_ARM64 , RZ_ARCH_MIPS } |
Variables | |
static bool | esil_analysis_stop = false |
static ut64 | esilbreak_last_read = UT64_MAX |
static ut64 | esilbreak_last_data = UT64_MAX |
static ut64 | ntarget = UT64_MAX |
static const char * | RzCoreAnalysisNameTypeStrs [] |
#define CALL_BUF_SIZE 32 |
Definition at line 5554 of file canalysis.c.
#define END_ADDR |
#define HINTCMD_ADDR | ( | hint, | |
fmt, | |||
x | |||
) | rz_cons_printf(fmt " @ 0x%" PFMT64x "\n", x, (hint)->addr) |
#define MAX_SCAN_SIZE 0x7ffffff |
Definition at line 28 of file canalysis.c.
#define MINLEN 1 |
Definition at line 65 of file canalysis.c.
#define OPSZ 8 |
Definition at line 3070 of file canalysis.c.
#define REG_SET_SIZE (RZ_ANALYSIS_CC_MAXARG + 2) |
Definition at line 2701 of file canalysis.c.
#define USE_ID 1 |
Definition at line 2192 of file canalysis.c.
anonymous enum |
Enumerator | |
---|---|
RZ_ARCH_THUMB | |
RZ_ARCH_ARM32 | |
RZ_ARCH_ARM64 | |
RZ_ARCH_MIPS |
Definition at line 21 of file canalysis.c.
Definition at line 813 of file canalysis.c.
References addr, rz_analysis_function_t::addr, rz_core_t::analysis, rz_analysis_plugin_t::arch, autoname_imp_trampoline(), baddr(), rz_analysis_options_t::bb_max_size, rz_core_t::bin, rz_analysis_function_t::bits, rz_analysis_t::bits, rz_analysis_hint_t::bits, rz_analysis_function_t::bp_frame, rz_analysis_function_t::cc, rz_core_t::config, rz_analysis_t::constpool, rz_analysis_t::cur, delta, eprintf, error(), f, rz_core_t::flags, rz_analysis_options_t::followbrokenfcnsrefs, free(), from, getFunctionName(), i, rz_core_t::io, is_entry_flag(), rz_analysis_t::leaddrs, loganalysis(), map(), mi, rz_analysis_function_t::name, rz_bin_symbol_t::name, next_append(), rz_analysis_options_t::noncode, NULL, rz_analysis_t::opt, rz_bin_symbol_t::paddr, sdb_t::path, PFMT64x, rz_analysis_add_function(), rz_analysis_analyze_fcn_refs(), rz_analysis_cc_default(), rz_analysis_fcn(), rz_analysis_fcn_invalidate_read_ahead_cache(), rz_analysis_fcntype_tostring(), rz_analysis_function_check_bp_use(), rz_analysis_function_delete_vars_by_kind(), rz_analysis_function_free(), rz_analysis_function_linear_size(), rz_analysis_function_max_addr(), rz_analysis_function_new(), rz_analysis_function_realsize(), rz_analysis_get_fcn_in(), rz_analysis_hint_free(), rz_analysis_hint_get(), RZ_ANALYSIS_RET_BRANCH, RZ_ANALYSIS_RET_COND, RZ_ANALYSIS_RET_END, RZ_ANALYSIS_RET_ERROR, rz_analysis_set_stringrefs(), RZ_ANALYSIS_VAR_KIND_BPV, rz_analysis_xrefs_set(), rz_bin_get_symbols(), RZ_BIN_TYPE_FUNC_STR, rz_config_get(), rz_config_get_i(), rz_cons_clear_line(), rz_cons_is_breaked(), rz_core_analysis_fcn(), rz_core_flag_get_by_spaces(), rz_flag_set(), RZ_FLAGS_FS_FUNCTIONS, RZ_FREE, rz_io_is_valid_offset(), rz_io_map_get(), rz_list_free(), RZ_LOG_DEBUG, RZ_LOG_ERROR, rz_meta_get_at(), RZ_META_TYPE_ANY, RZ_PERM_X, rz_str_constpool_get(), rz_str_newf(), rz_warn_if_fail, rz_analysis_t::sdb_cc, rz_analysis_options_t::searchstringrefs, set_fcn_name_from_flag(), strdup(), rz_analysis_function_t::type, rz_bin_symbol_t::type, ut64(), and UT64_MAX.
Referenced by rz_core_analysis_fcn().
|
static |
Definition at line 349 of file canalysis.c.
References addr, b, i, rz_analysis_block_get_op_addr(), ut64(), and UT64_MAX.
Referenced by bb_info_print().
Definition at line 6461 of file canalysis.c.
References rz_core_t::analysis, archIsThumbable(), rz_core_t::config, core_noretl::core, rz_core_t::flags, free(), from, NULL, PFMT64x, rz_analysis_archinfo(), RZ_ANALYSIS_ARCHINFO_ALIGN, rz_analysis_get_fcn_in(), RZ_ANALYSIS_XREF_TYPE_NULL, rz_analysis_xrefs_set(), rz_config_get_b(), rz_config_get_i(), rz_cons_printf(), rz_flag_get_at(), rz_flag_set(), RZ_LOG_DEBUG, rz_meta_set(), RZ_META_TYPE_DATA, RZ_OUTPUT_MODE_RIZIN, rz_str_newf(), and to.
Referenced by rz_core_analysis_value_pointers().
|
static |
Definition at line 5243 of file canalysis.c.
References addr, rz_platform_item_t::comment, rz_core_t::flags, rz_platform_item_t::name, rz_core_meta_comment_add(), rz_flag_set(), RZ_FLAGS_FS_PLATFORM_PORTS, and v.
Referenced by rz_platform_index_add_flags_comments().
Definition at line 5222 of file canalysis.c.
References addr, flags, rz_flag_set(), RZ_FLAGS_FS_MMIO_REGISTERS_EXTENDED, and v.
Referenced by rz_platform_profile_add_flag_every_io().
Definition at line 5213 of file canalysis.c.
References addr, flags, rz_flag_set(), RZ_FLAGS_FS_MMIO_REGISTERS, and v.
Referenced by rz_platform_profile_add_flag_every_io().
Definition at line 2362 of file canalysis.c.
References addr, rz_core_t::analysis, f, rz_core_t::flags, free(), rz_analysis_ref_t::from, list(), rz_flag_item_t::name, NULL, PFMT64x, rz_analysis_xrefs_get_to(), rz_flag_get_at(), rz_flag_get_i(), RZ_FREE, rz_graph_add_edge(), rz_graph_add_node_info(), rz_list_free(), rz_return_if_fail, rz_str_new(), rz_str_newf(), and src.
Referenced by rz_core_analysis_codexrefs(), and rz_core_analysis_importxrefs().
Definition at line 4102 of file canalysis.c.
References rz_analysis_esil_t::address, rz_core_t::analysis, rz_analysis_t::esil, rz_core_t::flags, free(), is_string_at(), len, RZ_ANALYSIS_XREF_TYPE_DATA, rz_analysis_xrefs_set(), rz_flag_set(), RZ_FLAGS_FS_STRINGS, rz_meta_set(), rz_name_filter(), sdb_fmt(), and UT64_MAX.
Referenced by esilbreak_mem_read(), esilbreak_reg_write(), rz_core_analysis_esil(), and rz_core_search_value_in_range().
|
static |
Definition at line 5063 of file canalysis.c.
References addr, analPaths(), found, p, rz_analysis_find_most_relevant_block_in(), and UT64_MAX.
Referenced by analPaths().
|
static |
Definition at line 5075 of file canalysis.c.
References addr, rz_analysis_bb_t::addr, analPathFollow(), c, f, rz_analysis_bb_t::fail, i, rz_analysis_bb_t::jump, rz_analysis_bb_t::op_pos, rz_analysis_bb_t::op_pos_size, p, printAnalPaths(), rz_analysis_op_free(), RZ_ANALYSIS_OP_MASK_BASIC, RZ_ANALYSIS_OP_TYPE_CALL, rz_cons_is_breaked(), rz_core_analysis_op(), rz_list_append(), rz_list_pop(), and ut64().
Referenced by analPathFollow(), and rz_core_analysis_paths().
|
static |
Definition at line 2724 of file canalysis.c.
References addr, rz_analysis_bb_t::addr, rz_core_t::analysis, rz_analysis_function_t::cc, i, max_count, memcpy(), rz_analysis_bb_t::parent_stackptr, pos, REG_SET_SIZE, rz_analysis_cc_max_arg(), rz_analysis_extract_rarg(), rz_analysis_extract_vars(), rz_analysis_op_free(), RZ_ANALYSIS_OP_MASK_ESIL, RZ_ANALYSIS_OP_MASK_HINT, RZ_ANALYSIS_OP_MASK_VAL, RZ_ANALYSIS_OP_TYPE_CALL, RZ_ANALYSIS_STACK_INC, RZ_ANALYSIS_STACK_RESET, rz_cons_is_breaked(), rz_core_analysis_op(), RZ_NEWS, rz_pvector_at(), rz_pvector_len(), rz_pvector_push(), rz_analysis_bb_t::size, rz_analysis_function_t::stack, and ut64().
Referenced by rz_core_recover_vars().
|
static |
Definition at line 2711 of file canalysis.c.
References free(), i, REG_SET_SIZE, rz_pvector_at(), rz_pvector_len(), and rz_pvector_pop().
Referenced by rz_core_recover_vars().
Definition at line 2851 of file canalysis.c.
References addr, rz_analysis_function_t::addr, rz_core_t::analysis, analysis_path_exists(), rz_analysis_ref_t::from, list(), NULL, rz_core_t::offset, rz_analysis_get_fcn_in(), RZ_ANALYSIS_XREF_TYPE_CALL, rz_analysis_xrefs_get_to(), rz_list_free(), rz_list_length(), rz_list_new(), rz_analysis_ref_t::type, and ut64().
Referenced by rz_core_analysis_graph_to().
|
static |
Definition at line 2797 of file canalysis.c.
References rz_core_t::analysis, eprintf, rz_analysis_bb_t::fail, rz_analysis_ref_t::from, from, rz_analysis_bb_t::jump, NULL, rz_analysis_find_most_relevant_block_in(), rz_analysis_function_get_xrefs_from(), rz_analysis_get_fcn_in(), RZ_ANALYSIS_XREF_TYPE_CALL, rz_list_free(), rz_list_prepend(), rz_return_val_if_fail, rz_analysis_ref_t::to, to, and rz_analysis_ref_t::type.
Referenced by analysis_graph_to().
Definition at line 5971 of file canalysis.c.
References path, rz_file_is_directory(), rz_sign_sigdb_free(), rz_sign_sigdb_load_database(), rz_sign_sigdb_merge(), RZ_STR_ISEMPTY, and autogen_x86imm::tmp.
Referenced by rz_core_analysis_sigdb_list().
|
static |
Definition at line 5168 of file canalysis.c.
References eprintf, f, rz_analysis_bb_t::ninstr, PFMT64x, rz_analysis_block_get_op_addr(), rz_analysis_function_contains(), rz_analysis_op_free(), RZ_ANALYSIS_OP_MASK_HINT, RZ_ANALYSIS_OP_TYPE_ILL, RZ_ANALYSIS_OP_TYPE_JMP, RZ_ANALYSIS_OP_TYPE_MASK, RZ_ANALYSIS_OP_TYPE_RET, rz_core_op_analysis(), ut64(), and UT64_MAX.
Referenced by reanalyze_fcns_cb(), and rz_core_analysis_propagate_noreturn().
Definition at line 6453 of file canalysis.c.
References rz_asm_t::bits, core_noretl::core, rz_asm_t::cur, NULL, and rz_core_t::rasm.
Referenced by _CbInRangeAav().
|
static |
Definition at line 776 of file canalysis.c.
References rz_analysis_function_t::bbs, rz_core_t::flags, rz_analysis_function_t::name, rz_flag_item_t::name, rz_analysis_function_get_xrefs_from(), RZ_ANALYSIS_XREF_TYPE_CALL, rz_flag_get_i(), RZ_FREE, rz_list_first(), rz_list_free(), rz_list_length(), rz_str_newf(), rz_str_startswith(), rz_analysis_ref_t::to, and rz_analysis_ref_t::type.
Referenced by __core_analysis_fcn().
Definition at line 472 of file canalysis.c.
References a, rz_analysis_bb_t::addr, and b.
Referenced by rz_core_analysis_bbs_info_print().
|
static |
Definition at line 363 of file canalysis.c.
References __opaddr(), addr, rz_analysis_case_obj_t::addr, rz_analysis_switch_obj_t::addr, rz_analysis_bb_t::addr, rz_analysis_function_t::bbs, casecmp(), rz_analysis_switch_obj_t::cases, rz_debug_tracepoint_t::count, rz_core_t::dbg, rz_analysis_switch_obj_t::def_val, rz_analysis_bb_t::fail, rz_analysis_case_obj_t::jump, rz_analysis_bb_t::jump, rz_analysis_switch_obj_t::max_val, rz_analysis_switch_obj_t::min_val, rz_analysis_bb_t::ninstr, NULL, PFMT64d, PFMT64x, pj_a(), pj_end(), pj_k(), pj_kb(), pj_ki(), pj_kn(), pj_o(), rz_cons_newline(), rz_cons_printf(), rz_debug_trace_get(), rz_list_free(), rz_list_length(), rz_list_uniq(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_LONG, RZ_OUTPUT_MODE_QUIET, RZ_OUTPUT_MODE_RIZIN, RZ_OUTPUT_MODE_STANDARD, RZ_OUTPUT_MODE_TABLE, rz_str_bool(), rz_table_add_rowf(), rz_warn_if_reached, rz_analysis_bb_t::size, rz_analysis_bb_t::switch_op, rz_debug_tracepoint_t::times, rz_analysis_bb_t::traced, ut64(), UT64_MAX, and rz_analysis_case_obj_t::value.
Referenced by rz_core_analysis_bb_info_print(), and rz_core_analysis_bbs_info_print().
Definition at line 526 of file canalysis.c.
References i, list(), and RZ_ARRAY_SIZE.
Referenced by rz_core_analysis_function_autoname().
|
static |
Definition at line 3703 of file canalysis.c.
References block_flags_stat_t::blocks, block_flags_stat_t::from, rz_flag_item_t::offset, and block_flags_stat_t::step.
Referenced by rz_core_analysis_get_stats().
|
static |
Definition at line 4097 of file canalysis.c.
References eprintf, and esil_analysis_stop.
Referenced by rz_core_analysis_esil().
Definition at line 6279 of file canalysis.c.
References sections(), and value.
Referenced by rz_analysis_add_device_peripheral_map().
|
static |
Definition at line 1513 of file canalysis.c.
References rz_analysis_bb_t::addr, rz_core_t::config, free(), rz_core_t::offset, palColorFor(), PFMT64x, rz_config_get_i(), and rz_cons_printf().
Referenced by core_analysis_graph_construct_edges().
|
static |
Definition at line 3017 of file canalysis.c.
References rz_core_t::analysis, rz_analysis_t::bits, int, rz_core_t::io, RZ_ANALYSIS_XREF_TYPE_CODE, RZ_ANALYSIS_XREF_TYPE_DATA, rz_analysis_xrefs_set(), rz_io_read_i(), type, ut64(), and UT64_MAX.
Referenced by rz_core_analysis_search().
|
static |
Definition at line 1525 of file canalysis.c.
References rz_analysis_case_obj_t::addr, rz_analysis_bb_t::addr, rz_analysis_function_t::bbs, rz_analysis_switch_obj_t::cases, core_analysis_color_curr_node(), DB, rz_analysis_bb_t::fail, free(), from, get_title(), rz_cons_t::is_html, rz_analysis_case_obj_t::jump, rz_analysis_bb_t::jump, key, palColorFor(), PFMT64d, PFMT64x, rz_cons_printf(), rz_cons_singleton(), RZ_CORE_ANALYSIS_JSON, RZ_CORE_ANALYSIS_KEYVALUE, RZ_CORE_ANALYSIS_STAR, sdb_array_add_num(), sdb_num_set(), sdb_set(), snprintf, rz_analysis_bb_t::switch_op, to, UT64_MAX, val, and rz_analysis_case_obj_t::value.
Referenced by core_analysis_graph_nodes().
|
static |
Definition at line 1654 of file canalysis.c.
References rz_analysis_diff_t::addr, rz_analysis_case_obj_t::addr, rz_analysis_bb_t::addr, rz_analysis_function_t::bbs, c, rz_core_t::c2, color, rz_analysis_bb_t::colorize, rz_core_t::config, core_analysis_graph_label(), rz_debug_tracepoint_t::count, DB, rz_core_t::dbg, rz_analysis_bb_t::diff, eprintf, rz_analysis_bb_t::fail, free(), get_title(), if(), rz_core_t::io, rz_cons_t::is_html, rz_analysis_case_obj_t::jump, rz_analysis_bb_t::jump, key, malloc(), rz_analysis_function_t::name, NULL, rz_core_t::offset, palColorFor(), PFMT64u, PFMT64x, pj_a(), pj_end(), pj_k(), pj_ki(), pj_kn(), pj_o(), RZ_ANALYSIS_DIFF_TYPE_MATCH, RZ_ANALYSIS_DIFF_TYPE_UNMATCH, rz_base64_encode_dyn(), rz_config_get(), rz_config_get_i(), rz_config_hold_free(), rz_config_hold_i(), rz_config_hold_new(), rz_config_set_i(), rz_cons_printf(), rz_cons_singleton(), RZ_CORE_ANALYSIS_GRAPHDIFF, RZ_CORE_ANALYSIS_JSON, RZ_CORE_ANALYSIS_JSON_FORMAT_DISASM, RZ_CORE_ANALYSIS_KEYVALUE, RZ_CORE_ANALYSIS_STAR, rz_core_cmd_strf(), rz_core_print_disasm(), rz_core_print_disasm_json(), rz_debug_trace_get(), rz_diff_free(), rz_diff_lines_new(), rz_diff_unified_text(), rz_io_read_at(), RZ_OUTPUT_MODE_JSON, rz_str_cpy, rz_str_prepend(), rz_str_replace(), sdb_array_push_num(), sdb_num_set(), sdb_set(), rz_analysis_bb_t::size, snprintf, cmd_descs_generate::str, rz_analysis_bb_t::switch_op, rz_debug_tracepoint_t::times, rz_analysis_bb_t::traced, rz_analysis_diff_t::type, UT64_MAX, and rz_analysis_case_obj_t::value.
Referenced by core_analysis_graph_nodes().
|
static |
Definition at line 1453 of file canalysis.c.
References addr, rz_analysis_bb_t::addr, rz_core_t::bin, cmd, cmdstr, COLOR_MODE_DISABLED, rz_core_t::config, free(), setup::idx, rz_cons_t::is_html, setup::line, memcpy(), NULL, PFMT64u, PFMT64x, realloc(), rz_bin_addr2line(), rz_config_get_b(), rz_config_get_i(), rz_config_set(), rz_config_set_i(), rz_cons_singleton(), RZ_CORE_ANALYSIS_GRAPHBODY, RZ_CORE_ANALYSIS_GRAPHLINES, RZ_CORE_ANALYSIS_JSON, RZ_CORE_ANALYSIS_STAR, rz_core_cmd_str(), rz_file_slurp_line(), rz_str_escape_dot(), rz_analysis_bb_t::size, snprintf, cmd_descs_generate::str, and ut64().
Referenced by core_analysis_graph_construct_nodes().
|
static |
Definition at line 1906 of file canalysis.c.
References rz_analysis_function_t::addr, rz_core_t::analysis, rz_analysis_function_t::bbs, core_analysis_graph_construct_edges(), core_analysis_graph_construct_nodes(), DB, free(), rz_analysis_function_t::maxstack, rz_analysis_function_t::name, rz_analysis_function_t::ninstr, NULL, palColorFor(), PFMT64x, pj_a(), pj_end(), pj_k(), pj_ki(), pj_kn(), pj_ks(), pj_o(), rz_analysis_fcntype_tostring(), rz_analysis_function_linear_size(), rz_analysis_var_count(), RZ_CORE_ANALYSIS_JSON, RZ_CORE_ANALYSIS_KEYVALUE, rz_return_val_if_fail, rz_str_escape_utf8_for_json(), rz_str_get_null(), rz_analysis_t::sdb, sdb_encode(), sdb_ns(), sdb_num_set(), sdb_set(), snprintf, and rz_analysis_function_t::type.
Referenced by rz_core_analysis_graph().
Definition at line 3228 of file canalysis.c.
References from, rz_core_t::io, rz_core_analysis_search_xrefs(), rz_io_size(), to, and UT64_MAX.
Referenced by rz_core_analysis_refs().
|
static |
Definition at line 4157 of file canalysis.c.
References RZ_ANALYSIS_VAR_ACCESS_TYPE_WRITE, and type.
Referenced by handle_var_stack_access().
|
static |
resolve ptr
Definition at line 4211 of file canalysis.c.
References add_string_ref(), addr, rz_analysis_esil_t::address, rz_analysis_esil_t::analysis, rz_core_t::analysis, rz_analysis_t::big_endian, rz_core_bind_t::core, rz_analysis_t::coreb, esilbreak_last_data, esilbreak_last_read, handle_var_stack_access(), rz_core_t::io, len, myvalid(), ntarget, RZ_ANALYSIS_VAR_ACCESS_TYPE_READ, RZ_ANALYSIS_XREF_TYPE_DATA, rz_analysis_xrefs_set(), rz_io_read_at(), rz_read_ble16(), rz_read_ble32(), rz_read_ble64(), cmd_descs_generate::str, ut64(), and UT64_MAX.
Referenced by rz_core_analysis_esil().
|
static |
Definition at line 4199 of file canalysis.c.
References addr, handle_var_stack_access(), len, and RZ_ANALYSIS_VAR_ACCESS_TYPE_WRITE.
Referenced by rz_core_analysis_esil().
|
static |
Definition at line 4263 of file canalysis.c.
References add_string_ref(), rz_analysis_esil_t::address, rz_analysis_esil_t::analysis, rz_analysis_plugin_t::arch, rz_analysis_options_t::armthumb, rz_analysis_t::bits, rz_asm_t::bits, rz_core_bind_t::core, rz_analysis_t::coreb, rz_analysis_t::cur, rz_asm_t::cur, handle_var_stack_access(), rz_io_bind_t::io, rz_analysis_t::iob, rz_analysis_t::opt, rz_core_t::rasm, rz_analysis_t::reg, rz_analysis_hint_set_bits(), RZ_ANALYSIS_OP_TYPE_RCALL, RZ_ANALYSIS_OP_TYPE_RJMP, RZ_ANALYSIS_VAR_ACCESS_TYPE_PTR, rz_io_is_valid_offset(), rz_reg_getv(), rz_analysis_esil_t::user, UT32_MAX, ut64(), UT64_MAX, and val.
Referenced by rz_core_analysis_esil().
|
static |
Definition at line 4415 of file canalysis.c.
References addr, and rz_analysis_bb_t::addr.
Referenced by get_next_i().
|
static |
Definition at line 5500 of file canalysis.c.
References addr, rz_core_t::analysis, bit, blocks, NULL, rz_analysis_block_op_starts_at(), rz_analysis_block_ref(), rz_analysis_get_blocks_in(), and rz_list_free().
Referenced by process_reference_noreturn_cb(), and rz_core_analysis_propagate_noreturn().
Definition at line 2005 of file canalysis.c.
References f, and RZ_FLAGS_FS_SYMBOLS.
Referenced by is_skippable_addr().
|
static |
Definition at line 755 of file canalysis.c.
References rz_analysis_function_t::addr, f, flags, free(), rz_analysis_function_t::name, RZ_ANALYSIS_FCN_TYPE_FCN, rz_analysis_fcntype_tostring(), rz_flag_get_i(), rz_flag_rename(), rz_str_newf(), and rz_analysis_function_t::type.
Referenced by rz_core_analysis_fcn().
Definition at line 4419 of file canalysis.c.
References rz_analysis_bb_t::addr, rz_analysis_switch_obj_t::cases, rz_list_iter_t::data, rz_analysis_bb_t::fail, find_bb(), rz_list_t::head, rz_analysis_case_obj_t::jump, rz_analysis_bb_t::jump, rz_list_iter_t::n, NULL, rz_analysis_get_block_at(), rz_list_clone(), rz_list_delete(), rz_list_find(), rz_list_first(), rz_list_free(), rz_list_last(), rz_list_new(), rz_list_pop(), rz_list_push(), rz_reg_arena_pop(), rz_reg_arena_push(), rz_analysis_bb_t::size, rz_analysis_bb_t::switch_op, ut64(), and UT64_MAX.
Referenced by rz_core_analysis_esil().
|
static |
Definition at line 1028 of file canalysis.c.
References addr, PFMT64x, and rz_str_newf().
Referenced by core_analysis_graph_construct_edges(), core_analysis_graph_construct_nodes(), rz_core_analysis_graph(), and rz_core_print_bb_custom().
Definition at line 45 of file canalysis.c.
References addr, rz_bin_object_t::addrzklassmethod, rz_core_t::bin, rz_bin_symbol_t::classname, rz_core_t::flags, rz_bin_symbol_t::name, rz_flag_item_t::name, NULL, rz_bin_file_t::o, rz_bin_cur(), rz_core_flag_get_by_spaces(), rz_str_newf(), and strdup().
Referenced by __core_analysis_fcn().
Definition at line 57 of file canalysis.c.
References rz_core_t::analysis, off, PFMT64x, rz_analysis_t::reg, rz_reg_get(), rz_str_newf(), and strdup().
Referenced by rz_core_analysis_function_rename().
|
static |
Definition at line 4306 of file canalysis.c.
References addr, rz_core_t::analysis, rz_analysis_esil_t::cur, free(), setup::idx, rz_core_t::io, malloc(), memcpy(), NULL, rz_analysis_esil_t::old, PFMT64u, rz_core_t::rasm, rz_analysis_t::reg, rz_analysis_esil_parse(), rz_analysis_esil_set_pc(), rz_analysis_esil_stack_free(), rz_analysis_function_linear_size(), rz_analysis_get_fcn_in(), rz_analysis_op(), rz_analysis_op_fini(), RZ_ANALYSIS_OP_MASK_ESIL, RZ_ANALYSIS_OP_TYPE_CMOV, RZ_ANALYSIS_OP_TYPE_CRET, RZ_ANALYSIS_OP_TYPE_MOV, RZ_ANALYSIS_OP_TYPE_RET, rz_asm_set_pc(), RZ_EMPTY, rz_io_read_at(), rz_reg_get_name(), RZ_REG_NAME_SP, rz_str_trim(), RZ_STRBUF_SAFEGET, snprintf, and ut64().
Referenced by rz_core_analysis_esil().
|
static |
Definition at line 4173 of file canalysis.c.
References addr, rz_analysis_esil_t::analysis, delta_for_access(), free(), len, NULL, rz_analysis_t::reg, reg_name_for_access(), regname(), RZ_ABS, rz_analysis_function_autoname_var(), rz_analysis_function_get_var(), rz_analysis_function_set_var(), RZ_ANALYSIS_VAR_KIND_BPV, RZ_ANALYSIS_VAR_KIND_SPV, rz_analysis_var_set_access(), rz_reg_getv(), rz_str_newf(), type, rz_analysis_esil_t::user, and ut64().
Referenced by esilbreak_mem_read(), esilbreak_mem_write(), and esilbreak_reg_write().
HEAPTYPE | ( | ut64 | ) |
Definition at line 1334 of file canalysis.c.
References container_of, and ut64().
Referenced by print_addr_hint_cb(), print_arch_hint_cb(), and print_bits_hint_cb().
void hint_node_free | ( | RBNode * | node, |
void * | user | ||
) |
Definition at line 1330 of file canalysis.c.
References container_of, and free().
Referenced by rz_core_analysis_hint_list_print(), and rz_core_analysis_hint_print().
|
static |
Definition at line 1176 of file canalysis.c.
References HintNode::addr, HintNode::addr_hints, HintNode::arch, HintNode::bits, HINTCMD_ADDR, PFMT64x, pj_kb(), pj_ki(), pj_kn(), pj_knull(), pj_ks(), print_hint_h_format(), RZ_ANALYSIS_ADDR_HINT_TYPE_ESIL, RZ_ANALYSIS_ADDR_HINT_TYPE_FAIL, RZ_ANALYSIS_ADDR_HINT_TYPE_HIGH, RZ_ANALYSIS_ADDR_HINT_TYPE_IMMBASE, RZ_ANALYSIS_ADDR_HINT_TYPE_JUMP, RZ_ANALYSIS_ADDR_HINT_TYPE_NEW_BITS, RZ_ANALYSIS_ADDR_HINT_TYPE_NWORD, RZ_ANALYSIS_ADDR_HINT_TYPE_OPCODE, RZ_ANALYSIS_ADDR_HINT_TYPE_OPTYPE, RZ_ANALYSIS_ADDR_HINT_TYPE_PTR, RZ_ANALYSIS_ADDR_HINT_TYPE_RET, RZ_ANALYSIS_ADDR_HINT_TYPE_SIZE, RZ_ANALYSIS_ADDR_HINT_TYPE_STACKFRAME, RZ_ANALYSIS_ADDR_HINT_TYPE_SYNTAX, RZ_ANALYSIS_ADDR_HINT_TYPE_TYPE_OFFSET, RZ_ANALYSIS_ADDR_HINT_TYPE_VAL, rz_analysis_optype_to_string(), rz_cons_printf(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_RIZIN, rz_vector_foreach, type, and HintNode::type.
Referenced by print_hint_tree().
Definition at line 5765 of file canalysis.c.
References arch, rz_core_t::bin, rz_core_t::config, core_noretl::core, rz_bin_plugin_t::name, rz_bin_object_t::plugin, rz_bin_cur_object(), rz_config_get(), and rz_return_val_if_fail.
Referenced by rz_core_analysis_everything().
|
static |
Definition at line 809 of file canalysis.c.
References f, RZ_FLAGS_FS_SYMBOLS, and rz_str_startswith().
Referenced by __core_analysis_fcn().
Definition at line 2010 of file canalysis.c.
References addr, rz_analysis_function_t::addr, rz_core_t::analysis, find_sym_flag(), rz_core_t::flags, flags, rz_analysis_get_fcn_in(), rz_flag_get_list(), and rz_list_find().
Referenced by rz_core_analysis_fcn().
Definition at line 66 of file canalysis.c.
References i, IS_PRINTABLE, len, and MINLEN.
Referenced by is_string_at(), and stringAt().
Definition at line 99 of file canalysis.c.
References addr, calloc(), free(), rz_core_t::io, is_string(), len, NULL, rz_io_read_at(), cmd_descs_generate::str, UT32_MAX, and ut64().
Referenced by add_string_ref(), rz_core_analysis_esil(), and set_new_xref().
Definition at line 5758 of file canalysis.c.
References rz_core_t::bin, core_noretl::core, rz_bin_t::cur, rz_bin_file_t::o, and rz_bin_object_t::sections.
Referenced by rz_core_analysis_everything().
|
static |
Validates a xref. Mainly checks if it points out of the memory map.
core | The rizin core. |
xref_to | The target address of the xref. |
type | The xref type. |
cfg_debug | Flag if debugging configured. |
Definition at line 3324 of file canalysis.c.
References rz_core_t::dbg, rz_core_t::io, RZ_ANALYSIS_XREF_TYPE_NULL, rz_debug_map_get(), rz_io_is_valid_offset(), type, and rz_io_t::va.
Referenced by rz_core_analysis_search_xrefs().
|
static |
Definition at line 3535 of file canalysis.c.
References rz_str_startswith(), and s.
Referenced by rz_core_analysis_all().
Definition at line 4863 of file canalysis.c.
References addr, desc, rz_core_t::io, map(), rz_io_desc_get(), rz_io_fd_size(), rz_io_map_get(), and st64.
Referenced by rz_core_search_value_in_range().
|
static |
Definition at line 3527 of file canalysis.c.
References rz_bin_symbol_t::paddr, RZ_BIN_TYPE_FUNC_STR, RZ_BIN_TYPE_HIOS_STR, RZ_BIN_TYPE_LOOS_STR, RZ_BIN_TYPE_METH_STR, RZ_BIN_TYPE_STATIC_STR, type, rz_bin_symbol_t::type, and UT64_MAX.
Referenced by rz_core_analysis_all().
Definition at line 30 of file canalysis.c.
References eprintf, from, PFMT64x, rz_cons_clear_line(), and to.
Referenced by __core_analysis_fcn(), and rz_core_analysis_cycles().
Definition at line 4124 of file canalysis.c.
References addr, rz_io_is_valid_offset(), UT32_MAX, and UT64_MAX.
Referenced by esilbreak_mem_read(), and rz_core_analysis_esil().
Definition at line 636 of file canalysis.c.
References NULL, realloc(), ut64(), and v.
Referenced by __core_analysis_fcn().
|
static |
Definition at line 3039 of file canalysis.c.
References addr, rz_core_t::analysis, arch, len, rz_analysis_op(), RZ_ANALYSIS_OP_MASK_BASIC, RZ_ANALYSIS_OP_TYPE_CALL, RZ_ANALYSIS_OP_TYPE_CCALL, RZ_ANALYSIS_OP_TYPE_MASK, RZ_ARCH_ARM64, rz_analysis_op_t::size, and rz_analysis_op_t::type.
Referenced by rz_core_analysis_search().
|
static |
Definition at line 1505 of file canalysis.c.
References rcolor_t::b, rcolor_t::g, k, NULL, rcolor_t::r, rcolor, rz_cons_pal_get(), rz_cons_rgb_tostring(), and rz_cons_singleton().
Referenced by core_analysis_color_curr_node(), core_analysis_graph_construct_edges(), core_analysis_graph_construct_nodes(), and core_analysis_graph_nodes().
Definition at line 1345 of file canalysis.c.
References addr, HintNode::addr, HintNode::addr_hints, hint_node_cmp(), NULL, HintNode::rb, RZ_NEW0, rz_rbtree_insert(), and HintNode::type.
Referenced by rz_core_analysis_hint_list_print(), and rz_core_analysis_hint_print().
bool print_arch_hint_cb | ( | ut64 | addr, |
RZ_NULLABLE const char * | arch, | ||
void * | user | ||
) |
Definition at line 1357 of file canalysis.c.
References addr, HintNode::addr, HintNode::arch, arch, hint_node_cmp(), NULL, HintNode::rb, RZ_NEW0, rz_rbtree_insert(), and HintNode::type.
Referenced by rz_core_analysis_hint_list_print(), and rz_core_analysis_hint_print().
Definition at line 1369 of file canalysis.c.
References addr, HintNode::addr, HintNode::bits, bits(), hint_node_cmp(), NULL, HintNode::rb, RZ_NEW0, rz_rbtree_insert(), and HintNode::type.
Referenced by rz_core_analysis_hint_list_print(), and rz_core_analysis_hint_print().
|
static |
Definition at line 1097 of file canalysis.c.
References HintNode::addr_hints, HintNode::arch, HintNode::bits, PFMT64u, PFMT64x, RZ_ANALYSIS_ADDR_HINT_TYPE_ESIL, RZ_ANALYSIS_ADDR_HINT_TYPE_FAIL, RZ_ANALYSIS_ADDR_HINT_TYPE_HIGH, RZ_ANALYSIS_ADDR_HINT_TYPE_IMMBASE, RZ_ANALYSIS_ADDR_HINT_TYPE_JUMP, RZ_ANALYSIS_ADDR_HINT_TYPE_NEW_BITS, RZ_ANALYSIS_ADDR_HINT_TYPE_NWORD, RZ_ANALYSIS_ADDR_HINT_TYPE_OPCODE, RZ_ANALYSIS_ADDR_HINT_TYPE_OPTYPE, RZ_ANALYSIS_ADDR_HINT_TYPE_PTR, RZ_ANALYSIS_ADDR_HINT_TYPE_RET, RZ_ANALYSIS_ADDR_HINT_TYPE_SIZE, RZ_ANALYSIS_ADDR_HINT_TYPE_STACKFRAME, RZ_ANALYSIS_ADDR_HINT_TYPE_SYNTAX, RZ_ANALYSIS_ADDR_HINT_TYPE_TYPE_OFFSET, RZ_ANALYSIS_ADDR_HINT_TYPE_VAL, rz_analysis_optype_to_string(), rz_cons_printf(), rz_vector_foreach, type, and HintNode::type.
Referenced by hint_node_print().
|
static |
Definition at line 1381 of file canalysis.c.
References HintNode::addr, END_ADDR, hint_node_print(), NULL, PFMT64x, pj_a(), pj_end(), pj_kn(), pj_o(), rz_cons_printf(), RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_STANDARD, rz_rbtree_foreach, and ut64().
Referenced by rz_core_analysis_hint_list_print(), and rz_core_analysis_hint_print().
|
static |
Definition at line 5037 of file canalysis.c.
References p, path, PFMT64x, pj_a(), pj_end(), pj_n(), and rz_cons_printf().
Referenced by analPaths().
Definition at line 5562 of file canalysis.c.
References addr, rz_core_t::analysis, rz_core_t::blocksize, CALL_BUF_SIZE, core_noretl::core, find_block_at_xref_addr(), rz_io_bind_t::io, rz_analysis_t::iob, k, core_noretl::noretl, PFMT64x, rz_io_bind_t::read_at, relocation_noreturn_process(), rz_analysis_op(), rz_analysis_op_fini(), RZ_ANALYSIS_XREF_TYPE_CALL, RZ_ANALYSIS_XREF_TYPE_CODE, rz_core_getreloc(), RZ_LOG_INFO, core_noretl::todo, rz_analysis_ref_t::type, ut64(), and v.
Referenced by process_refs_cb().
Definition at line 5594 of file canalysis.c.
References process_reference_noreturn_cb(), and v.
Referenced by rz_core_analysis_propagate_noreturn_relocs().
Definition at line 5600 of file canalysis.c.
References rz_analysis_function_t::addr, rz_core_t::analysis, analyze_noreturn_function(), core_noretl::core, rz_analysis_function_t::is_noreturn, k, NULL, and rz_analysis_noreturn_add().
Referenced by rz_core_analysis_propagate_noreturn_relocs().
|
static |
Definition at line 2683 of file canalysis.c.
References dest, from, NULL, and recurse_bb().
Referenced by recurse_bb().
|
static |
Definition at line 2692 of file canalysis.c.
References addr, rz_core_t::analysis, dest, eprintf, NULL, recurse(), and rz_analysis_find_most_relevant_block_in().
Referenced by recurse().
|
static |
Definition at line 4144 of file canalysis.c.
References NULL, RZ_ANALYSIS_VAR_ACCESS_TYPE_WRITE, and type.
Referenced by handle_var_stack_access().
|
static |
Definition at line 5521 of file canalysis.c.
References addr, rz_core_t::analysis, b, NULL, rz_analysis_block_chop_noreturn(), rz_analysis_noreturn_add(), set_u_add(), and ut64().
Referenced by relocation_noreturn_process().
|
static |
Definition at line 5536 of file canalysis.c.
References addr, b, rz_bin_reloc_t::import, rz_bin_symbol_t::name, rz_bin_import_t::name, relocation_function_process_noreturn(), rz_bin_reloc_t::symbol, rz_bin_symbol_t::vaddr, and rz_bin_reloc_t::vaddr.
Referenced by process_reference_noreturn_cb().
RZ_API bool rz_analysis_add_device_peripheral_map | ( | RzBinObject * | o, |
RzAnalysis * | analysis | ||
) |
Maps the device peripherals as sections.
Gets the ROM_ADDRESS and ROM_SIZE from the corresponding CPU Profile and adds it as a section (RzBinSection) named ".rom" which will appear when you run iS
.
o | reference to RzBinObject |
analysis | reference to RzAnalysis |
Definition at line 6295 of file canalysis.c.
References rz_analysis_t::arch_target, check_rom_exists(), rz_platform_target_t::profile, rz_platform_profile_t::rom_address, rz_platform_profile_t::rom_size, rz_list_append(), rz_list_find(), RZ_NEW0, RZ_PERM_RX, rz_return_val_if_fail, s, rz_bin_object_t::sections, strdup(), and ut64().
Referenced by rz_core_analysis_everything().
|
static |
Definition at line 726 of file canalysis.c.
References rz_core_t::analysis, rz_analysis_options_t::followdatarefs, rz_analysis_ref_t::from, rz_analysis_t::opt, rz_analysis_function_get_xrefs_from(), rz_analysis_try_get_fcn(), RZ_ANALYSIS_XREF_TYPE_CALL, RZ_ANALYSIS_XREF_TYPE_CODE, RZ_ANALYSIS_XREF_TYPE_DATA, rz_core_analysis_fcn(), rz_list_free(), rz_analysis_ref_t::to, rz_analysis_ref_t::type, and UT64_MAX.
Referenced by __core_analysis_fcn().
RZ_API void rz_analysis_bytes_free | ( | RZ_NULLABLE void * | ptr | ) |
Free RzAnalysisBytes
ptr | RzAnalysisBytes pointer |
Definition at line 6791 of file canalysis.c.
References free(), rz_analysis_hint_free(), and rz_analysis_op_free().
Referenced by rz_core_analysis_bytes().
|
static |
Definition at line 647 of file canalysis.c.
References rz_core_t::analysis, rz_core_t::bin, rz_analysis_ref_t::from, rz_core_t::io, rz_analysis_function_get_xrefs_from(), RZ_ANALYSIS_XREF_TYPE_DATA, RZ_ANALYSIS_XREF_TYPE_STRING, rz_analysis_xrefs_set(), rz_bin_cur_object(), rz_bin_object_get_string_at(), rz_list_free(), rz_analysis_ref_t::to, rz_analysis_ref_t::type, and rz_io_t::va.
Referenced by __core_analysis_fcn().
|
static |
Definition at line 665 of file canalysis.c.
References rz_core_t::analysis, rz_analysis_t::big_endian, rz_analysis_t::bits, rz_analysis_range_t::from, rz_analysis_ref_t::from, rz_core_t::io, rz_analysis_t::limit, map(), rz_analysis_check_fcn(), RZ_ANALYSIS_XREF_TYPE_DATA, rz_core_analysis_fcn(), rz_io_map_get(), rz_io_read_at(), RZ_MIN, RZ_PERM_X, rz_read_ble16(), rz_read_ble32(), rz_read_ble64(), rz_read_ble8(), rz_analysis_range_t::to, rz_analysis_ref_t::to, rz_analysis_ref_t::type, and ut64().
Referenced by rz_analysis_analyze_fcn_refs().
RZ_IPI bool rz_analysis_var_global_list_show | ( | RzAnalysis * | analysis, |
RzCmdStateOutput * | state, | ||
RZ_NULLABLE const char * | name | ||
) |
Definition at line 6220 of file canalysis.c.
References addr, rz_analysis_var_global_t::addr, free(), rz_analysis_var_global_t::name, NULL, PFMT64x, pj_end(), pj_ks(), pj_o(), rz_analysis_var_global_get_all(), rz_analysis_var_global_get_byname(), rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cons_printf(), rz_list_append(), rz_list_free(), rz_list_new(), RZ_LOG_ERROR, RZ_OUTPUT_MODE_JSON, RZ_OUTPUT_MODE_STANDARD, rz_return_val_if_fail, rz_strf, rz_type_as_string(), rz_analysis_var_global_t::type, and rz_analysis_t::typedb.
Referenced by rz_analysis_print_global_variable_handler().
Definition at line 168 of file canalysis.c.
References addr, rz_core_t::analysis, rz_core_t::dbg, rz_io_t::desc, rz_core_t::flags, i, rz_core_t::io, IS_PRINTABLE, map(), maps(), rz_debug_t::maps, n, rz_io_desc_t::name, NULL, r, rz_analysis_t::reg, rs, RZ_ANALYSIS_ADDR_TYPE_ASCII, RZ_ANALYSIS_ADDR_TYPE_EXEC, RZ_ANALYSIS_ADDR_TYPE_FLAG, RZ_ANALYSIS_ADDR_TYPE_FUNC, RZ_ANALYSIS_ADDR_TYPE_HEAP, RZ_ANALYSIS_ADDR_TYPE_LIBRARY, RZ_ANALYSIS_ADDR_TYPE_PROGRAM, RZ_ANALYSIS_ADDR_TYPE_READ, RZ_ANALYSIS_ADDR_TYPE_REG, RZ_ANALYSIS_ADDR_TYPE_SEQUENCE, RZ_ANALYSIS_ADDR_TYPE_STACK, RZ_ANALYSIS_ADDR_TYPE_WRITE, rz_analysis_get_fcn_in(), rz_core_is_debug(), rz_flag_get_i(), rz_io_maps(), RZ_MIN, RZ_PERM_R, RZ_PERM_W, RZ_PERM_X, rz_pvector_foreach, rz_reg_getv(), rz_reg_regset_get(), RZ_REG_TYPE_GPR, s, types, ut64(), and val.
Referenced by cmd_address_info(), ds_print_ptr(), esil_addrinfo(), rz_core_analysis_hasrefs_to_depth(), and rz_core_analysis_optype_colorfor().
Definition at line 3552 of file canalysis.c.
References addr, rz_core_t::analysis, rz_analysis_t::arch_target, rz_core_t::bin, rz_core_t::config, rz_bin_t::cur, rz_analysis_options_t::depth, rz_analysis_t::fcns, rz_core_t::flags, isSkippable(), isValidSymbol(), list(), rz_analysis_function_t::name, NULL, rz_bin_file_t::o, rz_core_t::offset, rz_flag_item_t::offset, rz_analysis_t::opt, rz_bin_addr_t::paddr, rz_bin_symbol_t::paddr, rz_platform_target_t::profile, RZ_ANALYSIS_FCN_TYPE_SYM, RZ_ANALYSIS_XREF_TYPE_NULL, rz_bin_get_entries(), rz_bin_object_get_special_symbol(), rz_bin_object_get_vaddr(), RZ_BIN_SPECIAL_SYMBOL_MAIN, rz_config_get_i(), rz_cons_break_pop(), rz_cons_break_push(), rz_cons_is_breaked(), rz_core_analysis_fcn(), rz_core_analysis_function_add(), rz_core_analysis_function_rename(), rz_core_recover_vars(), rz_core_task_yield(), rz_flag_get(), rz_platform_index_add_flags_comments(), rz_platform_profile_add_flag_every_io(), rz_bin_object_t::symbols, rz_core_t::tasks, rz_analysis_function_t::type, ut64(), UT64_MAX, rz_bin_addr_t::vaddr, and rz_bin_symbol_t::vaddr.
Referenced by __program_cb(), __symbols_cb(), and core_perform_auto_analysis().
RZ_IPI char* rz_core_analysis_all_vars_display | ( | RzCore * | core, |
RzAnalysisFunction * | fcn, | ||
bool | add_name | ||
) |
Definition at line 6206 of file canalysis.c.
References rz_core_t::analysis, core_noretl::core, free(), list(), NULL, p, r, rz_analysis_var_all_list(), rz_core_analysis_var_display(), rz_list_free(), rz_strbuf_append(), rz_strbuf_drain(), rz_strbuf_new(), and sb.
Referenced by backtrace_vars(), and rz_analysis_function_vars_display_handler().
Definition at line 504 of file canalysis.c.
References rz_core_t::analysis, rz_analysis_t::fcns, rz_core_t::flags, free(), name, rz_analysis_function_t::name, rz_core_analysis_function_autoname(), rz_flag_get(), rz_flag_rename(), and rz_warn_if_reached.
Referenced by rz_autoname_all_functions_handler(), and rz_core_analysis_everything().
RZ_IPI void rz_core_analysis_bb_info_print | ( | RzCore * | core, |
RzAnalysisBlock * | bb, | ||
ut64 | addr, | ||
RzCmdStateOutput * | state | ||
) |
Definition at line 496 of file canalysis.c.
References addr, bb_info_print(), rz_analysis_bb_t::fcns, rz_cmd_state_output_set_columnsf(), rz_list_first(), and rz_return_if_fail.
Referenced by rz_analysis_basic_block_info_handler(), and rz_analysis_function_blocks_info_handler().
Definition at line 1975 of file canalysis.c.
References addr, rz_analysis_bb_t::addr, rz_core_t::analysis, rz_analysis_find_most_relevant_block_in(), and rz_core_seek_and_save().
RZ_IPI void rz_core_analysis_bbs_asciiart | ( | RzCore * | core, |
RzAnalysisFunction * | fcn | ||
) |
Definition at line 305 of file canalysis.c.
References b, rz_analysis_function_t::bbs, rz_core_t::blocksize, rz_core_t::config, info(), ls_foreach, NULL, rz_core_t::offset, rz_config_get_i(), rz_cons_get_size(), rz_cons_printf(), rz_core_table(), rz_list_append(), rz_list_free(), rz_list_newf(), rz_listinfo_free(), rz_listinfo_new(), rz_table_free(), rz_table_tostring(), and rz_table_visual_list().
Referenced by rz_analysis_function_blocks_asciiart_handler().
RZ_IPI void rz_core_analysis_bbs_info_print | ( | RzCore * | core, |
RzAnalysisFunction * | fcn, | ||
RzCmdStateOutput * | state | ||
) |
Definition at line 478 of file canalysis.c.
References rz_analysis_bb_t::addr, bb_cmp(), bb_info_print(), rz_analysis_function_t::bbs, rz_cmd_state_output_array_end(), rz_cmd_state_output_array_start(), rz_cmd_state_output_set_columnsf(), rz_cons_printf(), rz_list_sort(), RZ_OUTPUT_MODE_RIZIN, and rz_return_if_fail.
Referenced by rz_analysis_function_blocks_list_handler().
RZ_API RZ_OWN RzPVector* rz_core_analysis_bytes | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL const ut8 * | buf, | ||
int | len, | ||
int | nops | ||
) |
Analyze and disassemble bytes use rz_analysis_op and rz_asm_disassemble
core | The RzCore instance |
buf | data to analysis |
len | analysis len bytes |
nops | analysis n ops |
Definition at line 6817 of file canalysis.c.
References addr, rz_io_t::addrbytes, rz_core_t::analysis, arg(), calloc(), rz_core_t::config, core_noretl::core, rz_core_t::flags, free(), rz_parse_t::get_ptr_at, rz_parse_t::get_reg_at, int, rz_core_t::io, len, rz_parse_t::localvar_only, mask, mnem, NULL, rz_core_t::offset, rz_core_t::parser, rz_core_t::rasm, rz_analysis_archinfo(), RZ_ANALYSIS_ARCHINFO_MIN_OP_SIZE, rz_analysis_bytes_free(), rz_analysis_function_get_var_reg_at(), rz_analysis_function_get_var_stackptr_at(), rz_analysis_get_function_at(), rz_analysis_hint_get(), rz_analysis_mask(), rz_analysis_op(), RZ_ANALYSIS_OP_MASK_ESIL, RZ_ANALYSIS_OP_MASK_HINT, RZ_ANALYSIS_OP_MASK_IL, RZ_ANALYSIS_OP_MASK_OPEX, rz_analysis_op_new(), rz_asm_describe(), rz_asm_disassemble(), rz_asm_op_get_asm(), rz_asm_op_get_hex(), rz_asm_op_get_size(), rz_asm_op_set_asm(), rz_asm_set_pc(), rz_config_get_b(), rz_config_get_i(), rz_core_asm_bb_middle(), rz_disasm_check_end(), rz_hex_bin2strdup(), rz_io_read_at(), rz_io_read_i(), RZ_NEW0, rz_parse_filter(), rz_parse_pseudocode(), rz_parse_subvar(), rz_pvector_free(), rz_pvector_new(), rz_pvector_push(), rz_pvector_reserve(), rz_return_val_if_fail, sp, strdup(), rz_parse_t::subrel, rz_parse_t::subrel_addr, ut64(), and UT64_MAX.
Referenced by core_analysis_bytes_json(), core_analysis_bytes_standard(), and rz_core_print_disasm_json().
Definition at line 2425 of file canalysis.c.
References addr, rz_analysis_function_t::addr, rz_core_t::analysis, rz_core_t::config, rz_analysis_t::fcns, rz_core_t::flags, free(), from, rz_cons_t::is_html, msg, rz_analysis_function_t::name, rz_flag_item_t::name, NULL, PFMT64d, PFMT64x, pj_a(), pj_end(), pj_free(), pj_ka(), pj_kn(), pj_ks(), pj_new(), pj_o(), pj_s(), pj_string(), repeat(), rz_analysis_function_get_xrefs_from(), rz_analysis_function_linear_size(), RZ_ANALYSIS_XREF_TYPE_CALL, rz_config_get(), rz_config_get_i(), rz_cons_printf(), rz_cons_println(), rz_cons_singleton(), rz_flag_get_i(), RZ_GRAPH_FORMAT_DOT, RZ_GRAPH_FORMAT_GML, RZ_GRAPH_FORMAT_GMLFCN, RZ_GRAPH_FORMAT_JSON, RZ_GRAPH_FORMAT_NO, rz_list_append(), rz_list_find(), rz_list_free(), rz_list_new(), rz_str_newf(), RzAnalysisRef_cmp(), snprintf, strdup(), rz_analysis_ref_t::to, to, rz_analysis_ref_t::type, ut64(), and UT64_MAX.
Referenced by cmd_analysis_graph().
RZ_API st64 rz_core_analysis_calls_count | ( | RZ_NONNULL RzCore * | core | ) |
Compute analysis function xrefs count.
Definition at line 7115 of file canalysis.c.
References rz_core_t::analysis, core_noretl::core, rz_analysis_t::fcns, rz_analysis_function_get_xrefs_from(), rz_list_free(), rz_list_length(), rz_return_val_if_fail, st64, and ST64_MAX.
Referenced by rz_print_analysis_details_handler().
Definition at line 6628 of file canalysis.c.
References rz_core_t::analysis, rz_analysis_t::bits, bits(), rz_core_t::config, core_noretl::core, eprintf, free(), sdb_t::path, rz_analysis_t::reg, rz_analysis_cc_set(), rz_config_get(), rz_file_exists(), rz_file_path_join(), RZ_FREE, rz_path_home_prefix(), rz_path_system(), rz_reg_profile_to_cc(), RZ_SDB_TYPES, rz_strf, s, rz_analysis_t::sdb_cc, sdb_concat_by_path(), sdb_isempty(), sdb_reset(), and strdup().
Referenced by cb_asmarch(), cb_asmbits(), cb_asmos(), and rz_core_bin_apply_config().
RZ_IPI void rz_core_analysis_cc_print | ( | RzCore * | core, |
RZ_NONNULL const char * | cc, | ||
RZ_NULLABLE PJ * | pj | ||
) |
Print Calling Convention info.
core | The RzCore instance |
cc | Calling Convention name |
pj | Optional PJ instance for JSON mode |
Definition at line 6686 of file canalysis.c.
References rz_core_t::analysis, core_noretl::core, i, pj_end(), pj_ka(), pj_ks(), pj_o(), pj_s(), regname(), rz_analysis_cc_arg(), rz_analysis_cc_error(), rz_analysis_cc_max_arg(), rz_analysis_cc_ret(), rz_analysis_cc_self(), rz_cons_printf(), and rz_return_if_fail.
Referenced by rz_analysis_function_cc_reg_usage_handler(), and rz_core_types_calling_conventions_print().
RZ_API st64 rz_core_analysis_code_count | ( | RZ_NONNULL RzCore * | core | ) |
Compute analysis code count.
Definition at line 7098 of file canalysis.c.
References code, core_noretl::core, rz_core_t::io, map(), maps(), rz_io_maps(), RZ_PERM_X, rz_pvector_foreach, rz_return_val_if_fail, st64, and ST64_MAX.
Referenced by rz_print_analysis_details_handler().
Definition at line 2342 of file canalysis.c.
References addr, rz_core_t::analysis, dst, eprintf, rz_core_t::flags, rz_analysis_ref_t::from, rz_analysis_function_t::name, rz_flag_item_t::name, PFMT64x, rz_analysis_function_get_xrefs_from(), rz_analysis_get_fcn_in(), rz_cons_printf(), rz_flag_get_i(), rz_list_free(), sdb_fmt(), and rz_analysis_ref_t::to.
Referenced by cmd_analysis_graph().
Definition at line 2412 of file canalysis.c.
References add_single_addr_xrefs(), addr, NULL, and rz_graph_new().
Referenced by cmd_analysis_graph().
RZ_API bool rz_core_analysis_continue_until_call | ( | RZ_NONNULL RzCore * | core | ) |
Continue until call.
core | The RzCore instance |
Definition at line 7041 of file canalysis.c.
References addr, rz_core_t::analysis, core_noretl::core, rz_analysis_t::esil, NULL, rz_core_t::num, pc, PFMT64x, rz_analysis_t::reg, rz_analysis_op_free(), RZ_ANALYSIS_OP_MASK_BASIC, RZ_ANALYSIS_OP_TYPE_CALL, RZ_ANALYSIS_OP_TYPE_UCALL, rz_cons_is_breaked(), rz_core_analysis_op(), rz_core_esil_step(), rz_core_reg_update_flags(), RZ_LOG_ERROR, rz_num_get(), rz_reg_get_name(), RZ_REG_NAME_PC, rz_return_val_if_fail, rz_analysis_esil_t::trap, rz_analysis_esil_t::trap_code, ut64(), and UT64_MAX.
Referenced by rz_analysis_continue_until_call_handler().
RZ_API bool rz_core_analysis_continue_until_syscall | ( | RZ_NONNULL RzCore * | core | ) |
Continue until syscall.
core | The RzCore instance |
Definition at line 7005 of file canalysis.c.
References addr, rz_core_t::analysis, core_noretl::core, rz_analysis_t::esil, NULL, rz_core_t::num, pc, PFMT64x, rz_analysis_t::reg, rz_analysis_op_free(), RZ_ANALYSIS_OP_MASK_BASIC, RZ_ANALYSIS_OP_MASK_HINT, RZ_ANALYSIS_OP_TYPE_SWI, RZ_ANALYSIS_OP_TYPE_TRAP, rz_cons_is_breaked(), rz_core_analysis_op(), rz_core_esil_step(), rz_core_reg_update_flags(), RZ_LOG_ERROR, rz_num_get(), rz_reg_get_name(), RZ_REG_NAME_PC, rz_return_val_if_fail, rz_analysis_esil_t::trap, rz_analysis_esil_t::trap_code, ut64(), and UT64_MAX.
Referenced by rz_analysis_continue_until_syscall_handler().
RZ_API st64 rz_core_analysis_coverage_count | ( | RZ_NONNULL RzCore * | core | ) |
Compute analysis coverage count.
Definition at line 7072 of file canalysis.c.
References rz_analysis_function_t::addr, rz_core_t::analysis, core_noretl::core, rz_analysis_t::fcns, rz_core_t::io, map(), maps(), rz_analysis_function_realsize(), rz_io_maps(), rz_meta_get_size(), RZ_META_TYPE_DATA, RZ_PERM_X, rz_pvector_foreach, rz_return_val_if_fail, s, st64, ST64_MAX, and ut64().
Referenced by rz_print_analysis_details_handler().
Definition at line 3847 of file canalysis.c.
References addr, rz_analysis_cycle_hook_t::addr, rz_analysis_cycle_hook_t::cycles, eprintf, free(), rz_analysis_cycle_frame_t::hooks, loganalysis(), rz_analysis_cycle_frame_t::naddr, NULL, rz_core_t::offset, PFMT64x, rz_analysis_cycle_frame_t::prev, rz_analysis_cycle_frame_free(), rz_analysis_cycle_frame_new(), rz_analysis_op_free(), RZ_ANALYSIS_OP_MASK_BASIC, RZ_ANALYSIS_OP_TYPE_CALL, RZ_ANALYSIS_OP_TYPE_CCALL, RZ_ANALYSIS_OP_TYPE_CJMP, RZ_ANALYSIS_OP_TYPE_CRET, RZ_ANALYSIS_OP_TYPE_ICALL, RZ_ANALYSIS_OP_TYPE_IRCALL, RZ_ANALYSIS_OP_TYPE_JMP, RZ_ANALYSIS_OP_TYPE_MJMP, RZ_ANALYSIS_OP_TYPE_RCALL, RZ_ANALYSIS_OP_TYPE_RET, RZ_ANALYSIS_OP_TYPE_UCALL, RZ_ANALYSIS_OP_TYPE_UCCALL, RZ_ANALYSIS_OP_TYPE_UCJMP, RZ_ANALYSIS_OP_TYPE_UJMP, rz_cons_break_pop(), rz_cons_break_push(), rz_cons_clear_line(), rz_cons_is_breaked(), rz_core_analysis_op(), rz_list_append(), rz_list_free(), rz_list_new(), rz_list_pop(), rz_list_push(), RZ_NEW0, and ut64().
Referenced by rz_analyze_cycles_handler().
Definition at line 3635 of file canalysis.c.
References addr, rz_core_t::analysis, rz_asm_t::bits, rz_core_t::block, rz_core_t::blocksize, rz_core_t::config, rz_cons_t::context, count, d, free(), i, rz_core_t::io, len, malloc(), memset(), NULL, rz_cons_context_t::pal, rz_core_t::rasm, rz_analysis_data(), rz_analysis_data_free(), rz_analysis_data_to_string(), RZ_ANALYSIS_DATA_TYPE_POINTER, RZ_ANALYSIS_DATA_TYPE_STRING, rz_config_get_i(), rz_cons_printf(), rz_cons_println(), rz_cons_singleton(), rz_io_read_at(), rz_mem_get_num(), RZ_MIN, cmd_descs_generate::str, and ut64().
Referenced by rz_cmd_analysis().
Definition at line 2314 of file canalysis.c.
References addr, rz_core_t::analysis, rz_core_t::bin, dst, eprintf, rz_core_t::flags, found, rz_bin_section_t::is_data, rz_analysis_function_t::name, rz_flag_item_t::name, PFMT64x, rz_analysis_function_get_xrefs_from(), rz_analysis_get_fcn_in(), rz_bin_cur_object(), rz_bin_get_section_at(), rz_cons_printf(), rz_flag_get_i(), rz_list_free(), sdb_fmt(), and rz_analysis_ref_t::to.
Referenced by cmd_analysis_graph().
RZ_API void rz_core_analysis_esil | ( | RzCore * | core, |
ut64 | addr, | ||
ut64 | size, | ||
RZ_NULLABLE RzAnalysisFunction * | fcn | ||
) |
Analyze references with esil (aae)
addr
start address size
number of bytes to analyze fcn
optional, when analyzing for a specific function
Definition at line 4499 of file canalysis.c.
References add_string_ref(), addr, rz_core_t::analysis, rz_analysis_plugin_t::arch, arch, rz_analysis_t::bits, cccb(), CHECKREF, rz_core_t::config, rz_analysis_t::cur, rz_interval_node_t::data, dst, test_evm::end, eprintf, ESIL, rz_analysis_t::esil, esil_analysis_stop, esilbreak_last_data, esilbreak_last_read, esilbreak_mem_read(), esilbreak_mem_write(), esilbreak_reg_write(), f, rz_core_t::flags, free(), get_next_i(), getpcfromstack(), i, rz_core_t::io, is_string_at(), rz_analysis_esil_t::jump_target, list(), malloc(), MAX_SCAN_SIZE, myvalid(), rz_analysis_options_t::noncode, NULL, op, rz_analysis_t::opt, rz_analysis_t::pcalign, PFMT64x, rz_core_t::rasm, rz_analysis_t::reg, repeat(), rz_analysis_esil_parse(), rz_analysis_esil_set_pc(), rz_analysis_esil_stack_free(), rz_analysis_get_block_at(), rz_analysis_op(), rz_analysis_op_fini(), RZ_ANALYSIS_OP_MASK_ESIL, RZ_ANALYSIS_OP_MASK_HINT, RZ_ANALYSIS_OP_MASK_VAL, RZ_ANALYSIS_OP_TYPE_ACMP, RZ_ANALYSIS_OP_TYPE_ADD, RZ_ANALYSIS_OP_TYPE_CALL, RZ_ANALYSIS_OP_TYPE_CJMP, RZ_ANALYSIS_OP_TYPE_CMP, RZ_ANALYSIS_OP_TYPE_CPL, RZ_ANALYSIS_OP_TYPE_CRYPTO, RZ_ANALYSIS_OP_TYPE_CSWI, RZ_ANALYSIS_OP_TYPE_ICALL, RZ_ANALYSIS_OP_TYPE_ILL, RZ_ANALYSIS_OP_TYPE_IO, RZ_ANALYSIS_OP_TYPE_IRCALL, RZ_ANALYSIS_OP_TYPE_JMP, RZ_ANALYSIS_OP_TYPE_LEA, RZ_ANALYSIS_OP_TYPE_LEAVE, RZ_ANALYSIS_OP_TYPE_LOAD, RZ_ANALYSIS_OP_TYPE_MASK, RZ_ANALYSIS_OP_TYPE_MJMP, RZ_ANALYSIS_OP_TYPE_NOP, RZ_ANALYSIS_OP_TYPE_NULL, RZ_ANALYSIS_OP_TYPE_POP, RZ_ANALYSIS_OP_TYPE_PUSH, RZ_ANALYSIS_OP_TYPE_RCALL, RZ_ANALYSIS_OP_TYPE_REP, RZ_ANALYSIS_OP_TYPE_RET, RZ_ANALYSIS_OP_TYPE_RJMP, RZ_ANALYSIS_OP_TYPE_SWI, RZ_ANALYSIS_OP_TYPE_SYNC, RZ_ANALYSIS_OP_TYPE_TRAP, RZ_ANALYSIS_OP_TYPE_UCALL, RZ_ANALYSIS_OP_TYPE_UJMP, RZ_ANALYSIS_OP_TYPE_UNK, RZ_ANALYSIS_XREF_TYPE_CALL, RZ_ANALYSIS_XREF_TYPE_CODE, RZ_ANALYSIS_XREF_TYPE_DATA, RZ_ANALYSIS_XREF_TYPE_NULL, RZ_ANALYSIS_XREF_TYPE_STRING, rz_analysis_xrefs_set(), RZ_ARCH_ARM32, RZ_ARCH_ARM64, RZ_ARCH_MIPS, RZ_ARCH_THUMB, rz_asm_set_pc(), rz_config_get_i(), rz_cons_break_pop(), rz_cons_break_push(), rz_cons_is_breaked(), rz_core_analysis_esil_init_mem(), rz_core_analysis_esil_reinit(), rz_core_analysis_fcn(), rz_core_flag_get_by_spaces(), rz_core_seek_arch_bits(), RZ_EMPTY, rz_flag_set_next(), RZ_FLAGS_FS_SYSCALLS, rz_io_is_valid_offset(), rz_io_read_at(), rz_meta_get_all_in(), rz_meta_set_string(), RZ_META_TYPE_ANY, RZ_META_TYPE_COMMENT, RZ_META_TYPE_DATA, RZ_META_TYPE_FORMAT, RZ_META_TYPE_STRING, RZ_NULLABLE, rz_pvector_foreach, rz_pvector_free(), rz_reg_arena_pop(), rz_reg_arena_push(), rz_reg_get_name(), rz_reg_getv(), RZ_REG_NAME_PC, RZ_REG_NAME_SN, RZ_REG_NAME_SP, rz_reg_setv(), rz_str_replace_char(), RZ_STRBUF_SAFEGET, rz_syscall_get(), rz_syscall_item_free(), sdb_fmt(), si, start, cmd_descs_generate::str, rz_analysis_t::syscall, rz_analysis_meta_item_t::type, UT32_MAX, ut64(), and UT64_MAX.
Referenced by rz_analysis_all_esil_handler(), rz_core_analysis_esil_default(), and rz_core_analysis_esil_references_all_functions().
Definition at line 1984 of file canalysis.c.
References eprintf, PFMT64x, rz_analysis_op_free(), RZ_ANALYSIS_OP_MASK_ESIL, rz_core_analysis_op(), and RZ_STRBUF_SAFEGET.
Referenced by rz_core_analysis_fcn().
Start ESIL trace session.
core | The RzCore instance |
Definition at line 6746 of file canalysis.c.
References rz_core_t::analysis, rz_core_t::config, core_noretl::core, rz_analysis_t::esil, rz_analysis_esil_trace_new(), rz_config_set_i(), RZ_LOG_ERROR, and rz_analysis_esil_t::trace.
Referenced by rz_il_trace_start_handler().
Stop ESIL trace session.
core | The RzCore instance |
Definition at line 6770 of file canalysis.c.
References rz_core_t::analysis, rz_core_t::config, core_noretl::core, rz_analysis_t::esil, NULL, rz_analysis_esil_trace_free(), rz_config_set_i(), RZ_LOG_ERROR, and rz_analysis_esil_t::trace.
Referenced by rz_il_trace_stop_handler().
Runs all the steps of the deep analysis.
Returns true if all steps were finished and false if it was interrupted.
core | RzCore reference |
experimental | Enable more experimental analysis stages ("aaaa" command) |
dh_orig | Name of the debug handler, e.g. "esil" |
Definition at line 5784 of file canalysis.c.
References rz_core_t::analysis, rz_core_t::bin, c, cmd_analysis_objc(), rz_core_t::config, core_noretl::core, rz_analysis_t::cur, rz_bin_t::cur, rz_analysis_plugin_t::esil, rz_analysis_t::fcns, rz_core_t::flags, is_apple_target(), is_unknown_file(), list(), NULL, rz_core_t::num, rz_bin_file_t::o, rz_core_t::offset, rz_analysis_t::opt, rz_analysis_add_device_peripheral_map(), rz_analysis_class_recover_all(), rz_analysis_dwarf_integrate_functions(), rz_analysis_var_list(), rz_config_get(), rz_config_get_b(), rz_config_get_i(), rz_config_set(), rz_config_set_b(), rz_config_set_i(), rz_cons_is_breaked(), rz_core_analysis_autoname_all_fcns(), rz_core_analysis_calls(), rz_core_analysis_esil_references_all_functions(), rz_core_analysis_propagate_noreturn(), rz_core_analysis_recover_golang_functions(), rz_core_analysis_refs(), rz_core_analysis_resolve_golang_strings(), rz_core_analysis_sigdb_apply(), rz_core_analysis_types_propagation(), rz_core_analysis_value_pointers(), rz_core_notify_begin(), rz_core_notify_done(), rz_core_recover_vars(), rz_core_search_preludes(), rz_core_seek(), rz_core_seek_undo(), rz_core_task_yield(), rz_list_free(), rz_num_math(), RZ_OUTPUT_MODE_STANDARD, rz_str_startswith(), rz_analysis_t::sdb, sdb_ns(), rz_core_t::tasks, ut64(), UT64_MAX, and rz_analysis_options_t::vars.
Referenced by __program_cb(), core_perform_auto_analysis(), execute_command(), and rz_diff_graphs_files().
Definition at line 2026 of file canalysis.c.
References __core_analysis_fcn(), rz_analysis_function_t::addr, rz_core_t::analysis, rz_core_t::config, rz_core_t::flags, from, function_rename(), rz_core_t::io, is_skippable_addr(), rz_analysis_options_t::noncode, rz_analysis_t::opt, PFMT64x, RZ_ANALYSIS_FCN_TYPE_LOC, rz_analysis_function_contains(), rz_analysis_function_resize(), rz_analysis_get_fcn_in(), RZ_ANALYSIS_XREF_TYPE_CALL, rz_analysis_xrefs_get_to(), rz_analysis_xrefs_set(), rz_config_get_i(), rz_cons_is_breaked(), rz_core_analysis_esil_fcn(), rz_core_seek_arch_bits(), rz_io_is_valid_offset(), rz_list_free(), RZ_LOG_DEBUG, RZ_LOG_WARN, rz_analysis_function_t::type, UT64_MAX, and rz_io_t::va.
Referenced by __core_analysis_fcn(), __prelude_cb_hit(), _analysis_calls(), rz_analysis_analyze_fcn_refs(), rz_analysis_try_get_fcn(), rz_analyze_all_data_references_to_code_handler(), rz_cmd_analysis(), rz_core_analysis_all(), rz_core_analysis_esil(), rz_core_analysis_function_add(), and rz_core_analysis_function_until().
Definition at line 2099 of file canalysis.c.
References addr, rz_core_t::analysis, rz_analysis_t::fcns, rz_analysis_function_contains(), rz_analysis_function_delete(), rz_list_new(), and rz_list_purge().
RZ_API RzList* rz_core_analysis_fcn_get_calls | ( | RzCore * | core, |
RzAnalysisFunction * | fcn | ||
) |
Definition at line 2663 of file canalysis.c.
References rz_analysis_function_get_xrefs_from(), RZ_ANALYSIS_XREF_TYPE_CALL, rz_list_delete(), and rz_analysis_ref_t::type.
Referenced by function_list_print_to_table(), function_print_calls(), and rz_cmd_print().
Definition at line 4042 of file canalysis.c.
References addr, rz_analysis_bb_t::addr, rz_core_t::analysis, eprintf, f1, autogen_x86imm::f2, max, min, PFMT64x, rz_analysis_function_add_block(), rz_analysis_function_delete(), rz_analysis_function_relocate(), rz_analysis_get_function_at(), RZ_MIN, rz_analysis_bb_t::size, and ut64().
Referenced by rz_analysis_functions_merge_handler(), and rz_core_visual_define().
RZ_API char* rz_core_analysis_fcn_name | ( | RzCore * | core, |
RzAnalysisFunction * | fcn | ||
) |
Definition at line 2647 of file canalysis.c.
References rz_analysis_function_t::addr, rz_core_t::bin, rz_core_t::config, rz_bin_t::cur, free(), name, rz_analysis_function_t::name, NULL, rz_bin_demangle(), rz_config_get(), rz_config_get_i(), strdup(), and autogen_x86imm::tmp.
Referenced by autocmplt_cmd_arg_fcn(), autocomplete_functions(), fcn_print_info(), function_list_print(), function_list_print_as_cmd(), function_print_to_json(), and rz_analysis_function_list_ascii_handler().
RZ_IPI void rz_core_analysis_fcn_returns | ( | RzCore * | core, |
RzAnalysisFunction * | fcn | ||
) |
Definition at line 328 of file canalysis.c.
References b, rz_analysis_function_t::bbs, ls_foreach, PFMT64x, rz_analysis_block_get_op_addr(), rz_cons_printf(), ut64(), and UT64_MAX.
Referenced by rz_analysis_function_returns_handler().
Definition at line 5202 of file canalysis.c.
References rz_analysis_function_t::addr, rz_core_t::analysis, rz_analysis_t::fcns, rz_core_t::flags, rz_analysis_function_t::name, rz_analysis_function_size_from_entry(), rz_flag_set(), and RZ_FLAGS_FS_FUNCTIONS.
Referenced by core_perform_auto_analysis(), and rz_core_analysis_function_add().
RZ_API bool rz_core_analysis_function_add | ( | RzCore * | core, |
const char * | name, | ||
ut64 | addr, | ||
bool | analyze_recursively | ||
) |
XXX wrong in case of nopskip
Definition at line 5298 of file canalysis.c.
References addr, rz_analysis_function_t::addr, rz_core_t::analysis, rz_core_t::config, eprintf, f, rz_core_t::io, rz_analysis_function_t::name, rz_analysis_options_t::noncode, NULL, rz_analysis_t::opt, PFMT64x, rz_analysis_fcn_vars_add_types(), rz_analysis_function_get_xrefs_from(), rz_analysis_function_resize(), rz_analysis_get_fcn_in(), rz_analysis_get_function_at(), RZ_ANALYSIS_XREF_TYPE_CALL, RZ_ANALYSIS_XREF_TYPE_CODE, RZ_ANALYSIS_XREF_TYPE_NULL, rz_config_get_i(), rz_core_analysis_fcn(), rz_core_analysis_flag_every_function(), rz_core_analysis_function_rename(), rz_core_analysis_propagate_noreturn(), rz_core_recover_vars(), rz_io_is_valid_offset(), rz_list_free(), RZ_LOG_DEBUG, RZ_LOG_ERROR, RZ_STR_ISNOTEMPTY, rz_analysis_ref_t::to, rz_analysis_ref_t::type, UT64_MAX, and rz_analysis_options_t::vars.
Referenced by __function_cb(), agraph_refresh(), analyze_function_at_flag(), ds_control_flow_comments(), rz_analysis_function_add_recu_handler(), rz_analyze_all_consecutive_functions_in_section_handler(), rz_analyze_symbols_entries_handler(), rz_core_analysis_all(), rz_core_analysis_resolve_jumps(), rz_core_visual_analysis(), rz_core_visual_classes(), rz_core_visual_define(), rz_core_visual_trackflags(), and rz_diff_graphs_files().
RZ_API RZ_OWN char* rz_core_analysis_function_autoname | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzAnalysisFunction * | fcn | ||
) |
Suggest a name for the function.
Definition at line 545 of file canalysis.c.
References blacklisted_word(), f, free(), NULL, rz_flag_item_t::offset, PFMT64x, rz_analysis_function_get_xrefs_from(), rz_flag_get(), rz_flag_get_i(), rz_list_free(), rz_return_val_if_fail, rz_str_newf(), strdup(), and rz_analysis_ref_t::to.
Referenced by rz_analysis_function_autoname_handler(), and rz_core_analysis_autoname_all_fcns().
RZ_IPI bool rz_core_analysis_function_delete_var | ( | RzCore * | core, |
RzAnalysisFunction * | fcn, | ||
RzAnalysisVarKind | kind, | ||
const char * | id | ||
) |
Definition at line 6133 of file canalysis.c.
References core_noretl::core, delta, IS_DIGIT, rz_analysis_var_t::kind, NULL, rz_core_t::num, rz_analysis_function_get_var(), rz_analysis_function_get_var_byname(), rz_analysis_var_delete(), and rz_num_math().
Referenced by analysis_function_vars_del(), and rz_analysis_function_vars_del_handler().
Definition at line 5270 of file canalysis.c.
References addr, rz_analysis_function_t::addr, rz_core_t::analysis, rz_analysis_t::cb, rz_core_t::flags, free(), getFunctionNamePrefix(), rz_analysis_function_t::name, rz_space_t::name, rz_analysis_callbacks_t::on_fcn_rename, rz_analysis_function_rename(), rz_analysis_function_size_from_entry(), rz_analysis_get_function_at(), rz_flag_get(), rz_flag_rename(), rz_flag_set(), RZ_FLAGS_FS_FUNCTIONS, rz_return_val_if_fail, rz_str_trim_head_ro(), and rz_flag_item_t::space.
Referenced by rz_analysis_function_rename_handler(), rz_core_analysis_all(), rz_core_analysis_function_add(), rz_core_analysis_function_set_signature(), rz_core_analysis_rename(), and rz_core_visual_define().
RZ_IPI bool rz_core_analysis_function_set_signature | ( | RzCore * | core, |
RzAnalysisFunction * | fcn, | ||
const char * | newsig | ||
) |
Definition at line 6380 of file canalysis.c.
References rz_analysis_function_t::addr, rz_core_t::analysis, core_noretl::core, err, free(), rz_analysis_function_t::name, NULL, rz_analysis_function_set_type_str(), rz_analysis_get_fcn_in(), rz_core_analysis_function_rename(), rz_str_lchr(), rz_str_newf(), rz_str_trim_tail(), and strdup().
Referenced by rz_analysis_function_signature_handler(), and rz_core_analysis_function_signature_editor().
RZ_IPI char* rz_core_analysis_function_signature | ( | RzCore * | core, |
RzOutputMode | mode, | ||
char * | fcn_name | ||
) |
Definition at line 5382 of file canalysis.c.
References rz_core_t::analysis, arg(), rz_analysis_var_t::delta, free(), rz_analysis_var_t::isarg, key, list(), arg::name, rz_analysis_function_t::name, rz_analysis_var_t::name, cmd_descs_generate::nargs, NULL, rz_core_t::offset, pj_a(), pj_end(), pj_free(), pj_k(), pj_ki(), pj_ks(), pj_new(), pj_o(), pj_string(), resolve_fcn_name(), rz_analysis_fcn_format_sig(), rz_analysis_fcn_vars_cache_fini(), rz_analysis_fcn_vars_cache_init(), rz_analysis_get_fcn_in(), rz_analysis_get_function_byname(), rz_core_get_func_args(), rz_list_free(), RZ_OUTPUT_MODE_JSON, rz_str_get_null(), rz_type_as_string(), rz_type_func_args_count(), rz_type_func_ret(), signature(), strdup(), type, rz_analysis_var_t::type, and rz_analysis_t::typedb.
Referenced by agraph_update_title(), and function_print_to_json().
Definition at line 6409 of file canalysis.c.
References rz_core_t::analysis, core_noretl::core, eprintf, f, free(), NULL, rz_core_t::offset, PFMT64x, rz_analysis_function_get_signature(), rz_analysis_get_fcn_in(), rz_core_analysis_function_set_signature(), and rz_core_editor().
Referenced by rz_analysis_function_signature_editor_handler(), rz_core_visual_analysis(), and rz_core_visual_define().
RZ_API void rz_core_analysis_function_strings_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzAnalysisFunction * | fcn, | ||
RZ_NULLABLE PJ * | pj | ||
) |
Print all string flags referenced by the function.
Definition at line 612 of file canalysis.c.
References f, rz_analysis_ref_t::from, NULL, PFMT64x, pj_end(), pj_kn(), pj_ks(), pj_o(), rz_analysis_function_get_xrefs_from(), rz_cons_printf(), rz_flag_get_by_spaces(), RZ_FLAGS_FS_STRINGS, rz_list_free(), rz_return_if_fail, and rz_analysis_ref_t::to.
Referenced by rz_analysis_function_strings_handler().
Definition at line 6425 of file canalysis.c.
References a, addr, rz_core_t::analysis, b, c, rz_core_t::config, core_noretl::core, rz_core_t::offset, rz_analysis_function_resize(), rz_analysis_get_fcn_in(), RZ_ANALYSIS_XREF_TYPE_NULL, rz_config_get(), rz_config_get_i(), rz_config_set(), rz_config_set_i(), rz_core_analysis_fcn(), rz_return_if_fail, ut64(), and UT64_MAX.
Referenced by rz_analysis_function_until_handler().
RZ_API RZ_OWN RzCoreAnalysisStats* rz_core_analysis_get_stats | ( | RZ_NONNULL RzCore * | core, |
ut64 | from, | ||
ut64 | to, | ||
ut64 | step | ||
) |
Generate statistics for a range of memory, e.g. for a colorful overview bar.
Let fullsz = to + 1 - from
. If fullsz % step = 0
, then the result will be fullsz / step
blocks of size step
. Otherwise, it will be fullsz / step
blocks of size step
and one additional block covering the rest.
lowest | address to consider |
highest | address to consider, inclusive. Must be greater than or equal to from. |
size | of a single block in the output |
Definition at line 3722 of file canalysis.c.
References B, block_flags_stat(), blocks, count, rz_interval_node_t::data, rz_interval_node_t::end, F, from, map(), memset(), metas, mi, NULL, rz_analysis_function_linear_size(), rz_bin_get_symbols(), rz_core_analysis_stats_free(), rz_flag_foreach_range(), rz_io_map_get(), rz_meta_get_all_intersect(), RZ_META_TYPE_ANY, RZ_META_TYPE_COMMENT, RZ_META_TYPE_STRING, RZ_MIN, RZ_NEW0, rz_num_2_pow_64_div(), rz_pvector_foreach, rz_pvector_free(), rz_return_val_if_fail, rz_vector_init(), rz_vector_insert_range(), S, rz_interval_node_t::start, block_flags_stat_t::step, step(), to, ut64(), and UT64_MAX.
Referenced by analBars(), cmd_print_bars(), and cmd_print_blocks().
Definition at line 2917 of file canalysis.c.
References addr, rz_analysis_function_t::addr, rz_core_t::analysis, rz_core_t::config, core_analysis_graph_nodes(), rz_analysis_t::fcns, from, get_title(), rz_cons_t::is_html, NULL, rz_core_t::offset, PFMT64x, pj_a(), pj_end(), pj_free(), pj_new(), pj_string(), RZ_ANALYSIS_FCN_TYPE_FCN, RZ_ANALYSIS_FCN_TYPE_LOC, RZ_ANALYSIS_FCN_TYPE_SYM, rz_analysis_get_fcn_in(), rz_config_get(), rz_config_get_i(), rz_config_hold_free(), rz_config_hold_i(), rz_config_hold_new(), rz_config_hold_restore(), rz_config_set_i(), rz_cons_printf(), rz_cons_singleton(), RZ_CORE_ANALYSIS_JSON, RZ_CORE_ANALYSIS_JSON_FORMAT_DISASM, RZ_CORE_ANALYSIS_KEYVALUE, RZ_CORE_ANALYSIS_STAR, to, rz_analysis_function_t::type, ut64(), and UT64_MAX.
Referenced by cmd_analysis_graph().
Definition at line 2895 of file canalysis.c.
References addr, rz_analysis_bb_t::addr, analysis_graph_to(), rz_core_t::config, n, path, rz_config_get_i(), rz_list_append(), rz_list_get_n(), rz_list_length(), and rz_list_new().
RZ_API void rz_core_analysis_hint_list_print | ( | RzAnalysis * | a, |
RzCmdStateOutput * | state | ||
) |
Definition at line 1422 of file canalysis.c.
References a, hint_node_free(), NULL, print_addr_hint_cb(), print_arch_hint_cb(), print_bits_hint_cb(), print_hint_tree(), rz_analysis_addr_hints_foreach(), rz_analysis_arch_hints_foreach(), rz_analysis_bits_hints_foreach(), rz_rbtree_free(), and rz_return_if_fail.
Referenced by rz_analysis_hint_list_handler().
RZ_API void rz_core_analysis_hint_print | ( | RzAnalysis * | a, |
ut64 | addr, | ||
RzCmdStateOutput * | state | ||
) |
Definition at line 1433 of file canalysis.c.
References a, addr, arch, bits(), hint_node_free(), NULL, print_addr_hint_cb(), print_arch_hint_cb(), print_bits_hint_cb(), print_hint_tree(), rz_analysis_addr_hints_at(), rz_analysis_hint_arch_at(), rz_analysis_hint_bits_at(), rz_rbtree_free(), rz_return_if_fail, ut64(), and UT64_MAX.
Referenced by rz_analysis_hint_list_at_handler().
RZ_API bool rz_core_analysis_hint_set_offset | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL const char * | struct_member | ||
) |
Set analysis hint for the first immediate of the instruction at current offset to struct_member
.
core | The RzCore instance |
struct_member | struct.member |
Definition at line 6947 of file canalysis.c.
References rz_core_t::analysis, core_noretl::core, test-lz4-list::exit, i, rz_core_t::io, rz_type_t::kind, rz_core_t::offset, rz_type_path_t::path, rz_analysis_hint_set_offset(), rz_analysis_op(), rz_analysis_op_fini(), RZ_ANALYSIS_OP_MASK_VAL, rz_io_read_at(), rz_list_free(), rz_return_val_if_fail, rz_type_db_get_by_offset(), RZ_TYPE_KIND_IDENTIFIER, rz_type_path_t::typ, rz_analysis_t::typedb, and ut64().
Referenced by rz_analysis_hint_set_offset_handler().
Definition at line 2387 of file canalysis.c.
References add_single_addr_xrefs(), addr, rz_core_t::bin, rz_bin_object_t::imports, rz_core_t::io, rz_bin_t::is_debugger, rz_bin_import_t::name, NULL, rz_bin_symbol_t::paddr, rz_bin_cur_object(), rz_bin_object_get_symbol_of_import(), rz_bin_object_get_vaddr(), rz_graph_add_node_info(), rz_graph_new(), ut64(), UT64_MAX, rz_io_t::va, and rz_bin_symbol_t::vaddr.
Referenced by cmd_analysis_graph().
RZ_API RZ_OWN RzCoreAnalysisName* rz_core_analysis_name | ( | RZ_NONNULL RzCore * | core, |
ut64 | addr | ||
) |
Get information on whatever var/flag/function is used at addr
.
Definition at line 7203 of file canalysis.c.
References addr, rz_core_t::analysis, core_noretl::core, f, rz_core_t::flags, rz_core_t::io, rz_analysis_function_t::name, rz_analysis_var_t::name, NULL, rz_core_t::offset, op, p, rz_analysis_get_function_at(), rz_analysis_get_used_function_var(), rz_analysis_op(), rz_analysis_op_fini(), RZ_ANALYSIS_OP_MASK_BASIC, rz_core_analysis_name_free(), rz_flag_get_i(), rz_io_read_at(), RZ_NEW0, rz_return_val_if_fail, strdup(), ut64(), and UT64_MAX.
Referenced by core_analysis_name_print().
RZ_API void rz_core_analysis_name_free | ( | RZ_NULLABLE RzCoreAnalysisName * | p | ) |
Definition at line 7153 of file canalysis.c.
Referenced by core_analysis_name_print(), and rz_core_analysis_name().
Convert typ
to string (const char*)
Definition at line 7140 of file canalysis.c.
References NULL, rz_warn_if_reached, and RzCoreAnalysisNameTypeStrs.
Referenced by core_analysis_name_print().
RZ_API RzAnalysisOp* rz_core_analysis_op | ( | RzCore * | core, |
ut64 | addr, | ||
int | mask | ||
) |
Definition at line 1033 of file canalysis.c.
References addr, rz_core_t::analysis, rz_core_t::block, blocksize, rz_core_t::blocksize, rz_asm_op_t::buf_asm, delta, rz_core_t::io, len, mask, NULL, rz_core_t::offset, op, rz_core_t::rasm, rz_analysis_op(), rz_analysis_op_free(), RZ_ANALYSIS_OP_MASK_DISASM, rz_asm_disassemble(), rz_asm_op_fini(), rz_asm_op_init(), rz_asm_set_pc(), rz_io_read_at(), RZ_LOG_DEBUG, RZ_NEW0, rz_return_val_if_fail, rz_strbuf_get(), strdup(), and UT64_MAX.
Referenced by __cursor_down(), analBars(), analPaths(), analysis_block_cb(), analysis_function_vars_getsetref(), cmd_analysis_esil(), disasm_until_ret(), disassemble_till_return_is_found(), disassembly_as_table(), ds_pre_emulation(), get_src_regname(), handle_stack_canary(), nextOpcode(), op_cache_get(), propagate_types_among_used_variables(), rz_cmd_debug_traces_esil_i_handler(), rz_cmd_print(), rz_core_analysis_continue_until_call(), rz_core_analysis_continue_until_syscall(), rz_core_analysis_cycles(), rz_core_analysis_esil_fcn(), rz_core_analysis_esil_step_over(), rz_core_analysis_var_rename(), rz_core_get_stacksz(), rz_core_print_func_args(), rz_core_visual_cmd(), rz_core_visual_define(), and update_stat_for_op().
RZ_API void rz_core_analysis_paths | ( | RzCore * | core, |
ut64 | from, | ||
ut64 | to, | ||
bool | followCalls, | ||
int | followDepth, | ||
bool | is_json | ||
) |
Definition at line 5121 of file canalysis.c.
References analPaths(), rz_core_t::analysis, b1, rz_core_t::config, RzCoreAnalPaths::core, RzCoreAnalPaths::count, RzCoreAnalPaths::cur, eprintf, RzCoreAnalPaths::followCalls, RzCoreAnalPaths::followDepth, RzCoreAnalPaths::from, from, RzCoreAnalPaths::fromBB, NULL, RzCoreAnalPaths::path, PFMT64x, pj_a(), pj_end(), pj_free(), pj_new(), pj_string(), rz_analysis_find_most_relevant_block_in(), rz_config_get_i(), rz_cons_printf(), rz_list_free(), rz_list_new(), RzCoreAnalPaths::to, to, RzCoreAnalPaths::toBB, and RzCoreAnalPaths::visited.
Referenced by rz_cmd_search().
Definition at line 5630 of file canalysis.c.
References addr, rz_core_t::analysis, analyze_noreturn_function(), core_noretl::core, done, eprintf, f, rz_analysis_t::fcns, rz_analysis_bb_t::fcns, find_block_at_xref_addr(), found, free(), rz_analysis_ref_t::from, malloc(), n, NULL, PFMT64x, rz_analysis_block_chop_noreturn(), rz_analysis_block_unref(), rz_analysis_get_function_at(), rz_analysis_noreturn_add(), rz_analysis_op_free(), RZ_ANALYSIS_OP_MASK_ALL, RZ_ANALYSIS_XREF_TYPE_CALL, rz_analysis_xrefs_get_to(), rz_cons_is_breaked(), rz_core_analysis_propagate_noreturn_relocs(), rz_core_op_analysis(), rz_list_append(), rz_list_clone(), rz_list_contains(), rz_list_free(), rz_list_newf(), rz_list_pop(), rz_analysis_op_t::size, core_noretl::todo, rz_analysis_ref_t::type, ut64(), and UT64_MAX.
Referenced by rz_autoname_all_functions_noreturn_handler(), rz_core_analysis_everything(), and rz_core_analysis_function_add().
Definition at line 5610 of file canalysis.c.
References rz_core_t::analysis, rz_analysis_t::bits, rz_asm_t::bits, core_noretl::core, rz_analysis_t::ht_xrefs_to, core_noretl::noretl, process_refs_cb(), rz_core_t::rasm, reanalyze_fcns_cb(), rz_analysis_noreturn_functions(), rz_list_free(), set_u_free(), set_u_new(), and core_noretl::todo.
Referenced by rz_core_analysis_propagate_noreturn().
RZ_API bool rz_core_analysis_refs | ( | RZ_NONNULL RzCore * | core, |
size_t | nbytes | ||
) |
Analyze xrefs and prints the result.
[in] | core | The RzCore to use |
[in] | nbytes | Sets a custom boundary from current offset for N bytes (set it to 0 to use the maps) |
Definition at line 3272 of file canalysis.c.
References core_search_for_xrefs_in_boundaries(), from, list(), map(), nbytes, NULL, rz_config_get_b(), rz_cons_is_breaked(), rz_core_get_boundaries_prot(), rz_debug_map_get(), rz_itv_end(), rz_list_free(), RZ_LOG_ERROR, RZ_PERM_X, rz_return_val_if_fail, to, and ut64().
Referenced by __references_cb(), objc_analyze(), rz_analyze_xrefs_section_bytes_handler(), and rz_core_analysis_everything().
RZ_API bool rz_core_analysis_rename | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL const char * | name, | ||
ut64 | addr | ||
) |
Rename whatever var/flag/function is used at addr
to name
.
Definition at line 7166 of file canalysis.c.
References addr, rz_core_t::analysis, core_noretl::core, f, rz_core_t::flags, rz_core_t::io, rz_core_t::offset, op, rz_analysis_get_function_at(), rz_analysis_get_used_function_var(), rz_analysis_op(), rz_analysis_op_fini(), RZ_ANALYSIS_OP_MASK_BASIC, rz_analysis_var_rename(), rz_core_analysis_function_rename(), rz_flag_get_i(), rz_flag_rename(), rz_flag_set(), rz_io_read_at(), rz_return_val_if_fail, RZ_STR_ISNOTEMPTY, ut64(), and UT64_MAX.
Referenced by rz_analyse_name_handler().
RZ_API void rz_core_analysis_resolve_jumps | ( | RZ_NONNULL RzCore * | core | ) |
Resolves any unresolved jump.
[in] | core | The RzCore to use |
Definition at line 3242 of file canalysis.c.
References rz_analysis_ref_t::from, NULL, rz_analysis_get_fcn_in(), RZ_ANALYSIS_XREF_TYPE_CALL, rz_analysis_xrefs_list(), rz_config_get_b(), rz_core_analysis_function_add(), rz_list_free(), and rz_analysis_ref_t::type.
Referenced by rz_analyze_all_unresolved_jumps_handler().
Definition at line 3071 of file canalysis.c.
References rz_core_t::analysis, arch, rz_search_t::bckwrds, rz_asm_t::bits, blocksize, rz_core_t::blocksize, rz_core_t::config, core_analysis_followptr(), count, rz_asm_t::cur, eprintf, rz_core_file_t::fd, rz_core_t::file, free(), from, i, rz_core_t::io, malloc(), mask, NULL, opiscall(), OPSZ, PFMT64x, rz_core_t::rasm, rz_analysis_op(), rz_analysis_op_fini(), RZ_ANALYSIS_OP_MASK_BASIC, RZ_ANALYSIS_OP_TYPE_CALL, RZ_ANALYSIS_OP_TYPE_CCALL, RZ_ANALYSIS_OP_TYPE_CJMP, RZ_ANALYSIS_OP_TYPE_ICALL, RZ_ANALYSIS_OP_TYPE_IJMP, RZ_ANALYSIS_OP_TYPE_IRCALL, RZ_ANALYSIS_OP_TYPE_IRJMP, RZ_ANALYSIS_OP_TYPE_JMP, RZ_ANALYSIS_OP_TYPE_MJMP, RZ_ANALYSIS_OP_TYPE_RCALL, RZ_ANALYSIS_OP_TYPE_RJMP, RZ_ANALYSIS_OP_TYPE_UCALL, RZ_ANALYSIS_OP_TYPE_UCCALL, RZ_ANALYSIS_OP_TYPE_UCJMP, RZ_ANALYSIS_OP_TYPE_UJMP, RZ_ANALYSIS_XREF_TYPE_CALL, RZ_ANALYSIS_XREF_TYPE_CODE, RZ_ANALYSIS_XREF_TYPE_DATA, RZ_ARCH_ARM64, rz_config_get_i(), rz_cons_break_pop(), rz_cons_break_push(), rz_cons_is_breaked(), RZ_EMPTY, rz_io_read_at(), rz_io_use_fd(), rz_core_t::search, to, ut64(), and UT64_MAX.
Referenced by rz_cmd_search().
Searches for xrefs in the range of the paramters 'from'
and 'to'
.
core | The Rizin core. |
from | Start of search interval. |
to | End of search interval. |
Definition at line 3380 of file canalysis.c.
References count, free(), from, i, is_valid_xref(), malloc(), memset(), NULL, OPSZ, PFMT64x, rz_analysis_op(), rz_analysis_op_fini(), RZ_ANALYSIS_OP_MASK_BASIC, RZ_ANALYSIS_OP_MASK_HINT, RZ_ANALYSIS_OP_TYPE_CALL, RZ_ANALYSIS_OP_TYPE_CCALL, RZ_ANALYSIS_OP_TYPE_CJMP, RZ_ANALYSIS_OP_TYPE_ICALL, RZ_ANALYSIS_OP_TYPE_IJMP, RZ_ANALYSIS_OP_TYPE_IRCALL, RZ_ANALYSIS_OP_TYPE_IRJMP, RZ_ANALYSIS_OP_TYPE_JMP, RZ_ANALYSIS_OP_TYPE_MJMP, RZ_ANALYSIS_OP_TYPE_RCALL, RZ_ANALYSIS_OP_TYPE_RJMP, RZ_ANALYSIS_OP_TYPE_UCALL, RZ_ANALYSIS_OP_TYPE_UCCALL, RZ_ANALYSIS_OP_TYPE_UCJMP, RZ_ANALYSIS_OP_TYPE_UJMP, RZ_ANALYSIS_XREF_TYPE_CALL, RZ_ANALYSIS_XREF_TYPE_CODE, RZ_ANALYSIS_XREF_TYPE_DATA, rz_config_get_b(), rz_config_get_i(), rz_cons_break_pop(), rz_cons_break_push(), rz_cons_is_breaked(), rz_io_is_valid_offset(), rz_io_read_at(), RZ_LOG_ERROR, RZ_PERM_X, rz_return_val_if_fail, set_new_xref(), st64, to, UT32_MAX, ut64(), and UT64_MAX.
Referenced by core_search_for_xrefs_in_boundaries().
RZ_API bool rz_core_analysis_sigdb_apply | ( | RZ_NONNULL RzCore * | core, |
RZ_NULLABLE int * | n_applied, | ||
RZ_NULLABLE const char * | filter | ||
) |
tries to apply the signatures in the flirt.sigdb.path
core | The RzCore instance |
n_applied | Returns the number of successfully applied signatures |
filter | Filters the signatures found following the user input |
Definition at line 6057 of file canalysis.c.
References rz_core_t::analysis, arch, rz_signature_database_entry_t::arch_bits, rz_signature_database_entry_t::arch_name, rz_signature_database_entry_t::base_name, rz_core_t::bin, rz_signature_database_entry_t::bin_name, bits(), rz_core_t::config, core_noretl::core, rz_signature_database_entry_t::file_path, rz_core_t::flags, rz_bin_object_t::lang, rz_bin_plugin_t::name, NULL, rz_bin_object_t::plugin, rz_bin_cur_object(), RZ_BIN_LANGUAGE_CXX, RZ_BIN_LANGUAGE_RUST, rz_config_get(), rz_config_get_i(), rz_cons_is_breaked(), rz_cons_printf(), rz_core_analysis_sigdb_list(), rz_core_flirt_arch_from_name(), rz_flag_count(), RZ_FLIRT_SIG_ARCH_ANY, rz_list_free(), RZ_LOG_INFO, rz_return_val_if_fail, rz_sign_flirt_apply(), RZ_STR_ISEMPTY, rz_signature_database_entry_t::short_path, and ut64().
Referenced by rz_apply_signatures_from_sigdb_handler(), and rz_core_analysis_everything().
Returns all the signatures found in the default path.
Scans for signature in the following paths:
core | The RzCore to use. | |
[in] | with_details | The reads the signature details and sets them in RzSigDBEntry |
Definition at line 5994 of file canalysis.c.
References analysis_sigdb_add(), rz_core_t::config, core_noretl::core, free(), NULL, rz_config_get(), rz_config_get_b(), rz_path_home_prefix(), rz_path_system(), rz_return_val_if_fail, RZ_SIGDB, rz_sign_sigdb_list(), and rz_sign_sigdb_new().
Referenced by rz_core_analysis_sigdb_apply(), and rz_core_analysis_sigdb_print().
RZ_API void rz_core_analysis_sigdb_print | ( | RZ_NONNULL RzCore * | core, |
RZ_NONNULL RzTable * | table | ||
) |
Adds all the signatures to a RzTable structure.
[in] | core | The RzCore to use |
[in] | table | The RzTable to use |
Definition at line 6026 of file canalysis.c.
References rz_signature_database_entry_t::arch_bits, rz_signature_database_entry_t::arch_name, rz_signature_database_entry_t::base_name, rz_signature_database_entry_t::bin_name, bits(), core_noretl::core, rz_signature_database_entry_t::details, rz_signature_database_entry_t::n_modules, NULL, rz_core_analysis_sigdb_list(), rz_list_free(), rz_return_if_fail, rz_table_add_rowf(), rz_table_set_columnsf(), and ut64().
Referenced by rz_list_signatures_in_sigdb_handler().
RZ_API void rz_core_analysis_stats_free | ( | RzCoreAnalysisStats * | s | ) |
Definition at line 3818 of file canalysis.c.
References free(), rz_vector_fini(), and s.
Referenced by analBars(), cmd_print_bars(), cmd_print_blocks(), and rz_core_analysis_get_stats().
RZ_API ut64 rz_core_analysis_stats_get_block_from | ( | RZ_NONNULL const RzCoreAnalysisStats * | s, |
size_t | i | ||
) |
Get the lowest address that the i-th block in s covers (inclusive)
Definition at line 3829 of file canalysis.c.
References i, rz_return_val_if_fail, and s.
Referenced by cmd_print_blocks(), and rz_core_analysis_stats_get_block_to().
RZ_API ut64 rz_core_analysis_stats_get_block_to | ( | RZ_NONNULL const RzCoreAnalysisStats * | s, |
size_t | i | ||
) |
Get the highest address that the i-th block in s covers (inclusive)
Definition at line 3837 of file canalysis.c.
References count, i, rz_core_analysis_stats_get_block_from(), rz_return_val_if_fail, rz_vector_len(), and s.
Referenced by cmd_print_blocks().
Definition at line 6610 of file canalysis.c.
References rz_core_t::analysis, rz_asm_t::bits, bits(), rz_core_t::config, core_noretl::core, free(), rz_core_t::rasm, rz_config_get(), rz_path_system(), rz_return_if_fail, RZ_SDB_TYPES, rz_type_db_init(), and rz_analysis_t::typedb.
Referenced by cb_asmarch(), rz_core_bin_apply_config(), and rz_core_init().
Definition at line 6325 of file canalysis.c.
References rz_analysis_function_t::addr, rz_core_t::analysis, rz_core_t::config, core_noretl::core, eprintf, rz_analysis_t::esil, rz_analysis_t::fcns, rz_core_t::flags, free(), NULL, rz_core_t::offset, rz_analysis_t::reg, rz_analysis_esil_set_pc(), rz_analysis_fcn_vars_add_types(), rz_config_get_b(), rz_config_hold_free(), rz_config_hold_i(), rz_config_hold_new(), rz_config_hold_restore(), rz_config_set_b(), rz_cons_is_breaked(), rz_core_analysis_esil_init(), rz_core_analysis_esil_init_mem(), rz_core_analysis_esil_init_mem_del(), rz_core_analysis_type_match(), rz_core_debug_clear_register_flags(), rz_core_seek(), RZ_FLAGS_FS_REGISTERS, rz_reg_arena_peek(), rz_reg_arena_poke(), rz_reg_arena_pop(), rz_reg_arena_push(), rz_reg_arena_zero(), RZ_REG_TYPE_ANY, seek(), UT32_MAX, ut64(), and UT64_MAX.
Referenced by rz_analyze_recursively_all_function_types_handler(), and rz_core_analysis_everything().
Definition at line 4028 of file canalysis.c.
References rz_core_t::analysis, f, rz_core_t::flags, off, rz_analysis_fcn_del(), rz_analysis_fcn_del_locs(), rz_analysis_function_linear_size(), rz_analysis_function_min_addr(), rz_analysis_get_fcn_in(), rz_flag_unset_name(), rz_meta_del(), and RZ_META_TYPE_ANY.
Referenced by rz_analysis_function_del_all_handler(), rz_analysis_function_del_handler(), rz_core_visual_analysis(), and rz_core_visual_define().
RZ_IPI void rz_core_analysis_value_pointers | ( | RzCore * | core, |
RzOutputMode | mode | ||
) |
Definition at line 6502 of file canalysis.c.
References _CbInRangeAav(), rz_core_t::analysis, rz_asm_t::bits, rz_core_t::config, core_noretl::core, test_evm::end, free(), from, rz_io_map_t::itv, list(), map(), MAX_SCAN_SIZE, NULL, PFMT64x, rz_core_t::rasm, rz_analysis_archinfo(), RZ_ANALYSIS_ARCHINFO_ALIGN, rz_config_get(), rz_config_get_b(), rz_config_get_i(), rz_config_set(), rz_config_set_i(), rz_cons_break_pop(), rz_cons_break_push(), rz_cons_is_breaked(), rz_core_get_boundaries_prot(), rz_core_notify_done(), rz_core_search_value_in_range(), rz_itv_begin(), rz_itv_end(), rz_list_free(), strdup(), autogen_x86imm::tmp, to, UT32_MAX, ut64(), and UT64_MAX.
Referenced by rz_analyze_value_to_maps_handler(), and rz_core_analysis_everything().
RZ_IPI char* rz_core_analysis_var_display | ( | RzCore * | core, |
RzAnalysisVar * | var, | ||
bool | add_name | ||
) |
Definition at line 6148 of file canalysis.c.
References rz_core_t::analysis, rz_analysis_function_t::bp_off, core_noretl::core, rz_analysis_var_t::delta, rz_analysis_var_t::fcn, free(), i, rz_analysis_var_t::isarg, rz_analysis_var_t::kind, rz_analysis_function_t::maxstack, rz_analysis_var_t::name, rz_reg_t::name, NULL, r, rz_analysis_t::reg, RZ_ABS, RZ_ANALYSIS_VAR_KIND_BPV, RZ_ANALYSIS_VAR_KIND_REG, RZ_ANALYSIS_VAR_KIND_SPV, rz_core_cmd_strf(), RZ_LOG_DEBUG, rz_reg_index_get(), RZ_REG_NAME_BP, RZ_REG_NAME_SP, rz_strbuf_append(), rz_strbuf_appendf(), rz_strbuf_drain(), rz_strbuf_new(), rz_type_as_format(), rz_type_atomic_str_eq(), rz_type_is_strictly_atomic(), sb, st32, rz_analysis_var_t::type, and rz_analysis_t::typedb.
Referenced by ds_show_functions(), ds_show_functions_argvar(), rz_analysis_function_vars_display_handler(), and rz_core_analysis_all_vars_display().
Definition at line 5728 of file canalysis.c.
References rz_core_t::analysis, core_noretl::core, eprintf, rz_analysis_var_t::name, NULL, rz_core_t::offset, PFMT64x, rz_analysis_function_get_var_byname(), rz_analysis_get_fcn_in(), rz_analysis_get_used_function_var(), rz_analysis_op_free(), RZ_ANALYSIS_OP_MASK_BASIC, rz_analysis_var_rename(), rz_core_analysis_op(), and v1.
Referenced by rz_analysis_function_vars_rename_handler(), and variable_rename().
Definition at line 6582 of file canalysis.c.
References rz_core_t::analysis, core_noretl::core, from, RZ_ABS, rz_analysis_archinfo(), RZ_ANALYSIS_ARCHINFO_MIN_OP_SIZE, rz_analysis_op_free(), RZ_ANALYSIS_OP_MASK_BASIC, RZ_ANALYSIS_STACK_INC, rz_core_analysis_op(), RZ_MAX, stack, to, and ut64().
Referenced by rz_core_link_stroff().
RZ_API int rz_core_print_bb_custom | ( | RzCore * | core, |
RzAnalysisFunction * | fcn | ||
) |
Definition at line 2118 of file canalysis.c.
References rz_analysis_case_obj_t::addr, rz_analysis_bb_t::addr, rz_analysis_function_t::bbs, rz_analysis_switch_obj_t::cases, rz_core_t::config, rz_analysis_bb_t::fail, free(), get_title(), rz_analysis_bb_t::jump, NULL, PFMT64x, rz_base64_encode_dyn(), rz_config_hold_free(), rz_config_hold_i(), rz_config_hold_new(), rz_config_hold_restore(), rz_config_set_i(), rz_cons_printf(), rz_core_cmd_strf(), rz_str_prepend(), rz_analysis_bb_t::switch_op, UT64_MAX, and v.
Referenced by cmd_analysis_graph().
RZ_API int rz_core_print_bb_gml | ( | RzCore * | core, |
RzAnalysisFunction * | fcn | ||
) |
Definition at line 2193 of file canalysis.c.
References rz_analysis_case_obj_t::addr, rz_analysis_bb_t::addr, rz_analysis_function_t::bbs, rz_analysis_switch_obj_t::cases, rz_analysis_bb_t::fail, rz_core_t::flags, found, free(), i, i2, rz_analysis_bb_t::jump, msg, rz_flag_item_t::name, PFMT64d, PFMT64x, rz_cons_printf(), rz_flag_get_i(), rz_str_newf(), strdup(), rz_analysis_bb_t::switch_op, and UT64_MAX.
Referenced by cmd_analysis_graph().
RZ_API void rz_core_recover_vars | ( | RzCore * | core, |
RzAnalysisFunction * | fcn, | ||
bool | argonly | ||
) |
Definition at line 2779 of file canalysis.c.
References rz_analysis_function_t::addr, rz_analysis_function_t::analysis, rz_core_t::analysis, analysis_block_cb(), analysis_block_on_exit(), rz_analysis_options_t::bb_max_size, free(), rz_analysis_t::opt, REG_SET_SIZE, rz_analysis_block_recurse_depth_first(), rz_analysis_get_block_at(), RZ_NEWS0, rz_pvector_fini(), rz_pvector_init(), rz_pvector_push(), rz_return_if_fail, and rz_analysis_function_t::stack.
Referenced by rz_analysis_function_vars_detect_handler(), rz_core_analysis_all(), rz_core_analysis_everything(), and rz_core_analysis_function_add().
RZ_API int rz_core_search_value_in_range | ( | RzCore * | core, |
RzInterval | search_itv, | ||
ut64 | vmin, | ||
ut64 | vmax, | ||
int | vsize, | ||
inRangeCb | cb, | ||
void * | cb_user | ||
) |
Definition at line 4895 of file canalysis.c.
References add_string_ref(), addr, rz_interval_t::addr, rz_search_t::align, rz_core_t::analysis, rz_analysis_plugin_t::arch, rz_analysis_t::bits, cb, rz_core_t::config, rz_analysis_t::cur, eprintf, from, i, rz_core_t::io, isValidAddress(), memset(), NULL, RZ_ANALYSIS_FCN_TYPE_NULL, rz_analysis_get_fcn_in(), rz_analysis_get_fcn_in_bounds(), rz_config_get_b(), rz_cons_break_pop(), rz_cons_break_push(), rz_cons_is_breaked(), rz_io_is_valid_offset(), rz_io_map_next_address(), rz_io_read_at_mapped(), rz_itv_end(), RZ_MIN, rz_core_t::search, stringAt(), to, ut64(), UT64_MAX, v, and value.
Referenced by rz_cmd_search(), and rz_core_analysis_value_pointers().
Adds the information from the Platform Profiles as flags and comments.
core | reference to RzCore |
Definition at line 5263 of file canalysis.c.
References add_arch_platform_flag_comment_cb(), rz_core_t::analysis, rz_core_t::flags, rz_analysis_t::platform_target, rz_platform_target_index_t::platforms, rz_flag_unset_all_in_space(), and RZ_FLAGS_FS_PLATFORM_PORTS.
Referenced by rz_core_analysis_all().
RZ_API void rz_platform_profile_add_flag_every_io | ( | RzPlatformProfile * | profile, |
RzFlag * | flags | ||
) |
Adds the IO and extended IO registers from the CPU profiles as flags.
profile | reference to RzPlatformProfile |
flags | reference to RzFlag |
Definition at line 5236 of file canalysis.c.
References add_mmio_extended_flag_cb(), add_mmio_flag_cb(), flags, rz_platform_profile_t::registers_extended, rz_platform_profile_t::registers_mmio, rz_flag_unset_all_in_space(), RZ_FLAGS_FS_MMIO_REGISTERS, and RZ_FLAGS_FS_MMIO_REGISTERS_EXTENDED.
Referenced by rz_core_analysis_all().
|
static |
Definition at line 2421 of file canalysis.c.
References rz_analysis_ref_t::to.
Referenced by rz_core_analysis_callgraph().
Definition at line 6621 of file canalysis.c.
References path, s, sdb_close(), sdb_free(), sdb_merge(), and sdb_new().
Referenced by rz_core_analysis_cc_init().
|
static |
Definition at line 793 of file canalysis.c.
References rz_analysis_function_t::addr, f, rz_analysis_function_t::name, PFMT64x, rz_analysis_function_rename(), and sdb_fmt().
Referenced by __core_analysis_fcn().
|
static |
Sets a new xref according to the given to and from addresses.
core | The rizin core. |
xref_from | The address where the xref is located. |
xref_to | The target address of the xref. |
type | The xref type. |
decode_str | When set to true, checks if the RZ_ANALYSIS_XREF_TYPE_DATA address is a string and adds a flag. |
Definition at line 3349 of file canalysis.c.
References rz_core_t::analysis, rz_core_t::flags, free(), is_string_at(), len, RZ_ANALYSIS_XREF_TYPE_DATA, rz_analysis_xrefs_set(), rz_flag_set(), RZ_FLAGS_FS_STRINGS, rz_meta_set(), RZ_META_TYPE_STRING, rz_name_filter(), rz_str_newf(), and type.
Referenced by rz_core_analysis_search_xrefs().
Definition at line 4885 of file canalysis.c.
References addr, rz_core_t::io, is_string(), NULL, and rz_io_read_at().
Referenced by rz_core_search_value_in_range().
Definition at line 4096 of file canalysis.c.
Referenced by cccb(), and rz_core_analysis_esil().
Definition at line 4206 of file canalysis.c.
Referenced by esilbreak_mem_read(), and rz_core_analysis_esil().
Definition at line 4205 of file canalysis.c.
Referenced by esilbreak_mem_read(), and rz_core_analysis_esil().
Definition at line 4208 of file canalysis.c.
Referenced by esilbreak_mem_read().
|
static |
Definition at line 7130 of file canalysis.c.
Referenced by rz_core_analysis_name_type_to_str().