summaryrefslogtreecommitdiff
path: root/src/cli/disasm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/disasm.c')
-rw-r--r--src/cli/disasm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cli/disasm.c b/src/cli/disasm.c
index 9b15e0c..6f2ffa4 100644
--- a/src/cli/disasm.c
+++ b/src/cli/disasm.c
@@ -21,6 +21,8 @@ struct zt_branch {
// A conditional jump whose condition does not hold is not taken.
uint8_t taken;
uint8_t indirect;
+ // A jump on a condition.
+ uint8_t conditional;
};
// Whether the flags (and rcx) make a conditional jump go.
@@ -96,6 +98,7 @@ size_t zt_disasm(const uint8_t *code, size_t len, uint64_t addr, char *text, siz
branch->taken = regs ? holds(insn->id, regs[18], regs[11]) : 1;
branch->indirect = 0;
branch->target = 0;
+ branch->conditional = branch->kind == 2 && insn->id != X86_INS_JMP && insn->id != X86_INS_LJMP;
if (branch->kind == 1 || branch->kind == 2) {
const cs_x86_op *op = &x->operands[0];
if (x->op_count < 1) branch->kind = 0;