diff options
Diffstat (limited to 'miasm2/arch')
| -rw-r--r-- | miasm2/arch/arm/arch.py | 1 | ||||
| -rw-r--r-- | miasm2/arch/arm/sem.py | 23 |
2 files changed, 24 insertions, 0 deletions
diff --git a/miasm2/arch/arm/arch.py b/miasm2/arch/arm/arch.py index 73b198ba..f0e32834 100644 --- a/miasm2/arch/arm/arch.py +++ b/miasm2/arch/arm/arch.py @@ -1528,6 +1528,7 @@ lsb = bs(l=5, cls=(arm_imm, m_arg)) armop("ubfx", [bs('0111111'), widthm1, rd, lsb, bs('101'), rn], [rd, rn, lsb, widthm1]) +armop("bfc", [bs('0111110'), widthm1, rd, lsb, bs('001'), bs('1111')], [rd, lsb, widthm1]) # # thumnb ####################### # diff --git a/miasm2/arch/arm/sem.py b/miasm2/arch/arm/sem.py index 751891ca..1ef0b624 100644 --- a/miasm2/arch/arm/sem.py +++ b/miasm2/arch/arm/sem.py @@ -871,6 +871,28 @@ def ubfx(ir, instr, a, b, c, d): e.append(ExprAff(ir.IRDst, r)) return e +def bfc(ir, instr, a, b, c): + e = [] + start = int(b.arg) + stop = start + int(c.arg) + out = [] + last = 0 + if start: + out.append((a[:start], 0, start)) + last = start + if stop - start: + out.append((ExprInt32(0)[last:stop], last, stop)) + last = stop + if last < 32: + out.append((a[last:], last, 32)) + r = ExprCompose(out) + e.append(ExprAff(a, r)) + dst = None + if PC in a.get_r(): + dst = PC + e.append(ExprAff(ir.IRDst, r)) + return e + COND_EQ = 0 @@ -1009,6 +1031,7 @@ mnemo_condm0 = {'add': add, 'sxtb': sxtb, 'sxth': sxth, 'ubfx': ubfx, + 'bfc': bfc, } mnemo_condm1 = {'adds': add, |