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 <rz_util.h>
#include <rz_endian.h>
#include <v850_disas.h>
Go to the source code of this file.
Macros | |
#define | F1_REG1(instr) ((instr)&0x1F) |
#define | F1_REG2(instr) (((instr)&0xF800) >> 11) |
#define | F1_RN1(instr) (V850_REG_NAMES[F1_REG1(instr)]) |
#define | F1_RN2(instr) (V850_REG_NAMES[F1_REG2(instr)]) |
#define | F2_IMM(instr) F1_REG1(instr) |
#define | F2_REG2(instr) F1_REG2(instr) |
#define | F2_RN2(instr) (V850_REG_NAMES[F2_REG2(instr)]) |
#define | F3_COND(instr) ((instr)&0xF) |
#define | F3_DISP(instr) (((instr)&0x70) >> 4) | (((instr)&0xF800) >> 7) |
#define | F4_DISP(instr) ((instr)&0x3F) |
#define | F4_REG2(instr) F1_REG2(instr) |
#define | F4_RN2(instr) (V850_REG_NAMES[F4_REG2(instr)]) |
#define | F5_REG2(instr) F1_REG2(instr) |
#define | F5_DISP(instr) ((((ut32)(instr)&0xffff) << 31) | (((ut32)(instr)&0xffff0000) << 1)) |
#define | F5_RN2(instr) (V850_REG_NAMES[F5_REG2(instr)]) |
#define | F6_REG1(instr) F1_REG1(instr) |
#define | F6_REG2(instr) F1_REG2(instr) |
#define | F6_IMM(instr) (((instr)&0xFFFF0000) >> 16) |
#define | F6_RN1(instr) (V850_REG_NAMES[F6_REG1(instr)]) |
#define | F6_RN2(instr) (V850_REG_NAMES[F6_REG2(instr)]) |
#define | F7_REG1(instr) F1_REG1(instr) |
#define | F7_REG2(instr) F1_REG2(instr) |
#define | F7_DISP(instr) F6_IMM(instr) |
#define | F7_RN1(instr) (V850_REG_NAMES[F7_REG1(instr)]) |
#define | F7_RN2(instr) (V850_REG_NAMES[F7_REG2(instr)]) |
#define | F8_REG1(instr) F1_REG1(instr) |
#define | F8_DISP(instr) F6_IMM(instr) |
#define | F8_BIT(instr) (((instr)&0x3800) >> 11) |
#define | F8_SUB(instr) (((instr)&0xC000) >> 14) |
#define | F8_RN1(instr) (V850_REG_NAMES[F8_REG1(instr)]) |
#define | F8_RN2(instr) (V850_REG_NAMES[F8_REG2(instr)]) |
#define | F9_REG1(instr) F1_REG1(instr) |
#define | F9_REG2(instr) F1_REG2(instr) |
#define | F9_SUB(instr) (((instr)&0x7E00000) >> 21) |
#define | F9_RN1(instr) (V850_REG_NAMES[F9_REG1(instr)]) |
#define | F9_RN2(instr) (V850_REG_NAMES[F9_REG2(instr)]) |
#define | F11_REG1(instr) F1_REG1(instr) |
#define | F11_REG2(instr) F1_REG2(instr) |
#define | F11_REG3(instr) (((instr)&0xF8000000) >> 27) |
#define | F11_SUB(instr) ((((instr)&0x7E00000) >> 20) | (((instr)&2) >> 1)) |
#define | F11_RN1(instr) (V850_REG_NAMES[F11_REG1(instr)]) |
#define | F11_RN2(instr) (V850_REG_NAMES[F11_REG2(instr)]) |
#define | F12_IMM(instr) (F1_REG1(instr) | (((instr)&0x7C0000) >> 13)) |
#define | F12_REG2(instr) F1_REG2(instr) |
#define | F12_REG3(instr) (((instr)&0xF8000000) >> 27) |
#define | F12_SUB(instr) ((((instr)&0x7800001) >> 22) | (((instr)&2) >> 1)) |
#define | F12_RN2(instr) (V850_REG_NAMES[F12_REG2(instr)]) |
#define | F12_RN3(instr) (V850_REG_NAMES[F12_REG3(instr)]) |
#define | F13_IMM(instr) (((instr)&0x3E) >> 1) |
#define | F13_REG2(instr) (((instr)&0x1F0000) >> 16) |
#define | F13_LIST(instr) (((instr) && 0xFFE00000) >> 21) |
#define | F13_RN2(instr) (V850_REG_NAMES[F13_REG2(instr)]) |
#define | KW(d, ds, m, ms) rz_list_append(l, rz_search_keyword_new((const ut8 *)d, ds, (const ut8 *)m, ms, NULL)) |
Functions | |
static void | update_flags (RzAnalysisOp *op, int flags) |
static void | clear_flags (RzAnalysisOp *op, int flags) |
static int | v850_op (RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *buf, int len, RzAnalysisOpMask mask) |
static char * | get_reg_profile (RzAnalysis *analysis) |
static RzList * | analysis_preludes (RzAnalysis *analysis) |
static int | archinfo (RzAnalysis *analysis, int q) |
Variables | |
static const char * | V850_REG_NAMES [] |
RzAnalysisPlugin | rz_analysis_plugin_v850 |
RZ_API RzLibStruct | rizin_plugin |
#define F11_REG1 | ( | instr | ) | F1_REG1(instr) |
Definition at line 79 of file analysis_v850.c.
#define F11_REG2 | ( | instr | ) | F1_REG2(instr) |
Definition at line 80 of file analysis_v850.c.
#define F11_REG3 | ( | instr | ) | (((instr)&0xF8000000) >> 27) |
Definition at line 81 of file analysis_v850.c.
#define F11_RN1 | ( | instr | ) | (V850_REG_NAMES[F11_REG1(instr)]) |
Definition at line 84 of file analysis_v850.c.
#define F11_RN2 | ( | instr | ) | (V850_REG_NAMES[F11_REG2(instr)]) |
Definition at line 85 of file analysis_v850.c.
#define F11_SUB | ( | instr | ) | ((((instr)&0x7E00000) >> 20) | (((instr)&2) >> 1)) |
Definition at line 82 of file analysis_v850.c.
#define F12_IMM | ( | instr | ) | (F1_REG1(instr) | (((instr)&0x7C0000) >> 13)) |
Definition at line 87 of file analysis_v850.c.
#define F12_REG2 | ( | instr | ) | F1_REG2(instr) |
Definition at line 88 of file analysis_v850.c.
#define F12_REG3 | ( | instr | ) | (((instr)&0xF8000000) >> 27) |
Definition at line 89 of file analysis_v850.c.
#define F12_RN2 | ( | instr | ) | (V850_REG_NAMES[F12_REG2(instr)]) |
Definition at line 92 of file analysis_v850.c.
#define F12_RN3 | ( | instr | ) | (V850_REG_NAMES[F12_REG3(instr)]) |
Definition at line 93 of file analysis_v850.c.
#define F12_SUB | ( | instr | ) | ((((instr)&0x7800001) >> 22) | (((instr)&2) >> 1)) |
Definition at line 90 of file analysis_v850.c.
#define F13_IMM | ( | instr | ) | (((instr)&0x3E) >> 1) |
Definition at line 96 of file analysis_v850.c.
#define F13_LIST | ( | instr | ) | (((instr) && 0xFFE00000) >> 21) |
Definition at line 99 of file analysis_v850.c.
#define F13_REG2 | ( | instr | ) | (((instr)&0x1F0000) >> 16) |
Definition at line 98 of file analysis_v850.c.
#define F13_RN2 | ( | instr | ) | (V850_REG_NAMES[F13_REG2(instr)]) |
Definition at line 101 of file analysis_v850.c.
#define F1_REG1 | ( | instr | ) | ((instr)&0x1F) |
Definition at line 16 of file analysis_v850.c.
#define F1_REG2 | ( | instr | ) | (((instr)&0xF800) >> 11) |
Definition at line 17 of file analysis_v850.c.
#define F1_RN1 | ( | instr | ) | (V850_REG_NAMES[F1_REG1(instr)]) |
Definition at line 19 of file analysis_v850.c.
#define F1_RN2 | ( | instr | ) | (V850_REG_NAMES[F1_REG2(instr)]) |
Definition at line 20 of file analysis_v850.c.
#define F2_IMM | ( | instr | ) | F1_REG1(instr) |
Definition at line 23 of file analysis_v850.c.
#define F2_REG2 | ( | instr | ) | F1_REG2(instr) |
Definition at line 24 of file analysis_v850.c.
#define F2_RN2 | ( | instr | ) | (V850_REG_NAMES[F2_REG2(instr)]) |
Definition at line 26 of file analysis_v850.c.
#define F3_COND | ( | instr | ) | ((instr)&0xF) |
Definition at line 29 of file analysis_v850.c.
#define F3_DISP | ( | instr | ) | (((instr)&0x70) >> 4) | (((instr)&0xF800) >> 7) |
Definition at line 30 of file analysis_v850.c.
#define F4_DISP | ( | instr | ) | ((instr)&0x3F) |
Definition at line 33 of file analysis_v850.c.
#define F4_REG2 | ( | instr | ) | F1_REG2(instr) |
Definition at line 34 of file analysis_v850.c.
#define F4_RN2 | ( | instr | ) | (V850_REG_NAMES[F4_REG2(instr)]) |
Definition at line 36 of file analysis_v850.c.
Definition at line 40 of file analysis_v850.c.
#define F5_REG2 | ( | instr | ) | F1_REG2(instr) |
Definition at line 39 of file analysis_v850.c.
#define F5_RN2 | ( | instr | ) | (V850_REG_NAMES[F5_REG2(instr)]) |
Definition at line 41 of file analysis_v850.c.
#define F6_IMM | ( | instr | ) | (((instr)&0xFFFF0000) >> 16) |
Definition at line 46 of file analysis_v850.c.
#define F6_REG1 | ( | instr | ) | F1_REG1(instr) |
Definition at line 44 of file analysis_v850.c.
#define F6_REG2 | ( | instr | ) | F1_REG2(instr) |
Definition at line 45 of file analysis_v850.c.
#define F6_RN1 | ( | instr | ) | (V850_REG_NAMES[F6_REG1(instr)]) |
Definition at line 48 of file analysis_v850.c.
#define F6_RN2 | ( | instr | ) | (V850_REG_NAMES[F6_REG2(instr)]) |
Definition at line 49 of file analysis_v850.c.
#define F7_DISP | ( | instr | ) | F6_IMM(instr) |
Definition at line 54 of file analysis_v850.c.
#define F7_REG1 | ( | instr | ) | F1_REG1(instr) |
Definition at line 52 of file analysis_v850.c.
#define F7_REG2 | ( | instr | ) | F1_REG2(instr) |
Definition at line 53 of file analysis_v850.c.
#define F7_RN1 | ( | instr | ) | (V850_REG_NAMES[F7_REG1(instr)]) |
Definition at line 56 of file analysis_v850.c.
#define F7_RN2 | ( | instr | ) | (V850_REG_NAMES[F7_REG2(instr)]) |
Definition at line 57 of file analysis_v850.c.
#define F8_BIT | ( | instr | ) | (((instr)&0x3800) >> 11) |
Definition at line 62 of file analysis_v850.c.
#define F8_DISP | ( | instr | ) | F6_IMM(instr) |
Definition at line 61 of file analysis_v850.c.
#define F8_REG1 | ( | instr | ) | F1_REG1(instr) |
Definition at line 60 of file analysis_v850.c.
#define F8_RN1 | ( | instr | ) | (V850_REG_NAMES[F8_REG1(instr)]) |
Definition at line 65 of file analysis_v850.c.
#define F8_RN2 | ( | instr | ) | (V850_REG_NAMES[F8_REG2(instr)]) |
Definition at line 66 of file analysis_v850.c.
#define F8_SUB | ( | instr | ) | (((instr)&0xC000) >> 14) |
Definition at line 63 of file analysis_v850.c.
#define F9_REG1 | ( | instr | ) | F1_REG1(instr) |
Definition at line 70 of file analysis_v850.c.
#define F9_REG2 | ( | instr | ) | F1_REG2(instr) |
Definition at line 71 of file analysis_v850.c.
#define F9_RN1 | ( | instr | ) | (V850_REG_NAMES[F9_REG1(instr)]) |
Definition at line 74 of file analysis_v850.c.
#define F9_RN2 | ( | instr | ) | (V850_REG_NAMES[F9_REG2(instr)]) |
Definition at line 75 of file analysis_v850.c.
#define F9_SUB | ( | instr | ) | (((instr)&0x7E00000) >> 21) |
Definition at line 72 of file analysis_v850.c.
#define KW | ( | d, | |
ds, | |||
m, | |||
ms | |||
) | rz_list_append(l, rz_search_keyword_new((const ut8 *)d, ds, (const ut8 *)m, ms, NULL)) |
|
static |
Definition at line 558 of file analysis_v850.c.
References KW, rz_list_newf(), and rz_search_keyword_free().
|
static |
Definition at line 566 of file analysis_v850.c.
References RZ_ANALYSIS_ARCHINFO_ALIGN, RZ_ANALYSIS_ARCHINFO_MAX_OP_SIZE, and RZ_ANALYSIS_ARCHINFO_MIN_OP_SIZE.
|
static |
Definition at line 153 of file analysis_v850.c.
References flags, rz_strbuf_append(), V850_FLAG_CY, V850_FLAG_OV, V850_FLAG_S, and V850_FLAG_Z.
Referenced by v850_op().
|
static |
Definition at line 491 of file analysis_v850.c.
|
static |
Definition at line 138 of file analysis_v850.c.
References flags, rz_strbuf_append(), V850_FLAG_CY, V850_FLAG_OV, V850_FLAG_S, and V850_FLAG_Z.
Referenced by v850_op().
|
static |
Definition at line 168 of file analysis_v850.c.
References addr, clear_flags(), cmd, DISP26, F1_REG1, F1_RN1, F1_RN2, F2_IMM, F2_REG2, F2_RN2, F3_COND, F4_REG2, F5_DISP, F5_RN2, F6_REG2, F6_RN1, F6_RN2, F8_BIT, F8_RN1, F9_RN1, F9_RN2, get_opcode, get_subopcode(), len, memset(), NULL, PFMT64d, RZ_ANALYSIS_OP_TYPE_ADD, RZ_ANALYSIS_OP_TYPE_AND, RZ_ANALYSIS_OP_TYPE_CJMP, RZ_ANALYSIS_OP_TYPE_CMP, RZ_ANALYSIS_OP_TYPE_DIV, RZ_ANALYSIS_OP_TYPE_JMP, RZ_ANALYSIS_OP_TYPE_LOAD, RZ_ANALYSIS_OP_TYPE_MOV, RZ_ANALYSIS_OP_TYPE_MUL, 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_UJMP, RZ_ANALYSIS_OP_TYPE_XOR, RZ_ANALYSIS_STACK_GET, RZ_ANALYSIS_STACK_INC, RZ_ANALYSIS_STACK_SET, RZ_MIN, rz_read_le16(), rz_strbuf_appendf(), SIGN_EXT_T5, st16, st32, st64, st8, update_flags(), V850_ADD, V850_ADD_IMM5, V850_ADDI, V850_AND, V850_ANDI, V850_BCOND, V850_BCOND2, V850_BCOND3, V850_BCOND4, V850_BIT_CLR1, V850_BIT_MANIP, V850_BIT_NOT1, V850_CMP, V850_CMP_IMM5, V850_COND_AL, V850_COND_CL, V850_COND_GE, V850_COND_GT, V850_COND_H, V850_COND_LE, V850_COND_LT, V850_COND_N, V850_COND_NE, V850_COND_NH, V850_COND_NL, V850_COND_NV, V850_COND_P, V850_COND_V, V850_COND_ZE, v850_decode_command(), V850_DIVH, V850_EXT1, V850_EXT_SAR, V850_EXT_SHL, V850_EXT_SHR, V850_FLAG_CY, V850_FLAG_OV, V850_FLAG_S, V850_FLAG_Z, V850_JARL2, V850_JMP, V850_MOV, V850_MOV_IMM5, V850_MOVEA, V850_MULH, V850_MULH_IMM5, V850_NOT, V850_OR, V850_ORI, V850_SAR_IMM5, V850_SHL_IMM5, V850_SHR_IMM5, V850_SLDB, V850_SLDH, V850_SLDW, V850_SP, V850_SSTB, V850_SSTH, V850_SSTW, V850_SUB, V850_SUBR, V850_TST, V850_XOR, and V850_XORI.
RZ_API RzLibStruct rizin_plugin |
Definition at line 592 of file analysis_v850.c.
RzAnalysisPlugin rz_analysis_plugin_v850 |
Definition at line 578 of file analysis_v850.c.
|
static |
Definition at line 103 of file analysis_v850.c.