sualk / ghidra-blackfin Goto Github PK
View Code? Open in Web Editor NEWBlackfin CPU support for ghidra
Blackfin CPU support for ghidra
Hey sualk! Sorry for using this as a forum for questions, but I couldn't find an email or something like that...
I am analysing firmware from a device that uses a ADSP-BF536 processor, using your plugin. Your dissassembler finds a ton of operations, but the problem is that the control flow doesn't really make sense compared to what I know about the program, and in the decompiler I get a lot of "WARNING: Could not recover jumptable at..."
One thing that could be contributing to the problem is that the firmware file is not able to be loaded as a .ldr file, neither by your extension nor by tool i found that is supposed to be able to read ldr-files. It exists in the device on a flashdrive as a file with the file-extension .BIN, and does not appear to have to correct headers for a .dxe file nor a .ldr file, so it is a mystery to me how the firmware is loaded.
Do you have any ideas of what I could do to get a better result out of ghidra, or any thoughts about what kind of file this might be?
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. :(
Gradle is unable to build for Ghidra 11.0.3, because the relocate()
override in Blackfin_ElfRelocationHandler.java now must have return type RelocationResult
instead of void
.
Error log:
> Task :compileJava FAILED
/Users/wes/Code/opz-tools/ghidra-blackfin/src/main/java/ghidra/app/util/bin/format/elf/relocation/Blackfin_ElfRelocationHandler.java:13: error: Blackfin_ElfRelocationHandler is not abstract and does not override abstract method relocate(ElfRelocationContext,ElfRelocation,Address) in ElfRelocationHandler
public class Blackfin_ElfRelocationHandler extends ElfRelocationHandler {
^
/Users/wes/Code/opz-tools/ghidra-blackfin/src/main/java/ghidra/app/util/bin/format/elf/relocation/Blackfin_ElfRelocationHandler.java:21: error: relocate(ElfRelocationContext,ElfRelocation,Address) in Blackfin_ElfRelocationHandler cannot override relocate(ElfRelocationContext,ElfRelocation,Address) in ElfRelocationHandler
public void relocate(ElfRelocationContext elfRelocationContext, ElfRelocation relocation, Address relocationAddress)
^
return type void is not compatible with RelocationResult
/Users/wes/Code/opz-tools/ghidra-blackfin/src/main/java/ghidra/app/util/bin/format/elf/relocation/Blackfin_ElfRelocationHandler.java:20: error: method does not override or implement a method from a supertype
@Override
^
When compiling this plugin with Ghidra Version "10.1-BETA Build PUBLIC 2021-Nov-16 1948 Est", I am getting the below error once trying to import any binary or .elf file:
This somehow does related to the CSPEC file, but looking at other cspec files for other processors, I cannot spot really an issue.
Can you maybe let me know with which Ghidra version you developed/tested this plugin, such that I can downgrade?
Exception reading blackfin:LE:32:default/default(blackfin.cspec): tags within a group must be distinguished by size or type
ghidra.program.model.lang.CompilerSpecNotFoundException: Exception reading blackfin:LE:32:default/default(blackfin.cspec): tags within a group must be distinguished by size or type
at ghidra.program.model.lang.BasicCompilerSpec.(BasicCompilerSpec.java:157)
at ghidra.app.plugin.processors.sleigh.SleighLanguage.getCompilerSpecByID(SleighLanguage.java:1143)
at ghidra.app.util.opinion.BinaryLoader.loadProgram(BinaryLoader.java:278)
at ghidra.app.util.opinion.AbstractProgramLoader.load(AbstractProgramLoader.java:112)
at ghidra.plugin.importer.ImporterUtilities.importSingleFile(ImporterUtilities.java:404)
at ghidra.plugin.importer.ImporterDialog.lambda$okCallback$7(ImporterDialog.java:350)
at ghidra.util.task.TaskBuilder$TaskBuilderTask.run(TaskBuilder.java:306)
at ghidra.util.task.Task.monitoredRun(Task.java:126)
at ghidra.util.task.TaskRunner.lambda$startTaskThread$0(TaskRunner.java:106)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: ghidra.xml.XmlParseException: tags within a group must be distinguished by size or type
at ghidra.program.model.lang.ParamEntry.orderWithinGroup(ParamEntry.java:617)
at ghidra.program.model.lang.ParamListStandardOut.restoreXml(ParamListStandardOut.java:82)
at ghidra.program.model.lang.PrototypeModel.restoreXml(PrototypeModel.java:559)
at ghidra.program.model.lang.BasicCompilerSpec.addPrototypeModel(BasicCompilerSpec.java:1030)
at ghidra.program.model.lang.BasicCompilerSpec.restoreXml(BasicCompilerSpec.java:636)
at ghidra.program.model.lang.BasicCompilerSpec.initialize(BasicCompilerSpec.java:249)
at ghidra.program.model.lang.BasicCompilerSpec.(BasicCompilerSpec.java:135)
... 11 more
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.