Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary import fails with exception - <pentry> tags #7

Open
iankahan opened this issue Nov 21, 2021 · 3 comments
Open

Binary import fails with exception - <pentry> tags #7

iankahan opened this issue Nov 21, 2021 · 3 comments

Comments

@iankahan
Copy link

Thank you very much for this project and the i960 processor for Ghidra!
I was trying to import a firmware binary to analyse (firmware bin file, using an 0xe0000100 offset via options), however the import fails with below error message.
Have you come across this?

Exception reading i960:LE:32:default/default(i960.cspec): <pentry> tags within a group must be distinguished by size or type ghidra.program.model.lang.CompilerSpecNotFoundException: Exception reading i960:LE:32:default/default(i960.cspec): <pentry> tags within a group must be distinguished by size or type at ghidra.program.model.lang.BasicCompilerSpec.<init>(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:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833)

@iankahan
Copy link
Author

Update to this issue and providing more data points:

  1. The error above happens with Ghidra 10.1-Beta
  2. There is NO error with Ghidra 10.0.4

Looking at the Ghidra source code, the processing logic and code for .cspec has changed.
[Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/ParamEntry.java]
In particular code for parsing .cspec has been added to new function
public static void orderWithinGroup(ParamEntry entry1, ParamEntry entry2)
that throws the reported error on any two consequtive that are of similar size and don't distinguish in type.
I cannot follow the idea or logic behind as this prevents predefined options. But probably it is what it is.

So this issue is a probable issue for an upcoming Ghidra release. And I confirm no issue with the latest non-beta

@mumbel
Copy link
Owner

mumbel commented Nov 21, 2021

I did come across cspec issues on another module I work on and reported that, which was fixed. Didn't think to double check this one, thanks for letting me know. Shouldn't be too hard to fix.

@mumbel
Copy link
Owner

mumbel commented Nov 21, 2021

3500034 should fix. there were a few other changes I had locally as well, so hopefully nothing broke too bad (I'm stil having issues figuring out how to make sp+fp play nice with ghidra)

@iankahan iankahan changed the title Binary import fails with exception - <pantry> tags Binary import fails with exception - <pentry> tags Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants