radareorg / radare2

UNIX-like reverse engineering framework and command-line toolset
https://www.radare.org/
GNU Lesser General Public License v3.0
20.33k stars 2.97k forks source link

When disassembling linker from android "unaligned" is shown #7122

Open xwin opened 7 years ago

xwin commented 7 years ago

radare2 from commit 321e51fa6a011ec9944b2926100f6073731f8aa7 can't correctly disassemble some parts of the arm(thumb2) linker from android.

This is example from objdump:

    69ee:       3801            subs    r0, #1
    69f0:       2820            cmp     r0, #32
    69f2:       f200 8237       bhi.w   6e64 <__dl_+0x4> (File Offset: 0x6e64)
    69f6:       e8df f010       tbh     [pc, r0, lsl #1]

This is the same disassembly from radare2:

[0x000069ee]> pd 10
            0x000069ee      0138           unaligned
            0x000069ef      38             unaligned
            0x000069f0      202800f2       vadd.i8 d2, d0, d16
            0x000069f4      3782dfe8       ldm pc, {r0, r1, r2, r4, r5, sb, pc} ^
            ;-- __dl_$d.284:
            0x000069f8  ~   10f02100       eoreq pc, r1, r0, lsl r0
            0x000069fc      f0008202       addeq r0, r2, 0xf0

Radare was started with following command line: radare2 -b16 linker to force thumb disassembly. The applcation appears to force itself to disassemble in arm mode instead of thumb mode. I could not figure out how to coerce it to disassemble thumb instructions.

Maijin commented 7 years ago

Can you please share the bin, drag and drop zip archive with the bin here please, and use markdown code syntax to ident your issue 👍

xwin commented 7 years ago

I tried to upload the file but the file is rejected. I put it in a zip file with 7zip. (https://drive.google.com/open?id=0B1-7nySEwKfVc0ZXYlNzRjNQQTg) This is link from google drive. The binary is android 7 linker. I found the same problem with other binaries. The thumb is correctly disassembled unless one tries to jump around with s or o commands.

Maijin commented 7 years ago

linker.zip as said you needed to zip then drag and drop here.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. Considering a lot has changed since its creation, we kindly ask you to check again if the issue you reported is still relevant in the current version of radare2. If it is, update this issue with a comment, otherwise it will be automatically closed if no further activity occurs. Thank you for your contributions.