radareorg / radare2

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

'tricore' arch disassembler outputs `mfcr d15, $pc` instead of `mfcr d15,#0xfe08` #15150

Closed brandonros closed 4 years ago

brandonros commented 5 years ago

From ghidra:

image

From rasm2:

$ rasm2 -a tricore -o 0x80000000 -D '4d80e0ff'
0x80000000   4                 4d80e0ff  mfcr d15, $pc
brandonros commented 5 years ago

image

brandonros commented 5 years ago

mtcr is wrong too

        80000260 cd 00 e0 0f     mtcr       #0xfe00,d0

image

$ rasm2 -a tricore -o 0x80000000 -D 'cd 00 e0 0f '
0x80000000   4                 cd00e00f  mtcr $pcxi, d0
stefangs0x90 commented 5 years ago

I've started taking a look at this, but it is not obvious to me that the current output is wrong. Is there a way to pass an option to the disassembler to choose whether it resolves the address to its Special Function Register name?

radare commented 5 years ago

The disassembler doesnt do that. Its the rparse plugin who changes numbers for names found in flags or function names. Maybe just removing the # will be enough to make it work without any specific tricore parse plugin

On 6 Oct 2019, at 02:08, Stefan notifications@github.com wrote:

 I've started taking a look at this, but it is not obvious to me that the current output is wrong. Is there a way to pass an option to the disassembler to choose whether it resolves the address to its Special Function Register name?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

c-urly commented 4 years ago

This is done right i am getting the right output in latest master.

Screenshot 2020-03-08 at 11 58 57 PM