15 #include "../../asm/arch/rsp/rsp_idec.h"
44 parsed_operands[
i].esil[0] =
'\0';
54 parsed_operands[
i].value->imm =
op->val = rz_instr.
operands[
i].
u;
58 parsed_operands[
i].value->imm =
op->val = rz_instr.
operands[
i].
s;
61 snprintf(parsed_operands[
i].esil,
sizeof(parsed_operands[
i].esil),
64 parsed_operands[
i].value->imm = rz_instr.
operands[
i].
s;
73 parsed_operands[
i].value->imm = rz_instr.
operands[
i].
u;
74 parsed_operands[
i].value->memref = 4;
105 op->dst = parsed_operands[0].value;
106 op->src[0] = parsed_operands[1].value;
107 rz_strbuf_setf(&
op->esil,
"%s,%s,=", parsed_operands[1].esil, parsed_operands[0].esil);
114 op->dst = parsed_operands[0].value;
115 op->src[0] = parsed_operands[1].value;
116 op->src[1] = parsed_operands[2].value;
117 rz_strbuf_setf(&
op->esil,
"%s,%s,+,%s,=", parsed_operands[2].esil, parsed_operands[1].esil, parsed_operands[0].esil);
122 op->dst = parsed_operands[0].value;
123 op->src[0] = parsed_operands[1].value;
124 op->src[1] = parsed_operands[2].value;
125 rz_strbuf_setf(&
op->esil,
"%s,%s,-,%s,=", parsed_operands[2].esil, parsed_operands[1].esil, parsed_operands[0].esil);
130 op->dst = parsed_operands[0].value;
131 op->src[0] = parsed_operands[1].value;
132 op->src[1] = parsed_operands[2].value;
133 rz_strbuf_setf(&
op->esil,
"%s,%s,&,%s,=", parsed_operands[2].esil, parsed_operands[1].esil, parsed_operands[0].esil);
138 op->dst = parsed_operands[0].value;
139 op->src[0] = parsed_operands[1].value;
140 op->src[1] = parsed_operands[2].value;
141 rz_strbuf_setf(&
op->esil,
"%s,%s,|,%s,=", parsed_operands[2].esil, parsed_operands[1].esil, parsed_operands[0].esil);
146 op->dst = parsed_operands[0].value;
147 op->src[0] = parsed_operands[1].value;
148 op->src[1] = parsed_operands[2].value;
149 rz_strbuf_setf(&
op->esil,
"%s,%s,^,%s,=", parsed_operands[2].esil, parsed_operands[1].esil, parsed_operands[0].esil);
153 op->dst = parsed_operands[0].value;
154 op->src[0] = parsed_operands[1].value;
155 op->src[1] = parsed_operands[2].value;
161 op->dst = parsed_operands[0].value;
162 op->src[0] = parsed_operands[1].value;
163 op->src[1] = parsed_operands[2].value;
164 rz_strbuf_setf(&
op->esil,
"%s,%s,<<,%s,=", parsed_operands[2].esil, parsed_operands[1].esil, parsed_operands[0].esil);
169 op->dst = parsed_operands[0].value;
170 op->src[0] = parsed_operands[1].value;
171 op->src[1] = parsed_operands[2].value;
172 rz_strbuf_setf(&
op->esil,
"%s,%s,>>,%s,=", parsed_operands[2].esil, parsed_operands[1].esil, parsed_operands[0].esil);
177 op->dst = parsed_operands[0].value;
178 op->src[0] = parsed_operands[1].value;
179 op->src[1] = parsed_operands[2].value;
188 op->dst = parsed_operands[0].value;
189 op->src[0] = parsed_operands[1].value;
190 op->src[1] = parsed_operands[2].value;
191 rz_strbuf_setf(&
op->esil,
"%s,%s,<,$z,?{,1,%s,=,}{,0,%s,=,}", parsed_operands[2].esil, parsed_operands[1].esil, parsed_operands[0].esil, parsed_operands[0].esil);
197 op->src[0] = parsed_operands[0].value;
204 op->src[0] = parsed_operands[0].value;
217 op->src[0] = parsed_operands[0].value;
225 op->src[0] = parsed_operands[0].value;
226 op->src[1] = parsed_operands[1].value;
227 rz_strbuf_setf(&
op->esil,
"%s,%s,==,$z,?{,%s,PC,=,}", parsed_operands[0].esil, parsed_operands[1].esil, parsed_operands[2].esil);
234 op->src[0] = parsed_operands[0].value;
235 op->src[1] = parsed_operands[1].value;
236 rz_strbuf_setf(&
op->esil,
"%s,%s,==,$z,!,?{,%s,PC,=,}", parsed_operands[0].esil, parsed_operands[1].esil, parsed_operands[2].esil);
243 op->src[0] = parsed_operands[0].value;
244 op->src[1] = parsed_operands[1].value;
245 rz_strbuf_setf(&
op->esil,
"%s,!,%s,0x80000000,&,!,!,|,?{,%s,PC,=,}", parsed_operands[0].esil, parsed_operands[0].esil, parsed_operands[1].esil);
253 op->src[0] = parsed_operands[0].value;
254 op->src[1] = parsed_operands[1].value;
255 rz_strbuf_setf(&
op->esil,
"%s,0x80000000,&,!,%s,!,!,&,?{,%s,PC,=,}", parsed_operands[0].esil, parsed_operands[0].esil, parsed_operands[1].esil);
263 op->src[0] = parsed_operands[0].value;
264 op->src[1] = parsed_operands[1].value;
265 rz_strbuf_setf(&
op->esil,
"%s,0x80000000,&,!,!,?{,%s,PC,=,}", parsed_operands[0].esil, parsed_operands[1].esil);
273 op->src[0] = parsed_operands[0].value;
274 op->src[1] = parsed_operands[1].value;
275 rz_strbuf_setf(&
op->esil,
"%s,0x80000000,&,!,?{,%s,PC,=,}", parsed_operands[0].esil, parsed_operands[1].esil);
283 op->src[0] = parsed_operands[0].value;
284 op->src[1] = parsed_operands[1].value;
292 op->src[0] = parsed_operands[0].value;
293 op->src[1] = parsed_operands[1].value;
298 op->dst = parsed_operands[0].value;
299 op->src[0] = parsed_operands[1].value;
300 op->src[0]->memref =
op->refptr = 1;
302 rz_strbuf_setf(&
op->esil,
"%s,[1],%s,=", parsed_operands[1].esil, parsed_operands[0].esil);
306 op->dst = parsed_operands[0].value;
307 op->src[0] = parsed_operands[1].value;
308 op->src[0]->memref =
op->refptr = 2;
310 rz_strbuf_setf(&
op->esil,
"%s,[2],%s,=", parsed_operands[1].esil, parsed_operands[0].esil);
314 op->dst = parsed_operands[0].value;
315 op->src[0] = parsed_operands[1].value;
316 op->src[0]->memref =
op->refptr = 4;
317 rz_strbuf_setf(&
op->esil,
"%s,[4],%s,=", parsed_operands[1].esil, parsed_operands[0].esil);
321 op->dst = parsed_operands[0].value;
322 op->src[0] = parsed_operands[1].value;
323 op->src[0]->memref =
op->refptr = 1;
324 rz_strbuf_setf(&
op->esil,
"%s,[1],%s,=", parsed_operands[1].esil, parsed_operands[0].esil);
328 op->dst = parsed_operands[0].value;
329 op->src[0] = parsed_operands[1].value;
330 op->src[0]->memref =
op->refptr = 2;
331 rz_strbuf_setf(&
op->esil,
"%s,[2],%s,=", parsed_operands[1].esil, parsed_operands[0].esil);
335 op->src[0] = parsed_operands[0].value;
336 op->dst = parsed_operands[1].value;
337 op->dst->memref =
op->refptr = 1;
338 rz_strbuf_setf(&
op->esil,
"%s,%s,=[1]", parsed_operands[0].esil, parsed_operands[1].esil);
342 op->src[0] = parsed_operands[0].value;
343 op->dst = parsed_operands[1].value;
344 op->dst->memref =
op->refptr = 2;
345 rz_strbuf_setf(&
op->esil,
"%s,%s,=[2]", parsed_operands[0].esil, parsed_operands[1].esil);
349 op->src[0] = parsed_operands[0].value;
350 op->dst = parsed_operands[1].value;
351 op->dst->memref =
op->refptr = 4;
352 rz_strbuf_setf(&
op->esil,
"%s,%s,=[4]", parsed_operands[0].esil, parsed_operands[1].esil);
356 op->dst = parsed_operands[0].value;
357 op->src[0] = parsed_operands[1].value;
358 rz_strbuf_setf(&
op->esil,
"%s,%s,=", parsed_operands[1].esil, parsed_operands[0].esil);
362 op->src[0] = parsed_operands[0].value;
363 op->dst = parsed_operands[1].value;
364 rz_strbuf_setf(&
op->esil,
"%s,%s,=", parsed_operands[0].esil, parsed_operands[1].esil);
368 op->dst = parsed_operands[0].value;
373 op->src[0] = parsed_operands[0].value;
582 static const char *
p =
627 "gpr $c0 .32 132 0\n"
628 "gpr $c1 .32 136 0\n"
629 "gpr $c2 .32 140 0\n"
630 "gpr $c3 .32 144 0\n"
631 "gpr $c4 .32 148 0\n"
632 "gpr $c5 .32 152 0\n"
633 "gpr $c6 .32 156 0\n"
634 "gpr $c7 .32 160 0\n"
635 "gpr $c8 .32 164 0\n"
636 "gpr $c9 .32 168 0\n"
637 "gpr $c10 .32 172 0\n"
638 "gpr $c11 .32 176 0\n"
639 "gpr $c12 .32 180 0\n"
640 "gpr $c13 .32 184 0\n"
641 "gpr $c14 .32 188 0\n"
642 "gpr $c15 .32 192 0\n"
644 "gpr $v0 .128 196 0\n"
645 "gpr $v1 .128 212 0\n"
646 "gpr $v2 .128 228 0\n"
647 "gpr $v3 .128 244 0\n"
648 "gpr $v4 .128 260 0\n"
649 "gpr $v5 .128 276 0\n"
650 "gpr $v6 .128 292 0\n"
651 "gpr $v7 .128 308 0\n"
652 "gpr $v8 .128 324 0\n"
653 "gpr $v9 .128 340 0\n"
654 "gpr $v10 .128 356 0\n"
655 "gpr $v11 .128 372 0\n"
656 "gpr $v12 .128 388 0\n"
657 "gpr $v13 .128 404 0\n"
658 "gpr $v14 .128 420 0\n"
659 "gpr $v15 .128 436 0\n"
660 "gpr $v16 .128 452 0\n"
661 "gpr $v17 .128 468 0\n"
662 "gpr $v18 .128 484 0\n"
663 "gpr $v19 .128 500 0\n"
664 "gpr $v20 .128 516 0\n"
665 "gpr $v21 .128 532 0\n"
666 "gpr $v22 .128 548 0\n"
667 "gpr $v23 .128 564 0\n"
668 "gpr $v24 .128 580 0\n"
669 "gpr $v25 .128 596 0\n"
670 "gpr $v26 .128 612 0\n"
671 "gpr $v27 .128 628 0\n"
672 "gpr $v28 .128 644 0\n"
673 "gpr $v29 .128 660 0\n"
674 "gpr $v30 .128 676 0\n"
675 "gpr $v31 .128 692 0\n"
677 "gpr $vco .128 708 0\n"
678 "gpr $vcc .128 724 0\n"
679 "gpr $vce .128 740 0\n";
690 .desc =
"RSP code analysis plugin",
700 #ifndef RZ_PLUGIN_INCORE
RZ_API RzAnalysisValue * rz_analysis_value_new(void)
RzAnalysisPlugin rz_analysis_plugin_rsp
static char * get_reg_profile(RzAnalysis *analysis)
RZ_API RzLibStruct rizin_plugin
static int rsp_op(RzAnalysis *analysis, RzAnalysisOp *op, ut64 addr, const ut8 *b, int len, RzAnalysisOpMask mask)
static int archinfo(RzAnalysis *analysis, int q)
return memset(p, 0, total)
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
RZ_API RzRegItem * rz_reg_get(RzReg *reg, const char *name, int type)
rsp_instruction rsp_instruction_decode(ut64 pc, ut32 iw)
const char * rsp_gp_reg_soft_names[]
const char * rsp_c0_reg_names[]
static ut64 rsp_mem_addr(ut64 addr, ut64 base)
@ RSP_OPND_C2_VREG_ELEMENT
@ RSP_OPND_C2_VREG_SCALAR
@ RZ_ANALYSIS_OP_TYPE_CMP
@ RZ_ANALYSIS_OP_TYPE_SUB
@ RZ_ANALYSIS_OP_TYPE_LOAD
@ RZ_ANALYSIS_OP_TYPE_UNK
@ RZ_ANALYSIS_OP_TYPE_MUL
@ RZ_ANALYSIS_OP_TYPE_JMP
@ RZ_ANALYSIS_OP_TYPE_AND
@ RZ_ANALYSIS_OP_TYPE_UJMP
@ RZ_ANALYSIS_OP_TYPE_NOR
@ RZ_ANALYSIS_OP_TYPE_SAR
@ RZ_ANALYSIS_OP_TYPE_ABS
@ RZ_ANALYSIS_OP_TYPE_CMOV
@ RZ_ANALYSIS_OP_TYPE_TRAP
@ RZ_ANALYSIS_OP_TYPE_CCALL
@ RZ_ANALYSIS_OP_TYPE_CALL
@ RZ_ANALYSIS_OP_TYPE_ADD
@ RZ_ANALYSIS_OP_TYPE_STORE
@ RZ_ANALYSIS_OP_TYPE_SHR
@ RZ_ANALYSIS_OP_TYPE_CJMP
@ RZ_ANALYSIS_OP_TYPE_MOV
@ RZ_ANALYSIS_OP_TYPE_SHL
@ RZ_ANALYSIS_OP_TYPE_ILL
@ RZ_ANALYSIS_OP_TYPE_RET
@ RZ_ANALYSIS_OP_TYPE_NOP
@ RZ_ANALYSIS_OP_TYPE_XOR
static ut32 rz_read_ble32(const void *src, bool big_endian)
RZ_API const char * rz_strbuf_set(RzStrBuf *sb, const char *s)
RZ_API const char * rz_strbuf_setf(RzStrBuf *sb, const char *fmt,...) RZ_PRINTF_CHECK(2
@ RZ_TYPE_COND_LE
Less or equal.
@ RZ_TYPE_COND_GE
Greater or equal.
@ RZ_TYPE_COND_NE
Not equal.
@ RZ_TYPE_COND_GT
Greater than.
@ RZ_TYPE_COND_LT
Less than.
rsp_operand operands[RSP_MAX_OPNDS]
ut64(WINAPI *w32_GetEnabledXStateFeatures)()