summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/radare2/asm_fspec.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/misc/radare2/asm_fspec.c b/misc/radare2/asm_fspec.c
index 9eb28ea..b93450e 100644
--- a/misc/radare2/asm_fspec.c
+++ b/misc/radare2/asm_fspec.c
@@ -13,11 +13,9 @@ enum fspec_instruction {
INS_PUSH,
INS_PUSHR,
INS_POP,
- INS_INCR,
INS_OP,
INS_QUEUE,
INS_IO,
- INS_EXEC,
INS_CALL,
INS_JMP,
INS_JMPIF
@@ -55,12 +53,10 @@ ins_name_str(const enum fspec_instruction name)
case INS_REG: return "reg";
case INS_PUSH: return "push";
case INS_PUSHR: return "pushr";
- case INS_INCR: return "incr";
case INS_POP: return "pop";
case INS_OP: return "op";
case INS_QUEUE: return "queue";
case INS_IO: return "io";
- case INS_EXEC: return "exec";
case INS_CALL: return "call";
case INS_JMP: return "jmp";
case INS_JMPIF: return "jmpif";
@@ -108,19 +104,20 @@ disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len)
} u = {0};
memcpy(u.v, buf, R_MIN(1, (size_t)len));
- const uint8_t insw = 1 << u.ins.n;
+ uint8_t insw = 1 << u.ins.n;
memcpy(u.v, buf, R_MIN(insw, len));
const char *buf_asm = "invalid";
- const bool reg_arg = (u.ins.name == INS_PUSHR || u.ins.name == INS_INCR || u.ins.name == INS_POP ||
- u.ins.name == INS_EXEC || u.ins.name == INS_CALL);
+ const bool reg_arg = (u.ins.name == INS_PUSHR || u.ins.name == INS_POP || u.ins.name == INS_CALL);
if (u.ins.name == INS_OP)
buf_asm = sdb_fmt("%s %s", ins_name_str(u.ins.name), op_name_str(u.ins.v));
else if (reg_arg)
buf_asm = sdb_fmt("%s r%" PRIu64, ins_name_str(u.ins.name), (uint64_t)u.ins.v);
- else
+ else if (u.ins.v != ((uint64_t)1 << 57) - 1)
buf_asm = sdb_fmt("%s %" PRIu64, ins_name_str(u.ins.name), (uint64_t)u.ins.v);
+ else
+ insw = 1; // ff invalid
r_strbuf_set(&op->buf_asm, buf_asm);
return (op->size = insw + (u.ins.name == INS_REG ? u.ins.v : 0));