Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_analysis.h>
Go to the source code of this file.
Macros | |
#define | CMP_REG_CHANGE(x, y) ((x) - ((RzAnalysisEsilRegChange *)(y))->idx) |
#define | CMP_MEM_CHANGE(x, y) ((x) - ((RzAnalysisEsilMemChange *)(y))->idx) |
Variables | |
static int | ocbs_set = false |
static RzAnalysisEsilCallbacks | ocbs = { 0 } |
#define CMP_MEM_CHANGE | ( | x, | |
y | |||
) | ((x) - ((RzAnalysisEsilMemChange *)(y))->idx) |
Definition at line 8 of file esil_trace.c.
#define CMP_REG_CHANGE | ( | x, | |
y | |||
) | ((x) - ((RzAnalysisEsilRegChange *)(y))->idx) |
Definition at line 7 of file esil_trace.c.
|
static |
Definition at line 110 of file esil_trace.c.
References addr, setup::idx, mem, rz_analysis_esil_trace_t::memory, NULL, RZ_LOG_ERROR, rz_vector_new(), and rz_vector_push().
Referenced by trace_hook_mem_write().
|
static |
Definition at line 95 of file esil_trace.c.
References addr, rz_reg_item_t::arena, setup::idx, NULL, rz_reg_item_t::offset, reg, rz_analysis_esil_trace_t::registers, RZ_LOG_ERROR, rz_vector_new(), rz_vector_push(), and ut64().
Referenced by rz_analysis_esil_trace_op(), and trace_hook_reg_write().
|
inlinestatic |
Definition at line 14 of file esil_trace.c.
References rz_analysis_esil_trace_t::idx, mem, rz_analysis_esil_get_instruction_trace(), and rz_analysis_il_trace_add_mem().
Referenced by trace_hook_mem_read(), and trace_hook_mem_write().
|
inlinestatic |
Definition at line 19 of file esil_trace.c.
References rz_analysis_esil_trace_t::idx, reg, rz_analysis_esil_get_instruction_trace(), and rz_analysis_il_trace_add_reg().
Referenced by trace_hook_reg_read(), and trace_hook_reg_write().
|
static |
Definition at line 24 of file esil_trace.c.
References rz_vector_free().
Referenced by rz_analysis_esil_trace_new().
|
static |
Definition at line 375 of file esil_trace.c.
References setup::idx, ops, PFMT64x, read(), reg, rz_cons_newline(), rz_cons_printf(), rz_hex_bin2str(), RZ_MIN, rz_pvector_empty(), and rz_pvector_foreach.
Referenced by print_instruction_trace().
|
static |
Definition at line 418 of file esil_trace.c.
References setup::idx, PFMT64x, print_instruction_ops(), and rz_cons_printf().
Referenced by rz_analysis_esil_trace_list(), and rz_analysis_esil_trace_show().
Definition at line 321 of file esil_trace.c.
References rz_analysis_esil_t::analysis, c, CMP_MEM_CHANGE, rz_analysis_esil_trace_t::idx, rz_io_bind_t::io, rz_analysis_t::iob, key, len, rz_vector_index_ptr(), rz_vector_upper_bound, rz_analysis_esil_t::trace, value, and rz_io_bind_t::write_at.
Referenced by rz_analysis_esil_trace_restore().
|
static |
Definition at line 334 of file esil_trace.c.
References rz_analysis_esil_t::analysis, rz_reg_item_t::arena, c, CMP_REG_CHANGE, setup::idx, len, NULL, rz_reg_item_t::offset, rz_analysis_t::reg, rz_analysis_esil_trace_t::registers, rz_reg_set_value(), rz_vector_index_ptr(), rz_vector_upper_bound, and rz_analysis_esil_t::trace.
Referenced by rz_analysis_esil_trace_restore().
RZ_API RZ_BORROW RzILTraceInstruction* rz_analysis_esil_get_instruction_trace | ( | RZ_NONNULL RzAnalysisEsilTrace * | etrace, |
int | idx | ||
) |
Get instruction trace from ESIL trace by index
etrace | RzAnalysisEsilTrace *, ESIL trace |
idx | int, index of instruction |
Definition at line 263 of file esil_trace.c.
References setup::idx, NULL, rz_pvector_at(), rz_pvector_len(), and rz_return_val_if_fail.
Referenced by esil_add_mem_trace(), esil_add_reg_trace(), get_addr(), handle_stack_canary(), propagate_types_among_used_variables(), rz_analysis_esil_trace_show(), and type_match().
RZ_API void rz_analysis_esil_trace_free | ( | RzAnalysisEsilTrace * | trace | ) |
Definition at line 79 of file esil_trace.c.
References rz_analysis_esil_trace_t::arena, free(), i, rz_analysis_esil_trace_t::instructions, rz_analysis_esil_trace_t::memory, NULL, rz_analysis_esil_trace_t::registers, RZ_FREE, rz_pvector_free(), rz_reg_arena_free(), RZ_REG_TYPE_LAST, and rz_analysis_esil_trace_t::stack_data.
Referenced by analysis_emul_restore(), rz_analysis_esil_free(), rz_analysis_esil_trace_new(), rz_analysis_rzil_trace_new(), and rz_core_analysis_esil_trace_stop().
RZ_API void rz_analysis_esil_trace_list | ( | RzAnalysisEsil * | esil | ) |
List all traces
esil | RzAnalysisEsil *, ESIL instance |
Definition at line 434 of file esil_trace.c.
References setup::idx, rz_analysis_esil_trace_t::instructions, print_instruction_trace(), rz_cons_printf(), rz_pvector_foreach, rz_return_if_fail, and rz_analysis_esil_t::trace.
Referenced by rz_cmd_debug_trace_esils_handler().
RZ_API RzAnalysisEsilTrace* rz_analysis_esil_trace_new | ( | RzAnalysisEsil * | esil | ) |
Definition at line 28 of file esil_trace.c.
References a, rz_analysis_esil_t::analysis, rz_analysis_esil_trace_t::arena, rz_reg_set_t::arena, b, error(), htup_vector_free(), i, rz_analysis_esil_trace_t::instructions, rz_io_bind_t::io, rz_analysis_t::iob, malloc(), memcpy(), rz_analysis_esil_trace_t::memory, NULL, rz_io_bind_t::read_at, rz_analysis_t::reg, rz_analysis_esil_trace_t::registers, rz_reg_t::regset, rz_analysis_esil_trace_free(), rz_analysis_il_trace_instruction_free(), RZ_LOG_ERROR, RZ_NEW0, rz_pvector_new(), rz_reg_arena_new(), RZ_REG_TYPE_LAST, rz_return_val_if_fail, rz_analysis_esil_trace_t::stack_addr, rz_analysis_esil_t::stack_addr, rz_analysis_esil_trace_t::stack_data, rz_analysis_esil_trace_t::stack_size, and rz_analysis_esil_t::stack_size.
Referenced by analysis_emul_init(), rz_analysis_esil_trace_op(), and rz_core_analysis_esil_trace_start().
RZ_API void rz_analysis_esil_trace_op | ( | RzAnalysisEsil * | esil, |
RZ_NONNULL RzAnalysisOp * | op | ||
) |
Definition at line 271 of file esil_trace.c.
References add_reg_change(), rz_analysis_esil_t::analysis, rz_analysis_esil_t::cb, rz_analysis_esil_trace_t::end_idx, expr(), rz_analysis_esil_callbacks_t::hook_mem_read, rz_analysis_esil_callbacks_t::hook_mem_write, rz_analysis_esil_callbacks_t::hook_reg_read, rz_analysis_esil_callbacks_t::hook_reg_write, rz_analysis_esil_trace_t::idx, rz_analysis_esil_trace_t::instructions, ocbs, ocbs_set, rz_analysis_t::reg, rz_analysis_esil_parse(), rz_analysis_esil_stack_free(), rz_analysis_esil_trace_new(), rz_analysis_esil_trace_restore(), rz_analysis_il_trace_instruction_new(), RZ_LOG_ERROR, rz_pvector_push(), rz_reg_get(), rz_return_if_fail, RZ_STR_ISEMPTY, rz_strbuf_get(), rz_analysis_esil_t::trace, trace_hook_mem_read(), trace_hook_mem_write(), trace_hook_reg_read(), trace_hook_reg_write(), and rz_analysis_esil_t::verbose.
Referenced by rz_cmd_debug_traces_esil_i_handler(), and rz_debug_trace_op().
RZ_API void rz_analysis_esil_trace_restore | ( | RzAnalysisEsil * | esil, |
int | idx | ||
) |
Definition at line 347 of file esil_trace.c.
References a, rz_reg_t::allregs, rz_analysis_esil_t::analysis, rz_analysis_esil_trace_t::arena, rz_reg_set_t::arena, b, i, rz_analysis_esil_trace_t::idx, setup::idx, rz_io_bind_t::io, rz_analysis_t::iob, memcpy(), rz_analysis_esil_trace_t::memory, rz_analysis_t::reg, rz_reg_t::regset, restore_memory_cb(), restore_register(), RZ_REG_TYPE_LAST, rz_return_if_fail, rz_analysis_esil_trace_t::stack_addr, rz_analysis_esil_trace_t::stack_data, rz_analysis_esil_trace_t::stack_size, rz_analysis_esil_t::trace, and rz_io_bind_t::write_at.
Referenced by rz_analysis_esil_trace_op(), rz_core_esil_continue_back(), and rz_core_esil_step_back().
RZ_API void rz_analysis_esil_trace_show | ( | RzAnalysisEsil * | esil, |
int | idx | ||
) |
Display an ESIL trace at index idx
esil | RzAnalysisEsil *, ESIL instance |
idx | int, index of trace |
Definition at line 456 of file esil_trace.c.
References setup::idx, print_instruction_trace(), rz_analysis_esil_get_instruction_trace(), RZ_LOG_ERROR, rz_return_if_fail, and rz_analysis_esil_t::trace.
Referenced by rz_cmd_debug_trace_esil_handler().
|
static |
Definition at line 183 of file esil_trace.c.
References addr, rz_analysis_esil_t::cb, esil_add_mem_trace(), rz_analysis_esil_callbacks_t::hook_mem_read, len, mem_read(), rz_analysis_esil_callbacks_t::mem_read, ocbs, RZ_FREE, RZ_LOG_ERROR, rz_mem_copy(), RZ_NEW0, and rz_analysis_esil_t::trace.
Referenced by rz_analysis_esil_trace_op().
|
static |
Definition at line 219 of file esil_trace.c.
References add_mem_change(), addr, rz_analysis_esil_t::cb, esil_add_mem_trace(), rz_analysis_esil_callbacks_t::hook_mem_write, i, rz_analysis_esil_trace_t::idx, len, mem_write(), ocbs, RZ_FREE, RZ_LOG_ERROR, rz_mem_copy(), RZ_NEW0, and rz_analysis_esil_t::trace.
Referenced by rz_analysis_esil_trace_op().
|
static |
Definition at line 124 of file esil_trace.c.
References rz_analysis_esil_t::analysis, rz_analysis_esil_t::cb, rz_analysis_t::constpool, esil_add_reg_trace(), rz_analysis_esil_callbacks_t::hook_reg_read, ocbs, rz_analysis_esil_callbacks_t::reg_read, RZ_FREE, RZ_LOG_ERROR, RZ_NEW0, rz_str_constpool_get(), and rz_analysis_esil_t::trace.
Referenced by rz_analysis_esil_trace_op().
|
static |
Definition at line 156 of file esil_trace.c.
References add_reg_change(), rz_analysis_esil_t::analysis, rz_analysis_esil_t::cb, rz_analysis_t::constpool, esil_add_reg_trace(), rz_analysis_esil_callbacks_t::hook_reg_write, rz_analysis_esil_trace_t::idx, ocbs, rz_analysis_t::reg, RZ_FREE, RZ_LOG_ERROR, RZ_NEW0, rz_reg_get(), rz_str_constpool_get(), rz_analysis_esil_t::trace, and val.
Referenced by rz_analysis_esil_trace_op().
|
static |
Definition at line 11 of file esil_trace.c.
Referenced by esil_i8051_init(), rz_analysis_esil_trace_op(), trace_hook_mem_read(), trace_hook_mem_write(), trace_hook_reg_read(), and trace_hook_reg_write().
Definition at line 10 of file esil_trace.c.
Referenced by rz_analysis_esil_trace_op().