thumb2: incorrect LDR addressing and immediate field
pistol opened this issue · 0 comments
pistol commented
>>> darm.disasm_thumb2(0xf8519003).__str__()
'ldr r9, [r1], r3, lsl #0'
>>> darm.disasm_thumb2(0xf8519003)
Darm(instr=I_LDR, instr_type=T_INVLD, cond=C_AL, Rn=r1, Rm=r3, Rt=r9, I=True, rotate=0, Shift(type_=S_LSL, shift=0))
objdump: f851 9003 ldr.w r9, [r1, r3]
-
Note the addressing difference, darm's
[r1], r3
versus proper[r1, r3]
. -
I
bit should not be set and there is no shifting. According to the manual A8.8.65:
For encoding T2,<shift>
can only be omitted, encoded asimm2 = 0b00
, orLSL #<imm>
with<imm> = 1, 2, or 3
, and<imm>
encoded inimm2
.