Skip to content

Commit

Permalink
Patch to support Capstone next branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Andriesse committed Feb 15, 2018
1 parent 789b1f8 commit 7202b9b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions disasm-x86.cc
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,10 @@ cs_to_nucleus_op_type(x86_op_type op)
return Operand::OP_TYPE_IMM;
case X86_OP_MEM:
return Operand::OP_TYPE_MEM;
#if CS_API_MAJOR < 4 /* X86_OP_FP does not exist in later versions */
case X86_OP_FP:
return Operand::OP_TYPE_FP;
#endif
case X86_OP_INVALID:
default:
return Operand::OP_TYPE_NONE;
Expand Down Expand Up @@ -357,7 +359,11 @@ nucleus_disasm_bb_x86(Binary *bin, DisasmSection *dis, BB *bb)
op->x86_value.reg = cs_op->reg;
if(cflow) ins->flags |= Instruction::INS_FLAG_INDIRECT;
} else if(op->type == Operand::OP_TYPE_FP) {
#if CS_API_MAJOR < 4 /* cs_op->fp does not exist in later versions */
op->x86_value.fp = cs_op->fp;
#else
op->x86_value.fp = 0;
#endif
} else if(op->type == Operand::OP_TYPE_MEM) {
op->x86_value.mem.segment = cs_op->mem.segment;
op->x86_value.mem.base = cs_op->mem.base;
Expand Down

0 comments on commit 7202b9b

Please sign in to comment.