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 <h8300_disas.h>
Go to the source code of this file.
Macros | |
#define | emit(frag) rz_strbuf_appendf(&op->esil, frag) |
#define | emitf(...) rz_strbuf_appendf(&op->esil, __VA_ARGS__) |
#define | setZ rz_strbuf_appendf(&op->esil, ",$z,Z,:=") |
#define | setN rz_strbuf_appendf(&op->esil, ",15,$s,N,=") |
#define | setV(val) rz_strbuf_appendf(&op->esil, ",%s,V,=", val) |
#define | setC_B rz_strbuf_appendf(&op->esil, ",7,$c,C,:=") |
#define | setC_W rz_strbuf_appendf(&op->esil, ",15,$c,C,:=") |
#define | setCb_B rz_strbuf_appendf(&op->esil, ",7,$b,C,:=") |
#define | setCb_W rz_strbuf_appendf(&op->esil, ",15,$b,C,:=") |
#define | setH_B rz_strbuf_appendf(&op->esil, ",3,$c,H,:=") |
#define | setH_W rz_strbuf_appendf(&op->esil, ",11,$c,H,:=") |
#define | setHb_B rz_strbuf_appendf(&op->esil, ",3,$b,H,:=") |
#define | setHb_W rz_strbuf_appendf(&op->esil, ",11,$b,H,:=") |
#define | rs() (buf[1] & 0x70) >> 4 |
#define | rsB() (buf[1] & 0x70) >> 4, buf[1] & 0x80 ? 'l' : 'h' |
#define | rd() buf[1] & 0x07 |
#define | rdB(a) buf[a] & 0x07, buf[a] & 0x8 ? 'l' : 'h' |
#define | mask() rz_strbuf_appendf(&op->esil, ",0xffff,r%u,&=", rd()); |
#define | maskB(a) rz_strbuf_appendf(&op->esil, ",0xff,r%u%c,&=", rdB(a)); |
#define | imm buf[1] |
Functions | |
static void | h8300_analysis_jmp (RzAnalysisOp *op, ut64 addr, const ut8 *buf) |
static void | h8300_analysis_jsr (RzAnalysisOp *op, ut64 addr, const ut8 *buf) |
static int | analop_esil (RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8 *buf) |
static int | h8300_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_h8300 |
struct rz_lib_struct_t | rizin_plugin |
#define emit | ( | frag | ) | rz_strbuf_appendf(&op->esil, frag) |
Definition at line 15 of file analysis_h8300.c.
#define emitf | ( | ... | ) | rz_strbuf_appendf(&op->esil, __VA_ARGS__) |
Definition at line 16 of file analysis_h8300.c.
#define imm buf[1] |
Definition at line 43 of file analysis_h8300.c.
#define mask | ( | ) | rz_strbuf_appendf(&op->esil, ",0xffff,r%u,&=", rd()); |
Definition at line 39 of file analysis_h8300.c.
Definition at line 40 of file analysis_h8300.c.
#define rd | ( | ) | buf[1] & 0x07 |
Definition at line 33 of file analysis_h8300.c.
Definition at line 35 of file analysis_h8300.c.
#define rs | ( | ) | (buf[1] & 0x70) >> 4 |
Definition at line 31 of file analysis_h8300.c.
Definition at line 32 of file analysis_h8300.c.
#define setC_B rz_strbuf_appendf(&op->esil, ",7,$c,C,:=") |
Definition at line 21 of file analysis_h8300.c.
#define setC_W rz_strbuf_appendf(&op->esil, ",15,$c,C,:=") |
Definition at line 22 of file analysis_h8300.c.
#define setCb_B rz_strbuf_appendf(&op->esil, ",7,$b,C,:=") |
Definition at line 23 of file analysis_h8300.c.
#define setCb_W rz_strbuf_appendf(&op->esil, ",15,$b,C,:=") |
Definition at line 24 of file analysis_h8300.c.
#define setH_B rz_strbuf_appendf(&op->esil, ",3,$c,H,:=") |
Definition at line 25 of file analysis_h8300.c.
#define setH_W rz_strbuf_appendf(&op->esil, ",11,$c,H,:=") |
Definition at line 26 of file analysis_h8300.c.
#define setHb_B rz_strbuf_appendf(&op->esil, ",3,$b,H,:=") |
Definition at line 27 of file analysis_h8300.c.
#define setHb_W rz_strbuf_appendf(&op->esil, ",11,$b,H,:=") |
Definition at line 28 of file analysis_h8300.c.
#define setN rz_strbuf_appendf(&op->esil, ",15,$s,N,=") |
Definition at line 19 of file analysis_h8300.c.
#define setV | ( | val | ) | rz_strbuf_appendf(&op->esil, ",%s,V,=", val) |
Definition at line 20 of file analysis_h8300.c.
#define setZ rz_strbuf_appendf(&op->esil, ",$z,Z,:=") |
Definition at line 18 of file analysis_h8300.c.
|
static |
Definition at line 89 of file analysis_h8300.c.
References H8300_ADD_4BIT, H8300_ADDB_DIRECT, H8300_ADDS, H8300_ADDW_DIRECT, H8300_ADDX, H8300_ADDX_4BIT, H8300_AND, H8300_AND_4BIT, H8300_ANDC, H8300_BAND_BIAND, H8300_BCC, H8300_BCLR_IMM2R8, H8300_BCLR_R2ABS8, H8300_BCLR_R2IND16, H8300_BCLR_R2R8, H8300_BCS, H8300_BEQ, H8300_BGE, H8300_BGT, H8300_BHI, H8300_BIAND_IMM2ABS8, H8300_BIAND_IMM2IND16, H8300_BILD_IMM2R8, H8300_BLE, H8300_BLS, H8300_BLT, H8300_BMI, H8300_BNE, H8300_BNOT_1, H8300_BNOT_2, H8300_BOR_BIOR, H8300_BPL, H8300_BRA, H8300_BRN, H8300_BSET_1, H8300_BSET_2, H8300_BSR, H8300_BST_BIST, H8300_BTST, H8300_BTST_R2R8, H8300_BVC, H8300_BVS, H8300_BXOR_BIXOR, H8300_CMP_1, H8300_CMP_2, H8300_CMP_4BIT, H8300_DAA, H8300_DAS, H8300_DEC, H8300_DIVXU, H8300_EEPMOV, H8300_INC, H8300_JMP_1, H8300_JMP_2, H8300_JMP_3, H8300_JSR_1, H8300_JSR_2, H8300_JSR_3, H8300_LDC, H8300_LDC_2, H8300_MOV_1, H8300_MOV_2, H8300_MOV_4BIT, H8300_MOV_4BIT_2, H8300_MOV_4BIT_3, H8300_MOV_ABS162R16, H8300_MOV_DISP162R16, H8300_MOV_IMM162R16, H8300_MOV_IND162R16, H8300_MOV_INDINC162R16, H8300_MOV_R82ABS16, H8300_MOV_R82DISPR16, H8300_MOV_R82IND16, H8300_MOV_R82RDEC16, H8300_MULXU, H8300_NOP, H8300_NOT_NEG, H8300_OR, H8300_OR_4BIT, H8300_ORC, H8300_ROTL, H8300_ROTR, H8300_RTE, H8300_RTS, H8300_SHL, H8300_SHR, H8300_SLEEP, H8300_STC, H8300_SUB_1, H8300_SUBS, H8300_SUBW, H8300_SUBX, H8300_SUBX_4BIT, H8300_XOR, H8300_XOR_4BIT, H8300_XORC, imm, mask, maskB, rd, rdB, rs, rsB, rz_strbuf_appendf(), rz_strbuf_init(), rz_strbuf_set(), setC_B, setC_W, setCb_B, setCb_W, setH_B, setH_W, setHb_B, setHb_W, setN, setV, and setZ.
Referenced by h8300_op().
|
static |
Definition at line 684 of file analysis_h8300.c.
|
static |
Definition at line 50 of file analysis_h8300.c.
References H8300_JMP_1, H8300_JMP_2, H8300_JMP_3, RZ_ANALYSIS_OP_TYPE_JMP, RZ_ANALYSIS_OP_TYPE_UJMP, and rz_mem_swapendian().
Referenced by h8300_op().
|
static |
Definition at line 69 of file analysis_h8300.c.
References addr, H8300_JSR_1, H8300_JSR_2, H8300_JSR_3, RZ_ANALYSIS_OP_TYPE_CALL, RZ_ANALYSIS_OP_TYPE_UCALL, and rz_mem_swapendian().
Referenced by h8300_op().
|
static |
Definition at line 542 of file analysis_h8300.c.
References addr, analop_esil(), cmd, H8300_ADD_4BIT, H8300_ADDB_DIRECT, H8300_ADDS, H8300_ADDW_DIRECT, H8300_ADDX, H8300_ADDX_4BIT, h8300_analysis_jmp(), h8300_analysis_jsr(), H8300_AND_4BIT, H8300_ANDC, H8300_BCC, H8300_BCS, H8300_BEQ, H8300_BGE, H8300_BGT, H8300_BHI, H8300_BLE, H8300_BLS, H8300_BLT, H8300_BMI, H8300_BNE, H8300_BPL, H8300_BRA, H8300_BRN, H8300_BTST, H8300_BTST_R2R8, H8300_BVC, H8300_BVS, H8300_CMP_1, H8300_CMP_2, H8300_CMP_4BIT, h8300_decode_command(), H8300_EEPMOV, H8300_JMP_1, H8300_JMP_2, H8300_JMP_3, H8300_JSR_1, H8300_JSR_2, H8300_JSR_3, H8300_MOV_1, H8300_MOV_2, H8300_MOV_4BIT, H8300_MOV_4BIT_2, H8300_MOV_4BIT_3, H8300_MOV_ABS162R16, H8300_MOV_DISP162R16, H8300_MOV_IMM162R16, H8300_MOV_IND162R16, H8300_MOV_INDINC162R16, H8300_MOV_R82ABS16, H8300_MOV_R82DISPR16, H8300_MOV_R82IND16, H8300_MOV_R82RDEC16, H8300_MULXU, H8300_NOP, H8300_RTS, H8300_SHL, H8300_SHR, H8300_SUB_1, H8300_SUBS, H8300_SUBW, H8300_SUBX, H8300_SUBX_4BIT, H8300_XOR, H8300_XOR_4BIT, H8300_XORC, mask, RZ_ANALYSIS_OP_MASK_ESIL, RZ_ANALYSIS_OP_TYPE_ADD, RZ_ANALYSIS_OP_TYPE_AND, RZ_ANALYSIS_OP_TYPE_CJMP, RZ_ANALYSIS_OP_TYPE_CMP, RZ_ANALYSIS_OP_TYPE_MOV, RZ_ANALYSIS_OP_TYPE_MUL, RZ_ANALYSIS_OP_TYPE_NOP, RZ_ANALYSIS_OP_TYPE_RET, RZ_ANALYSIS_OP_TYPE_SHL, RZ_ANALYSIS_OP_TYPE_SHR, RZ_ANALYSIS_OP_TYPE_SUB, RZ_ANALYSIS_OP_TYPE_UNK, RZ_ANALYSIS_OP_TYPE_XOR, and st8.
struct rz_lib_struct_t rizin_plugin |
Definition at line 726 of file analysis_h8300.c.
RzAnalysisPlugin rz_analysis_plugin_h8300 |
Definition at line 726 of file analysis_h8300.c.