Ziemas / ghidra_irx

Ghidra analyzer for finding imports in PS2 IRX modules.
Apache License 2.0
7 stars 1 forks source link

Crash while analyzing #10

Open kynex7510 opened 2 weeks ago

kynex7510 commented 2 weeks ago

This plugin crashes while analyzing the CDVDMAN module with the following error:

Index 1 out of bounds for length 1
java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
    at ghidra_irx.ModuleDB.<init>(ModuleDB.java:26)
    at ghidra_irx.ghidra_irxAnalyzer.added(ghidra_irxAnalyzer.java:72)
    at ghidra.app.plugin.core.analysis.AnalysisScheduler.runAnalyzer(AnalysisScheduler.java:186)
    at ghidra.app.plugin.core.analysis.AnalysisTask.applyTo(AnalysisTask.java:39)
    at ghidra.app.plugin.core.analysis.AutoAnalysisManager$AnalysisTaskWrapper.run(AutoAnalysisManager.java:686)
    at ghidra.app.plugin.core.analysis.AutoAnalysisManager.startAnalysis(AutoAnalysisManager.java:786)
    at ghidra.app.plugin.core.analysis.AutoAnalysisManager.startAnalysis(AutoAnalysisManager.java:665)
    at ghidra.app.plugin.core.analysis.AutoAnalysisManager.startAnalysis(AutoAnalysisManager.java:630)
    at ghidra.app.plugin.core.analysis.AnalysisBackgroundCommand.applyTo(AnalysisBackgroundCommand.java:58)
    at ghidra.framework.plugintool.mgr.BackgroundCommandTask.run(BackgroundCommandTask.java:103)
    at ghidra.framework.plugintool.mgr.ToolTaskManager.run(ToolTaskManager.java:334)
    at java.base/java.lang.Thread.run(Thread.java:840)
kynex7510 commented 2 weeks ago

fwiw the problem seems like the module.list file is malformed (use of spaces and pseudo comments), removing the bad lines works fine

Ziemas commented 1 week ago

Oh, right. I forgot that the parsing is probably very dumb and didn't test myself the last time I got PR. I don't currently have a ghidra development environment set up (and iirc it was a huge pain), so maybe modifying the data instead of fixing the parser is the easiest option.