Skip to content

Commit

Permalink
Disable analysis ARM hacks for Capstone 6 (#4180)
Browse files Browse the repository at this point in the history
  • Loading branch information
XVilka committed Feb 2, 2024
1 parent b4e73e3 commit d5bfd45
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion librz/analysis/p/analysis_arm_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1961,6 +1961,7 @@ static void op_fillval(RzAnalysis *analysis, RzAnalysisOp *op, csh handle, cs_in
}
}

#if CS_NEXT_VERSION < 6
static void patch_capstone_bugs(cs_insn *insn, int bits, bool big_endian) {
if (!insn->detail) {
return;
Expand All @@ -1980,6 +1981,7 @@ static void patch_capstone_bugs(cs_insn *insn, int bits, bool big_endian) {
}
}
}
#endif

static int analysis_op(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8 *buf, int len, RzAnalysisOpMask mask) {
ArmCSContext *ctx = (ArmCSContext *)a->plugin_data;
Expand Down Expand Up @@ -2029,9 +2031,10 @@ static int analysis_op(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8 *bu
op->mnemonic = strdup("invalid");
}
} else {
#if CS_NEXT_VERSION < 6
patch_capstone_bugs(insn, a->bits, a->big_endian);
#endif
if (mask & RZ_ANALYSIS_OP_MASK_DISASM) {
// TODO Remove after Capstone auto-sync update.
op->mnemonic = rz_str_newf("%s%s%s",
insn->mnemonic,
insn->op_str[0] ? " " : "",
Expand Down

0 comments on commit d5bfd45

Please sign in to comment.