aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYifan Lu2016-11-03 23:06:55 -0700
committerYifan Lu2016-11-03 23:10:54 -0700
commit7c6659f4ebb6b3c2fdf3705ce13638af619764e1 (patch)
tree0b3496ae2d761002e891ab983bc80b3da18f62c6
parentBad handling of t2 BL/BLX (diff)
downloadsubstitute-7c6659f4ebb6b3c2fdf3705ce13638af619764e1.tar.gz
Fixed extraction for BL/BLX thumb2
-rw-r--r--lib/arm/dis-thumb2.inc.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/arm/dis-thumb2.inc.h b/lib/arm/dis-thumb2.inc.h
index d26e9a0..4203c01 100644
--- a/lib/arm/dis-thumb2.inc.h
+++ b/lib/arm/dis-thumb2.inc.h
@@ -171,19 +171,19 @@ static INLINE void P(unk_Rt_13_VMOVRRD)(tdis_ctx ctx, UNUSED struct bitslice Rt)
return P(unidentified)(ctx);
}
static INLINE void P(t_bltarget_func_1_tBL)(tdis_ctx ctx, struct bitslice func) {
- unsigned crap = bs_get(func, ctx->base.op) << 1;
+ unsigned crap = bs_get(func, ctx->base.op) << 1; // first bit zero
unsigned S = crap >> 24 & 1;
if (!S)
crap ^= (3 << 22);
- return P(branch)(ctx, ctx->base.pc + 4 + 2 * sext(crap, 25), CC_CALL);
+ return P(branch)(ctx, ctx->base.pc + 4 + sext(crap, 25), CC_CALL);
}
static INLINE void P(t_blxtarget_func_1_tBLXi)(tdis_ctx ctx, struct bitslice func) {
- unsigned crap = bs_get(func, ctx->base.op);
+ unsigned crap = bs_get(func, ctx->base.op) << 1; // first two bits zero
unsigned S = crap >> 24 & 1;
if (!S)
crap ^= (3 << 22);
- return P(branch)(ctx, ctx->base.pc + 4 + 2 * sext(crap, 25), CC_CALL);
+ return P(branch)(ctx, ctx->base.pc + 4 + sext(crap, 25), CC_CALL);
}
static INLINE void P(rGPR_func_1_t2BXJ)(tdis_ctx ctx, UNUSED struct bitslice func) {
return P(unidentified)(ctx);