radareorg / radare2

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

ARM disassembly incorrect #15808

Closed williamleecn closed 4 years ago

williamleecn commented 4 years ago
$ rasm2 -a arm -D "03C68FE2"
0x00000000   4                 03c68fe2  add ip, pc, 0x300000

correct should be

00002DDC   03c68fe2   adr     r12, 0x302de4
radare commented 4 years ago

If thats an issue for you u may open the issue in gnu, llvm and capstone (report the same output as r2). Are you comparing it with an invented instruction from IDA.

Also u r missing the -b32 flag

Btw ip = r12

And adr is relative add. R2 replaces those relative references with absolute ones . But thats a layer on top of the disassembling api which is the kne used in rasm2

On 14 Jan 2020, at 14:35, williamleecn notifications@github.com wrote:

 $ rasm2 -a arm -D "03C68FE2" 0x00000000 4 03c68fe2 add ip, pc, 0x300000 correct should be

0x00000000 03c68fe2 adr r12, 0x302de4 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

williamleecn commented 4 years ago
00002DDC   03c68fe2   adr     r12, 0x302de4

should  equal to =>  add  r12, pc, 0x300008
williamleecn commented 4 years ago

the program is correct, my calculation is wrong, it should be added 8 to the pc