Adubbz / Ghidra-Switch-Loader

Nintendo Switch loader for Ghidra
ISC License
278 stars 41 forks source link

Throws error when importing BOTW or Celeste #25

Closed Torphedo closed 3 years ago

Torphedo commented 3 years ago

Whenever I try to import the main NSO file of BOTW or Celeste dumped from my Switch, Ghidra throws an error. I've made sure that I have the lastest version of the JRE and JDK. I'm using Ghidra 9.1, with the extension for that version. Here's the error it gives:

java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer
    at generic.continues.ContinuesFactory.create(ContinuesFactory.java:61)
    at ghidra.app.util.bin.format.macho.MachHeader.createMachHeader(MachHeader.java:73)
    at ghidra.app.util.bin.format.macho.MachHeader.createMachHeader(MachHeader.java:61)
    at ghidra.app.util.opinion.MachoPrelinkUtils.parsePrelinkXml(MachoPrelinkUtils.java:56)
    at ghidra.file.formats.ios.prelink.PrelinkFileSystem.isValid(PrelinkFileSystem.java:79)
    at ghidra.formats.gfilesystem.factory.GFileSystemBaseFactory.probe(GFileSystemBaseFactory.java:66)
    at ghidra.formats.gfilesystem.factory.FileSystemFactoryMgr.test(FileSystemFactoryMgr.java:233)
    at ghidra.formats.gfilesystem.FileSystemService.isFileFilesystemContainer(FileSystemService.java:553)
    at ghidra.plugin.importer.ImporterUtilities.showImportDialog(ImporterUtilities.java:172)
    at ghidra.plugin.importer.ImporterUtilities.lambda$showImportDialog$0(ImporterUtilities.java:138)
    at ghidra.util.task.TaskLauncher$2.run(TaskLauncher.java:119)
    at ghidra.util.task.Task.monitoredRun(Task.java:126)
    at ghidra.util.task.TaskRunner.lambda$startTaskThread$1(TaskRunner.java:94)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
    at java.base/java.lang.Thread.run(Thread.java:831)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer
    at generic.continues.ContinuesFactory.create(ContinuesFactory.java:45)
    ... 15 more

---------------------------------------------------
Build Date: 2019-Oct-23 1737 EDT
Ghidra Version: 9.1
Java Home: C:\Program Files\Java\jdk-16.0.1
JVM Version: Oracle Corporation 16.0.1
OS: Windows 10 10.0 amd64
Workstation: 192.168.1.215
Torphedo commented 3 years ago

https://user-images.githubusercontent.com/73564623/127783126-c60f7cfc-87b2-4166-b292-f6d392fdb465.mp4

As you can see, it doesn't even get to the point where it asks for the language.

masagrator commented 3 years ago

You are using release version or compiled it yourself? Because repo is now not supporting older Ghidra versions (below 9.2.2) because of API changes. So even if issue is true, it probably won't be taken into account as you are using obsolete version.

Torphedo commented 3 years ago

You are using release version or compiled it yourself? Because repo is now not supporting older Ghidra versions (below 9.2.2) because of API changes. So even if issue is true, it probably won't be taken into account as you are using obsolete version.

I used this release file, I'll go try building from source. Thanks!

Torphedo commented 3 years ago

I hate to be that guy, but I can't seem to build it. I've got my JAVA_HOME variable set up, as well as my GHIDRA_INSTALL_DIR. ./gradlew doesn't get recognized as a command, and running gradlew.bat build in the repo's folder throws this error:

Script 'E:\Emulation\BOTW\Tools\ghidra_9.1_PUBLIC\support\buildExtension.gradle' line: 31

* What went wrong:
A problem occurred evaluating script.
> Could not find method compile() for arguments [directory 'lib'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

I'm probably doing something simple wrong, but I don't have enough experience with Java to figure out exactly what that is.

Torphedo commented 3 years ago

Update: turns out Ghidra was using JDK 16, not 11. Fixed now.