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>
#include "../../asm/arch/riscv/riscv-opc.c"
#include "../../asm/arch/riscv/riscv.h"
#include "../../asm/arch/riscv/riscv-opc.h"
Go to the source code of this file.
Classes | |
struct | riscv_args |
Macros | |
#define | ARRAY_SIZE(a) (sizeof(a) / sizeof(*a)) |
#define | RISCVARGSMAX (8) |
#define | RISCVARGSIZE (64) |
#define | RISCVARGN(x) ((x)->arg[(x)->num++]) |
#define | is_any(...) _is_any(o->name, __VA_ARGS__, NULL) |
#define | OP_HASH_IDX(i) ((i) & (riscv_insn_length(i) == 2 ? 3 : OP_MASK_OP)) |
#define | DECLARE_CSR(name, num) |
#define | ARG(x) (arg_n(&args, (x))) |
Typedefs | |
typedef struct riscv_args | riscv_args_t |
Functions | |
static bool | _is_any (const char *str,...) |
static void | arg_p2 (char *buf, unsigned long val, const char *const *array, size_t size) |
static struct riscv_opcode * | get_opcode (insn_t word) |
static void | get_insn_args (riscv_args_t *args, const char *d, insn_t l, uint64_t pc) |
static const char * | arg_n (riscv_args_t *args, int n) |
static int | riscv_op (RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *data, int len, RzAnalysisOpMask mask) |
static char * | get_reg_profile (RzAnalysis *analysis) |
static int | archinfo (RzAnalysis *a, int q) |
Variables | |
static bool | init = false |
static const char *const * | riscv_gpr_names = riscv_gpr_names_abi |
static const char *const * | riscv_fpr_names = riscv_fpr_names_abi |
RzAnalysisPlugin | rz_analysis_plugin_riscv |
RZ_API RzLibStruct | rizin_plugin |
Definition at line 11 of file analysis_riscv.c.
Definition at line 25 of file analysis_riscv.c.
#define OP_HASH_IDX | ( | i | ) | ((i) & (riscv_insn_length(i) == 2 ? 3 : OP_MASK_OP)) |
#define RISCVARGSIZE (64) |
Definition at line 13 of file analysis_riscv.c.
#define RISCVARGSMAX (8) |
Definition at line 12 of file analysis_riscv.c.
typedef struct riscv_args riscv_args_t |
|
static |
Definition at line 915 of file analysis_riscv.c.
References RZ_ANALYSIS_ARCHINFO_MAX_OP_SIZE.
|
static |
Definition at line 287 of file analysis_riscv.c.
Definition at line 44 of file analysis_riscv.c.
References RISCVARGSIZE, s, snprintf, and val.
Referenced by get_insn_args().
|
static |
Definition at line 68 of file analysis_riscv.c.
References arg_p2(), args, ARRAY_SIZE, d, EXTRACT_ITYPE_IMM, EXTRACT_OPERAND, EXTRACT_RVC_ADDI16SP_IMM, EXTRACT_RVC_ADDI4SPN_IMM, EXTRACT_RVC_B_IMM, EXTRACT_RVC_IMM, EXTRACT_RVC_J_IMM, EXTRACT_RVC_LD_IMM, EXTRACT_RVC_LDSP_IMM, EXTRACT_RVC_LW_IMM, EXTRACT_RVC_LWSP_IMM, EXTRACT_RVC_SDSP_IMM, EXTRACT_RVC_SIMM3, EXTRACT_RVC_SWSP_IMM, EXTRACT_SBTYPE_IMM, EXTRACT_STYPE_IMM, EXTRACT_UJTYPE_IMM, EXTRACT_UTYPE_IMM, NULL, OP_MASK_RD, OP_MASK_RS1, OP_SH_RD, OP_SH_RS1, pc, PFMT64x, rd, RISCV_BIGIMM_REACH, riscv_fpr_names, riscv_gpr_names, RISCV_IMM_BITS, riscv_pred_succ, riscv_rm, RISCVARGN, RISCVARGSIZE, RISCVARGSMAX, RS2, snprintf, ut64(), and X_SP.
Referenced by riscv_op().
|
static |
Definition at line 49 of file analysis_riscv.c.
References init, NUMOPCODES, op, OP_HASH_IDX, OP_MASK_OP, and riscv_opcodes.
Referenced by riscv_op().
|
static |
Definition at line 719 of file analysis_riscv.c.
References rz_analysis_t::bits, NULL, p, and strdup().
|
static |
Definition at line 294 of file analysis_riscv.c.
References addr, ARG, args, riscv_opcode::args, rz_analysis_t::big_endian, rz_analysis_t::bits, comma, esilprintf, EXTRACT_ITYPE_IMM, EXTRACT_RVC_ADDI16SP_IMM, EXTRACT_RVC_ADDI4SPN_IMM, EXTRACT_RVC_B_IMM, EXTRACT_RVC_IMM, EXTRACT_RVC_J_IMM, EXTRACT_SBTYPE_IMM, EXTRACT_UJTYPE_IMM, EXTRACT_UTYPE_IMM, free(), get_insn_args(), get_opcode(), i, INSN_ALIAS, is_any, isalpha, isdigit, len, mask, riscv_opcode::match_func, riscv_opcode::name, NULL, NUMOPCODES, OP_MASK_RD, OP_SH_RD, riscv_opcode::pinfo, rd, rz_analysis_t::reg, riscv_gpr_names, riscv_opcodes, RZ_ANALYSIS_OP_MASK_DISASM, RZ_ANALYSIS_OP_MASK_VAL, RZ_ANALYSIS_OP_TYPE_ADD, RZ_ANALYSIS_OP_TYPE_AND, RZ_ANALYSIS_OP_TYPE_CALL, RZ_ANALYSIS_OP_TYPE_CJMP, RZ_ANALYSIS_OP_TYPE_DIV, RZ_ANALYSIS_OP_TYPE_ILL, RZ_ANALYSIS_OP_TYPE_JMP, RZ_ANALYSIS_OP_TYPE_LOAD, RZ_ANALYSIS_OP_TYPE_MOV, RZ_ANALYSIS_OP_TYPE_MUL, RZ_ANALYSIS_OP_TYPE_NOP, RZ_ANALYSIS_OP_TYPE_NOT, RZ_ANALYSIS_OP_TYPE_OR, RZ_ANALYSIS_OP_TYPE_RET, 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_UCALL, RZ_ANALYSIS_OP_TYPE_UNK, RZ_ANALYSIS_OP_TYPE_XOR, RZ_ANALYSIS_STACK_INC, RZ_ANALYSIS_VAL_IMM, RZ_ANALYSIS_VAL_MEM, RZ_ANALYSIS_VAL_REG, RZ_NEW0, rz_num_get(), rz_num_math(), rz_read_ble16(), rz_read_ble64(), rz_reg_get(), rz_str_rchr(), rz_strbuf_appendf(), signed, st64, strdup(), riscv_opcode::subset, ut64(), and X_SP.
Definition at line 16 of file analysis_riscv.c.
Referenced by get_opcode().
|
static |
Definition at line 18 of file analysis_riscv.c.
Referenced by get_insn_args().
|
static |
Definition at line 17 of file analysis_riscv.c.
Referenced by get_insn_args(), and riscv_op().
RZ_API RzLibStruct rizin_plugin |
Definition at line 935 of file analysis_riscv.c.
RzAnalysisPlugin rz_analysis_plugin_riscv |
Definition at line 922 of file analysis_riscv.c.