Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Cannot compile Loader #3

Open
DLDrago opened this issue Oct 24, 2020 · 13 comments
Open

Cannot compile Loader #3

DLDrago opened this issue Oct 24, 2020 · 13 comments

Comments

@DLDrago
Copy link

DLDrago commented Oct 24, 2020

I'm having problems compiling the SNES Loader. It says it can't find or load the main class. (org.gradle.wrapper.GradleWrapperMain"

@achan1989
Copy link
Owner

achan1989 commented Oct 29, 2020

Oops, I missing checking in the Gradle .jar file. Update and try again.

In the current state I believe master will build for Ghidra version 9.0.4 and earlier, but not version 9.1.x
Pull request #1 updates the code for version 9.1.2 -- you should be able to apply that branch on top of master (delete the .classpath and .project files when they conflict).

Never mind that, I've accepted that pull request now. It should just build now, but let me know if it's still no good.

@DLDrago
Copy link
Author

DLDrago commented Oct 29, 2020

Now I get this error:

> Task :compileJava FAILED
D:\Downloads\ghidra-snes-loader-master\SnesLoader\src\main\java\snesloader\HiRomLoader.java:5: error: cannot access Option
import ghidra.app.util.Option;
                      ^
  bad class file: D:\Ghidra\Ghidra\Features\Base\lib\Base.jar(ghidra/app/util/Option.class)
    class file has wrong version 55.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

@achan1989
Copy link
Owner

What version of Ghidra are you using?

@DLDrago
Copy link
Author

DLDrago commented Oct 29, 2020 via email

@achan1989
Copy link
Owner

Are you doing the plain command-line build, or trying to use Eclipse?
If I do a clean checkout and do a plain command-line build with Ghidra 9.1.2 on Linux it just works.

@DLDrago
Copy link
Author

DLDrago commented Oct 29, 2020

I've tried both the Powershell and Command Prompt on Windows 10.

@achan1989
Copy link
Owner

Based on this I wonder if the build is using the wrong version of Java. The Ghidra installation guide says it requires Java 11.

If you run gradlew.bat -v it will tell you which version of the JVM it is using. I'd imagine that any 11.x is ok (mine says 11.0.9).

@DLDrago
Copy link
Author

DLDrago commented Oct 29, 2020

I can't compile it. Do you mind making a release file?

@achan1989
Copy link
Owner

I'll give it a go; tomorrow or over the weekend.

@DLDrago
Copy link
Author

DLDrago commented Oct 29, 2020 via email

@DLDrago
Copy link
Author

DLDrago commented Oct 31, 2020

I got it to compile by leaving the quotes off the Ghidra directory. Now Ghidra says it supports SNES ROMs, but every one I open only seems to allow Raw Binary. Is there something I'm doing wrong?

@achan1989
Copy link
Owner

It's a two part setup.

First, make sure the SNES loader extension is installed. Once you've built it, there should be a file in the SnesLoader/dist directory. Copy the ghidra_9.1.2_PUBLIC_20201029_SnesLoader.zip file into <ghidra-install-dir>/Extensions/Ghidra, then run Ghidra and activate the extension via File --> Install Extensions...

Second, you also need to install the 65816 processor module. Code and installations instructions are in https://github.com/achan1989/ghidra-65816

Then restart Ghidra. If everything is set up ok, you should see "SNES ROM" as an available format when you try to import a ROM. Then set the language (65816 should be the only option) and you should be good to go.

I'll warn you that these tools are not polished, and will probably not do what you want them to out of the box. The processor module is kinda ok, but has problems with switching processor modes automatically. The loader is hard coded for one specific ROM format (possibly for one specific game), and I can't remember if that's even correct and complete. Be prepared to change the loader code.

@DLDrago
Copy link
Author

DLDrago commented Nov 1, 2020 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants