esaulenka / ghidra_v850

Ghidra support for Renesas V850 MCUs
MIT License
60 stars 25 forks source link

Better decompiler output #33

Open RyanHope opened 1 month ago

RyanHope commented 1 month ago

Is there anyway to improve the RH850 decompiled output a little bit... below is an example of the output from your extension:

image

And this is the upstream v850 output:

image

RyanHope commented 1 month ago

Here is another spot, idk if this should be its own issue or not.

image

RyanHope commented 1 month ago

I am not sure what is going on here... image

Here is an example use of that function: image

esaulenka commented 1 month ago

I am not sure what is going on here...

0x1'0000'0000 - 0x2F'FCB0 = 0xFFD0'0350 Probably 0xFFD0xxxx belongs to the CAN peripheral (will be better to check user manual for your chip). Try to add this memory area and reanalyze this (and similar) function.

esaulenka commented 1 month ago

Is there anyway to improve the RH850 decompiled

I dont understand what's going here. Probably you have declared a bit different types (at least, if you use default colors, the first image has volatile RAM area, that can significantly change decompiler output).

RyanHope commented 1 month ago

I am not sure what is going on here...

0x1'0000'0000 - 0x2F'FCB0 = 0xFFD0'0350 Probably 0xFFD0xxxx belongs to the CAN peripheral (will be better to check user manual for your chip). Try to add this memory area and reanalyze this (and similar) function.

you were right, I didnt have that memory segment defined, thought I did previously, must have deleted it by mistake