Rizin
unix-like reverse engineering framework and cli tools
|
#include <stdio.h>
#include <string.h>
#include <rz_analysis.h>
#include <rz_list.h>
#include <rz_util.h>
#include <rz_core.h>
Go to the source code of this file.
Functions | |
RZ_API bool | rz_core_gdiff_function_1_file (RzCore *c, ut64 addr, ut64 addr2) |
Calculates basic block differences of 2 functions within the same file. More... | |
RZ_API bool | rz_core_gdiff_function_2_files (RzCore *c, RzCore *c2, ut64 addr, ut64 addr2) |
Calculates basic block differences of 2 functions within 2 files. More... | |
RZ_API bool | rz_core_gdiff_2_files (RzCore *c, RzCore *c2) |
Calculates basic block differences of all functions within 2 files. More... | |
static void | diffrow (ut64 addr, const char *name, ut32 size, int maxnamelen, int digits, ut64 addr2, const char *name2, ut32 size2, double dist, bool bare, bool color) |
RZ_API void | rz_core_diff_show (RzCore *c, RzCore *c2, bool json) |
static const char * | diff_color (RzAnalysisBlock *bbi) |
static void | print_color_node (RzCore *core, RzAnalysisBlock *bbi) |
static int | graph_construct_nodes (RzCore *core, RzCore *core2, RzAnalysisFunction *fcn, PJ *pj) |
static int | graph_construct_edges (RzCore *core, RzAnalysisFunction *fcn) |
static int | draw_graph_nodes (RzCore *core, RzCore *core2, RzAnalysisFunction *fcn, PJ *pj) |
RZ_API bool | rz_core_diff_show_function (RzCore *core, RzCore *core2, ut64 addr1, bool json) |
Generate a json or dot output of the graph and its data. More... | |
|
static |
Definition at line 334 of file gdiff.c.
References rz_analysis_bb_t::diff, rz_analysis_diff_t::dist, RZ_ANALYSIS_DIFF_TYPE_MATCH, RZ_ANALYSIS_DIFF_TYPE_UNMATCH, and rz_analysis_diff_t::type.
Referenced by graph_construct_nodes().
|
static |
Definition at line 124 of file gdiff.c.
References addr, color, Color_BGREEN, Color_BRED, Color_BYELLOW, Color_RESET, NULL, PFMT64x, prefix, printf(), RZ_ANALYSIS_DIFF_THRESHOLD, suffix, type, and UT64_MAX.
Referenced by rz_core_diff_show().
|
static |
Definition at line 532 of file gdiff.c.
References rz_analysis_function_t::addr, rz_core_t::analysis, rz_analysis_function_t::bbs, free(), graph_construct_edges(), graph_construct_nodes(), rz_analysis_function_t::maxstack, rz_analysis_function_t::name, rz_analysis_function_t::ninstr, 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_return_val_if_fail, rz_str_escape_utf8_for_json(), rz_str_get_null(), and rz_analysis_function_t::type.
Referenced by rz_core_diff_show_function().
|
static |
Definition at line 491 of file gdiff.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_analysis_case_obj_t::jump, rz_analysis_bb_t::jump, PFMT64x, print_color_node(), printf(), rz_analysis_bb_t::switch_op, and UT64_MAX.
Referenced by draw_graph_nodes().
|
static |
Definition at line 358 of file gdiff.c.
References rz_analysis_diff_t::addr, rz_analysis_function_t::addr, rz_analysis_case_obj_t::addr, rz_analysis_bb_t::addr, rz_analysis_function_t::bbs, COLOR_MODE_DISABLED, rz_analysis_bb_t::colorize, rz_core_t::config, rz_debug_tracepoint_t::count, rz_core_t::dbg, rz_analysis_function_t::diff, rz_analysis_bb_t::diff, diff_color(), eprintf, rz_analysis_bb_t::fail, free(), rz_core_t::io, rz_analysis_case_obj_t::jump, rz_analysis_bb_t::jump, malloc(), rz_analysis_diff_t::name, rz_analysis_function_t::name, NULL, PFMT64u, PFMT64x, pj_a(), pj_end(), pj_k(), pj_ki(), pj_kn(), pj_o(), printf(), RZ_ANALYSIS_DIFF_TYPE_UNMATCH, rz_config_get(), rz_config_hold_free(), rz_config_hold_i(), rz_config_hold_new(), rz_config_hold_restore(), rz_config_set_i(), rz_core_cmd_strf(), 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_str_replace(), rz_str_replace_char(), rz_analysis_bb_t::size, snprintf, rz_analysis_bb_t::switch_op, rz_debug_tracepoint_t::times, rz_analysis_diff_t::type, UT64_MAX, and rz_analysis_case_obj_t::value.
Referenced by draw_graph_nodes().
|
static |
Definition at line 349 of file gdiff.c.
References rz_analysis_bb_t::addr, rz_core_t::config, rz_core_t::offset, PFMT64x, printf(), and rz_config_get_i().
Referenced by graph_construct_edges().
Definition at line 161 of file gdiff.c.
References c, c2, color, diffrow(), eprintf, f, len, NULL, pj_a(), pj_end(), pj_free(), pj_kd(), pj_kn(), pj_ko(), pj_ks(), pj_new(), pj_o(), pj_string(), printf(), RZ_ANALYSIS_DIFF_TYPE_MATCH, RZ_ANALYSIS_DIFF_TYPE_NULL, RZ_ANALYSIS_DIFF_TYPE_UNMATCH, RZ_ANALYSIS_FCN_TYPE_FCN, RZ_ANALYSIS_FCN_TYPE_SYM, rz_analysis_function_realsize(), rz_analysis_get_fcns(), rz_config_get_b(), rz_config_get_i(), rz_list_sort(), rz_return_if_fail, and ut64().
Referenced by rz_diff_graphs_files().
Generate a json or dot output of the graph and its data.
Each node that doesn't match 100% with the other function will include a unified diff of the assembly of the same basic block.
Definition at line 574 of file gdiff.c.
References rz_core_t::analysis, rz_core_t::config, draw_graph_nodes(), eprintf, NULL, PFMT64x, pj_a(), pj_end(), pj_free(), pj_new(), pj_string(), printf(), rz_analysis_get_function_at(), rz_config_get(), and rz_return_val_if_fail.
Referenced by rz_diff_graphs_files().
Calculates basic block differences of all functions within 2 files.
Calculates basic block differences of all functions within 2 files.
Definition at line 89 of file gdiff.c.
References rz_core_t::analysis, rz_analysis_function_t::bbs, c, c2, rz_analysis_t::fcns, i, rz_analysis_function_t::name, rz_analysis_diff_fcn(), rz_analysis_diff_fingerprint_bb(), rz_analysis_diff_fingerprint_fcn(), rz_analysis_function_delete(), and rz_return_val_if_fail.
Referenced by rz_diff_graphs_files().
Calculates basic block differences of 2 functions within the same file.
Calculates basic block differences of 2 functions within the same file
Definition at line 17 of file gdiff.c.
References addr, rz_analysis_function_t::bbs, c, rz_analysis_diff_fcn(), rz_analysis_diff_fingerprint_bb(), rz_analysis_get_function_at(), rz_list_append(), rz_list_free(), and rz_list_new().
Referenced by cmd_analysis_graph().
Calculates basic block differences of 2 functions within 2 files.
Calculates basic block differences of 2 functions within 2 files
Definition at line 47 of file gdiff.c.
References addr, rz_analysis_function_t::bbs, c, c2, eprintf, PFMT64x, rz_analysis_diff_fcn(), rz_analysis_diff_fingerprint_bb(), rz_analysis_diff_fingerprint_fcn(), rz_analysis_get_function_at(), rz_list_append(), rz_list_free(), rz_list_new(), and rz_return_val_if_fail.
Referenced by rz_diff_graphs_files().