RAnalgood first issue
Repository metrics
- Stars
- (23,826 stars)
- PR merge metrics
- (Avg merge 16h 24m) (99 merged PRs in 30d)
Description
Work environment
Ubuntu x86 64 raw binary arm/thumb radare2 2.5.0-git 17697 @ linux-x86-64 git.2.4.0-178-ge0086d7d7 commit: e0086d7d701763c91f31c5875a47717138811210 build: 2018-03-20__14:02:38
Expected behavior
setting ahb will only impact asm.bits of the upper range
Actual behavior
asm.bits is modified by the last ahb encountered
Steps to reproduce the behavior
r2 -aarm -b32 armthumb.bin
[0x00000000]> ahb 16 @ 0xc
[0x00000000]> e asm.bits
32
[0x00000000]> pd 16
0x00000000 0000 movs r0, r0
0x00000002 a0e1 b 0x346
0x00000004 0100 movs r1, r0
0x00000006 00ebfeff add.w pc, r0, lr, ror 31
0x0000000a ffea0120 invalid
0x0000000e 7047 bx lr
0x00000010 00c09fe5 invalid
| 0x00000014 1cff2fe1 vrhadd.u16 d14, d12, d31
| 0x00000018 0d00 movs r5, r1
| 0x0000001a 0000 movs r0, r0
| 0x0000001c ffffffff invalid
| 0x00000020 ffffffff invalid
| 0x00000024 ffffffff invalid
| 0x00000028 ffffffff invalid
| 0x0000002c ffffffff invalid
| 0x00000030 ffffffff invalid
[0x00000000]> e asm.bits
16
Start of the file is disassembled with asm.bits=16 and asm.bits is changed to 16
adding ahb 32 @ 0x10
[0x00000000]> ahb 32 @ 0x10
[0x00000000]> pd 16
0x00000000 0000a0e1 mov r0, r0
| 0x00000004 010000eb bl 0x10
| 0x00000008 feffffea b 8
| 0x0000000c 0120 movs r0, 1 ; 1
| 0x0000000e 7047 bx lr
| 0x00000010 00c09fe5 ldr ip, [pc] ; [0x18:4]=13 ; 24
| 0x00000014 1cff2fe1 bx ip
| 0x00000018 0d000000 andeq r0, r0, sp
| 0x0000001c ffffffff invalid
| 0x00000020 ffffffff invalid
| 0x00000024 ffffffff invalid
| 0x00000028 ffffffff invalid
| 0x0000002c ffffffff invalid
| 0x00000030 ffffffff invalid
| 0x00000034 ffffffff invalid
| 0x00000038 ffffffff invalid
[0x00000000]> e asm.bits
32
Correctly disassemble the start with asm.bits=32