Rizin
unix-like reverse engineering framework and cli tools
|
#include <string.h>
#include <rz_types.h>
#include <rz_lib.h>
#include <rz_asm.h>
#include <rz_analysis.h>
Go to the source code of this file.
Macros | |
#define | BF_ADDR_MEM 0x10000 |
#define | BF_ADDR_SIZE 64 |
#define | BF_BYTE_SIZE 8 |
#define | BF_ID_STACK 32 |
#define | bf_il_ptr() rz_il_op_new_var("ptr", RZ_IL_VAR_KIND_GLOBAL) |
#define | bf_il_set_ptr(x) rz_il_op_new_set("ptr", false, x) |
#define | bf_il_one(l) rz_il_op_new_bitv_from_ut64(l, 1) |
Functions | |
static int | getid (char ch) |
static void | bf_syscall_read (RzILVM *vm, RzILOpEffect *op) |
static void | bf_syscall_write (RzILVM *vm, RzILOpEffect *op) |
RzILOpEffect * | bf_right_arrow () |
RzILOpEffect * | bf_left_arrow () |
RzILOpEffect * | bf_inc () |
RzILOpEffect * | bf_dec () |
RzILOpEffect * | bf_out () |
RzILOpEffect * | bf_in () |
static ut64 | find_matching_bracket (RzAnalysis *analysis, ut64 addr, int dir) |
RzILOpEffect * | bf_llimit (RzAnalysis *analysis, ut64 addr, ut64 target) |
RzILOpEffect * | bf_rlimit (RzAnalysis *analysis, ut64 addr, ut64 target) |
static RzAnalysisILConfig * | il_config (RzAnalysis *analysis) |
static int | bf_op (RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *buf, int len, RzAnalysisOpMask mask) |
static char * | get_reg_profile (RzAnalysis *analysis) |
Variables | |
RzAnalysisPlugin | rz_analysis_plugin_bf |
RZ_API RzLibStruct | rizin_plugin |
#define BF_ADDR_MEM 0x10000 |
Definition at line 18 of file analysis_bf.c.
#define BF_ADDR_SIZE 64 |
Definition at line 19 of file analysis_bf.c.
#define BF_BYTE_SIZE 8 |
Definition at line 20 of file analysis_bf.c.
#define BF_ID_STACK 32 |
Definition at line 21 of file analysis_bf.c.
#define bf_il_one | ( | l | ) | rz_il_op_new_bitv_from_ut64(l, 1) |
Definition at line 25 of file analysis_bf.c.
#define bf_il_ptr | ( | ) | rz_il_op_new_var("ptr", RZ_IL_VAR_KIND_GLOBAL) |
Definition at line 23 of file analysis_bf.c.
#define bf_il_set_ptr | ( | x | ) | rz_il_op_new_set("ptr", false, x) |
Definition at line 24 of file analysis_bf.c.
RzILOpEffect* bf_dec | ( | ) |
Definition at line 74 of file analysis_bf.c.
References BF_BYTE_SIZE, bf_il_one, bf_il_ptr, load(), rz_il_op_new_load(), rz_il_op_new_store(), and rz_il_op_new_sub().
Referenced by bf_op().
RzILOpEffect* bf_in | ( | ) |
Definition at line 87 of file analysis_bf.c.
References rz_il_op_new_goto().
Referenced by bf_op().
RzILOpEffect* bf_inc | ( | ) |
Definition at line 66 of file analysis_bf.c.
References add(), BF_BYTE_SIZE, bf_il_one, bf_il_ptr, load(), rz_il_op_new_add(), rz_il_op_new_load(), and rz_il_op_new_store().
Referenced by bf_op().
RzILOpEffect* bf_left_arrow | ( | ) |
Definition at line 60 of file analysis_bf.c.
References BF_ADDR_SIZE, bf_il_one, bf_il_ptr, bf_il_set_ptr, and rz_il_op_new_sub().
Referenced by bf_op().
RzILOpEffect* bf_llimit | ( | RzAnalysis * | analysis, |
ut64 | addr, | ||
ut64 | target | ||
) |
Definition at line 131 of file analysis_bf.c.
References cond, jmp, NULL, rz_il_op_new_bitv_from_ut64(), rz_il_op_new_branch(), rz_il_op_new_jmp(), rz_il_op_new_load(), rz_il_op_new_non_zero(), rz_il_op_new_var(), and RZ_IL_VAR_KIND_GLOBAL.
Referenced by bf_op().
|
static |
Definition at line 173 of file analysis_bf.c.
References addr, bf_dec(), bf_in(), bf_inc(), bf_left_arrow(), bf_llimit(), bf_out(), bf_right_arrow(), bf_rlimit(), find_matching_bracket(), getid(), mask, RZ_ANALYSIS_OP_MASK_IL, RZ_ANALYSIS_OP_TYPE_ADD, RZ_ANALYSIS_OP_TYPE_CJMP, RZ_ANALYSIS_OP_TYPE_LOAD, RZ_ANALYSIS_OP_TYPE_NOP, RZ_ANALYSIS_OP_TYPE_STORE, RZ_ANALYSIS_OP_TYPE_SUB, RZ_ANALYSIS_OP_TYPE_TRAP, RZ_ANALYSIS_OP_TYPE_UJMP, rz_il_op_new_nop(), and rz_return_val_if_fail.
RzILOpEffect* bf_out | ( | ) |
RzILOpEffect* bf_right_arrow | ( | ) |
Definition at line 54 of file analysis_bf.c.
References add(), BF_ADDR_SIZE, bf_il_one, bf_il_ptr, bf_il_set_ptr, and rz_il_op_new_add().
Referenced by bf_op().
RzILOpEffect* bf_rlimit | ( | RzAnalysis * | analysis, |
ut64 | addr, | ||
ut64 | target | ||
) |
Definition at line 143 of file analysis_bf.c.
References test-lz4-speed::branch, cond, jmp, NULL, rz_il_op_new_bitv_from_ut64(), rz_il_op_new_branch(), rz_il_op_new_jmp(), rz_il_op_new_load(), rz_il_op_new_non_zero(), rz_il_op_new_var(), and RZ_IL_VAR_KIND_GLOBAL.
Referenced by bf_op().
|
static |
Definition at line 27 of file analysis_bf.c.
References BF_BYTE_SIZE, RzValUnion::bv, c, rz_il_val_t::data, rz_bv_free(), rz_bv_new_from_ut64(), RZ_IL_TYPE_PURE_BITVECTOR, RZ_IL_VAR_KIND_GLOBAL, rz_il_vm_get_var_value(), rz_il_vm_mem_store(), rz_warn_if_reached, and rz_il_val_t::type.
Referenced by il_config().
|
static |
Definition at line 39 of file analysis_bf.c.
References RzValUnion::bv, c, rz_il_val_t::data, rz_bv_free(), rz_bv_to_ut32(), RZ_IL_TYPE_PURE_BITVECTOR, RZ_IL_VAR_KIND_GLOBAL, rz_il_vm_get_var_value(), rz_il_vm_mem_load(), rz_warn_if_reached, and rz_il_val_t::type.
Referenced by il_config().
|
static |
Search matching [ or ] starting at addr in direction given by dir (-1 or 1)
Definition at line 95 of file analysis_bf.c.
References addr, c, rz_analysis_t::read_at, ut64(), and UT64_MAX.
Referenced by bf_op().
|
static |
Definition at line 250 of file analysis_bf.c.
References strdup().
|
static |
|
static |
Definition at line 156 of file analysis_bf.c.
References BF_ADDR_MEM, bf_syscall_read(), bf_syscall_write(), EFFECT_LABEL_HOOK, EFFECT_LABEL_SYSCALL, rz_il_effect_label_t::hook, rz_analysis_il_config_t::init_state, NULL, rz_analysis_il_config_add_label(), rz_analysis_il_config_free(), rz_analysis_il_config_new(), rz_analysis_il_init_state_new(), rz_analysis_il_init_state_set_var(), rz_bv_new_from_ut64(), rz_il_effect_label_new(), and rz_il_value_new_bitv().
RZ_API RzLibStruct rizin_plugin |
Definition at line 276 of file analysis_bf.c.
RzAnalysisPlugin rz_analysis_plugin_bf |
Definition at line 264 of file analysis_bf.c.