Open hughsie opened 2 years ago
The blackfin+ instruction set is a superset of the blackfin one. So adding support means to add the missing instructions. Everything else e.g. name and number of registers is the same.
The added instructions are mainly more DSP instructions and some instructions to directly load 32bit immediate values.
You can try with the current blackfin variant and see how often you encounter unknown instructions.
The added instructions are mainly more DSP instructions and some instructions to directly load 32bit immediate values.
Ahh, I didn't know BF70x was blackfin+ -- thanks for the help there. I did expect to get some kind of control flow output out of the initial setup if nothing else, and only seemed to get junk. Perhaps the decompiler is a little less accepting of padding/data in the header and tail? If it's interesting, the image I'm trying to decompile is https://github.com/hughsie/mobis-vess/raw/main/backup.bin -- it's entirely possible I need to offset the start somehow. Any advice or hints very welcome. Thanks!
That file contains a blackfin boot stream at the beginning. For me it loads fine with this extension and decompiles as far as possible without proper blackfin+ support.
Did you import it as raw binary or as blackfin boot stream?
Did you import it as raw binary or as blackfin boot stream?
Ahh! I tried blackfin boot stream, but I get much further with a raw binary + blackfin-default; 4 functions decompiled -- many thanks for that. Did you get further than me?
You should import it as blackfin boot stream. This removes all the headers in the file and loads the binary to the correct address. It also marks the entry point of the code. But without support for at least the 64bit wide instructions you will not get far.
I pushed a new branch blackfin+ with some very minimal support for these 64 bit instructions. This should help a lot with your file.
import it as blackfin boot stream
Wow, with the blackfin+
branch I get a lot more output; although a lot of the functions have the dreaded Bad instruction - Truncating control flow
. Is there anything I can do to help, I feel really grateful for what you've done for me so far.
Depending on how much you want to learn about sleigh you can look at the documentation in $GHIDRA_HOME/docs/languages/ especially the sleigh manual and start implementing the missing instructions you encounter. Most of them should be new variants of already implemented instructions, so you can take them as example.
I'm trying to decompile some code for a module with a BF70x DSP. I'm aware that BF52x is what's targetted here, but I'm wondering how much work it would be to support the new DSP type. I don't think even IDA supports this weird chip either. :(