keystone
keystone copied to clipboard
ARM/Thumb LDR produce error code when offset out of range
from keystone import *
ks = Ks(KS_ARCH_ARM, KS_MODE_THUMB)
ks.asm("LDR.W R0, $+0x12345678)
ks.asm("LDR.W R0, $+0x2345678)
ks.asm("LDR.W R0, $+0x345678)
The label of the literal data item that is to be loaded into <Rt>. The assembler calculates the required value of the offset from the Align(PC, 4) value of the instruction to this label. Permitted values of the offset are: Encoding T1 Multiples of four in the range 0 to 1020. Encoding T2 or A1 Any value in the range -4095 to 4095.
So I think keystone should add check to the range of offset.