diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2019-03-07 17:28:52 +0200 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2019-03-07 17:28:52 +0200 |
commit | d0259b21becfa366bde486f90112b83d3ba6ec09 (patch) | |
tree | 8f99b1d0b01e07a5a6d7f4baea6c2ccfe1b07cfa /misc/radare2 | |
parent | 50e58bdd111ae4603c30314a656f57efa9d7f16c (diff) |
tmpir-wip
Diffstat (limited to 'misc/radare2')
-rw-r--r-- | misc/radare2/asm_fspec.c | 13 |
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)); |