Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Macros | |
#define | OPERAND(x) insn->detail->riscv.operands[x] |
#define | REGID(x) insn->detail->riscv.operands[x].reg |
#define | REG(x) cs_reg_name(*handle, insn->detail->riscv.operands[x].reg) |
#define | IMM(x) insn->detail->riscv.operands[x].imm |
#define | MEMBASE(x) cs_reg_name(*handle, insn->detail->riscv.operands[x].mem.base) |
#define | MEMINDEX(x) insn->detail->riscv.operands[x].mem.index |
#define | MEMDISP(x) insn->detail->riscv.operands[x].mem.disp |
#define | OPCOUNT() insn->detail->riscv.op_count |
#define | SET_VAL(op, i) |
#define | CREATE_SRC_DST_3(op) |
#define | CREATE_SRC_DST_2(op) |
#define | SET_SRC_DST_3_REGS(op) |
#define | SET_SRC_DST_3_IMM(op) |
#define | SET_SRC_DST_2_REGS(op) |
#define | SET_SRC_DST_3_REG_OR_IMM(op) |
#define | ES_IS_NEGATIVE(arg) "1," arg ",<<<,1,&" |
#define | ES_CALL_DR(ra, addr) "pc,4,+," ra ",=," ES_J(addr) |
#define | ES_CALL_D(addr) ES_CALL_DR("ra", addr) |
#define | ES_CALL_NDR(ra, addr) "pc," ra ",=," ES_J(addr) |
#define | ES_CALL_ND(addr) ES_CALL_NDR("ra", addr) |
#define | USE_DS 0 |
#define | ES_TRAP_DS() "" |
#define | ES_J(addr) addr ",pc,=" |
#define | ES_SIGN_EXT64(arg) |
#define | PROTECT_ZERO() |
#define | ESIL_LOAD(size) |
#define | ARG(x) (*str[x] != 0) ? str[x] : arg(handle, insn, str[x], x) |
Functions | |
static void | opex (RzStrBuf *buf, csh handle, cs_insn *insn) |
static const char * | arg (csh *handle, cs_insn *insn, char *buf, int n) |
static int | analop_esil (RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8 *buf, int len, csh *handle, cs_insn *insn) |
static int | parse_reg_name (RzRegItem *reg, csh handle, cs_insn *insn, int reg_num) |
static void | op_fillval (RzAnalysis *analysis, RzAnalysisOp *op, csh *handle, cs_insn *insn) |
static void | set_opdir (RzAnalysisOp *op) |
static int | analop (RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *buf, int len, RzAnalysisOpMask mask) |
static char * | get_reg_profile (RzAnalysis *analysis) |
static int | archinfo (RzAnalysis *analysis, int q) |
Variables | |
RzAnalysisPlugin | rz_analysis_plugin_riscv_cs |
RZ_API RzLibStruct | rizin_plugin |
Definition at line 177 of file analysis_riscv_cs.c.
#define CREATE_SRC_DST_2 | ( | op | ) |
Definition at line 32 of file analysis_riscv_cs.c.
#define CREATE_SRC_DST_3 | ( | op | ) |
Definition at line 27 of file analysis_riscv_cs.c.
#define ES_CALL_D | ( | addr | ) | ES_CALL_DR("ra", addr) |
Definition at line 67 of file analysis_riscv_cs.c.
Definition at line 66 of file analysis_riscv_cs.c.
#define ES_CALL_ND | ( | addr | ) | ES_CALL_NDR("ra", addr) |
Definition at line 71 of file analysis_riscv_cs.c.
Definition at line 70 of file analysis_riscv_cs.c.
Definition at line 63 of file analysis_riscv_cs.c.
Definition at line 81 of file analysis_riscv_cs.c.
#define ES_SIGN_EXT64 | ( | arg | ) |
Definition at line 85 of file analysis_riscv_cs.c.
#define ES_TRAP_DS | ( | ) | "" |
Definition at line 80 of file analysis_riscv_cs.c.
#define ESIL_LOAD | ( | size | ) |
Definition at line 95 of file analysis_riscv_cs.c.
#define IMM | ( | x | ) | insn->detail->riscv.operands[x].imm |
Definition at line 15 of file analysis_riscv_cs.c.
#define MEMBASE | ( | x | ) | cs_reg_name(*handle, insn->detail->riscv.operands[x].mem.base) |
Definition at line 16 of file analysis_riscv_cs.c.
#define MEMDISP | ( | x | ) | insn->detail->riscv.operands[x].mem.disp |
Definition at line 18 of file analysis_riscv_cs.c.
#define MEMINDEX | ( | x | ) | insn->detail->riscv.operands[x].mem.index |
Definition at line 17 of file analysis_riscv_cs.c.
#define OPCOUNT | ( | ) | insn->detail->riscv.op_count |
Definition at line 19 of file analysis_riscv_cs.c.
#define OPERAND | ( | x | ) | insn->detail->riscv.operands[x] |
Definition at line 12 of file analysis_riscv_cs.c.
#define PROTECT_ZERO | ( | ) |
Definition at line 90 of file analysis_riscv_cs.c.
#define REG | ( | x | ) | cs_reg_name(*handle, insn->detail->riscv.operands[x].reg) |
Definition at line 14 of file analysis_riscv_cs.c.
#define REGID | ( | x | ) | insn->detail->riscv.operands[x].reg |
Definition at line 13 of file analysis_riscv_cs.c.
#define SET_SRC_DST_2_REGS | ( | op | ) |
Definition at line 48 of file analysis_riscv_cs.c.
#define SET_SRC_DST_3_IMM | ( | op | ) |
Definition at line 42 of file analysis_riscv_cs.c.
#define SET_SRC_DST_3_REG_OR_IMM | ( | op | ) |
Definition at line 53 of file analysis_riscv_cs.c.
#define SET_SRC_DST_3_REGS | ( | op | ) |
Definition at line 36 of file analysis_riscv_cs.c.
Definition at line 22 of file analysis_riscv_cs.c.
#define USE_DS 0 |
Definition at line 73 of file analysis_riscv_cs.c.
|
static |
Definition at line 318 of file analysis_riscv_cs.c.
References addr, analop_esil(), rz_analysis_t::bits, cs_close(), cs_disasm(), capstone::CS_ERR_OK, cs_free(), cs_open(), CS_OPT_DETAIL, CS_OPT_ON, cs_option(), IMM, len, mask, n, op_fillval(), opex(), RZ_ANALYSIS_OP_MASK_ESIL, RZ_ANALYSIS_OP_MASK_OPEX, RZ_ANALYSIS_OP_MASK_VAL, RZ_ANALYSIS_OP_TYPE_CALL, RZ_ANALYSIS_OP_TYPE_ILL, RZ_ANALYSIS_OP_TYPE_MOV, RZ_ANALYSIS_OP_TYPE_NOP, RZ_ANALYSIS_OP_TYPE_RET, RZ_ANALYSIS_OP_TYPE_UCALL, RZ_ANALYSIS_OP_TYPE_UJMP, rz_strbuf_fini(), and set_opdir().
|
static |
Definition at line 179 of file analysis_riscv_cs.c.
References ARG, i, rz_strbuf_init(), rz_strbuf_set(), and cmd_descs_generate::str.
Referenced by analop().
|
static |
Definition at line 576 of file analysis_riscv_cs.c.
References rz_analysis_t::bits, RZ_ANALYSIS_ARCHINFO_ALIGN, RZ_ANALYSIS_ARCHINFO_MAX_OP_SIZE, and RZ_ANALYSIS_ARCHINFO_MIN_OP_SIZE.
|
static |
Definition at line 396 of file analysis_riscv_cs.c.
References rz_analysis_t::bits, NULL, p, and strdup().
|
static |
Definition at line 220 of file analysis_riscv_cs.c.
References a, c, e, handle, OPERAND, parse_reg_name(), PFMT64x, reg, RZ_ANALYSIS_OP_TYPE_ADD, RZ_ANALYSIS_OP_TYPE_AND, RZ_ANALYSIS_OP_TYPE_DIV, RZ_ANALYSIS_OP_TYPE_LOAD, RZ_ANALYSIS_OP_TYPE_MASK, RZ_ANALYSIS_OP_TYPE_MOV, RZ_ANALYSIS_OP_TYPE_OR, RZ_ANALYSIS_OP_TYPE_SAR, RZ_ANALYSIS_OP_TYPE_SHL, RZ_ANALYSIS_OP_TYPE_SHR, RZ_ANALYSIS_OP_TYPE_STORE, RZ_ANALYSIS_OP_TYPE_SUB, RZ_ANALYSIS_OP_TYPE_XOR, rz_analysis_value_new(), RZ_LOG_ERROR, SET_SRC_DST_2_REGS, SET_SRC_DST_3_IMM, SET_SRC_DST_3_REG_OR_IMM, SET_SRC_DST_3_REGS, type, and ZERO_FILL.
Referenced by analop().
Definition at line 101 of file analysis_riscv_cs.c.
References cs_reg_name(), handle, i, pj_end(), pj_free(), pj_ka(), pj_kN(), pj_ks(), pj_new(), pj_o(), pj_string(), rz_strbuf_append(), rz_strbuf_init(), and x.
Referenced by analop().
Definition at line 202 of file analysis_riscv_cs.c.
References cs_reg_name(), handle, OPERAND, reg, and type.
Referenced by op_fillval().
|
static |
Definition at line 296 of file analysis_riscv_cs.c.
References RZ_ANALYSIS_OP_DIR_EXEC, RZ_ANALYSIS_OP_DIR_READ, RZ_ANALYSIS_OP_DIR_REF, RZ_ANALYSIS_OP_DIR_WRITE, RZ_ANALYSIS_OP_TYPE_CALL, RZ_ANALYSIS_OP_TYPE_JMP, RZ_ANALYSIS_OP_TYPE_LEA, RZ_ANALYSIS_OP_TYPE_LOAD, RZ_ANALYSIS_OP_TYPE_MASK, RZ_ANALYSIS_OP_TYPE_STORE, RZ_ANALYSIS_OP_TYPE_UCALL, and RZ_ANALYSIS_OP_TYPE_UJMP.
Referenced by analop().
RZ_API RzLibStruct rizin_plugin |
Definition at line 604 of file analysis_riscv_cs.c.
RzAnalysisPlugin rz_analysis_plugin_riscv_cs |
Definition at line 591 of file analysis_riscv_cs.c.