Vector35 / binaryninja-api

Public API, examples, documentation and issues for Binary Ninja
https://binary.ninja/
MIT License
896 stars 200 forks source link

ARM-BE: decoding thumb dp instructions incorrectly #812

Closed atlas0fd00m closed 6 years ago

atlas0fd00m commented 6 years ago

if it matters, these are taken from a ARM-BE image. f44f40e4

binja: mov r0, #0x7a00 should be: mov r0, #0x7200 f06f06ab: binja: mvn r6, #0xf0 should be: mvn r6, #0xab f8d60098: binja: ldr r0, [r6, #0xf8] should be: ldr.w r0, [r6, #0x98] f4107f40: binja: tst r0, #0x1e8 should be: tst r0, #0x300 f44f7040: binja: mov r0, #0x1e8 should be: mov r0, #0x300 f4406080: binja: orr r0, r0, #0x7a0 should be: orr r0, r0, #0x400 it looks like the Thumb2 ThumbExpandImm_C functionality is off (although that doesn't explain the LDR decode issue).
lwerdna commented 6 years ago

Nice find, the ARM-BE did matter, thanks for the bug report. Will be fixed as soon as I can run the unit tests.

lwerdna commented 6 years ago

Please update Binja update and try again.

atlas0fd00m commented 6 years ago

much better, although i got a bunch of segfaults when loading the previous bndb. starting over from scratch made it work.