In an effort to learn more about Haiku and Ghidra, I’ve created a Haiku port. It’s now usable, so I’ve uploaded my code to Github and provided a binary release.
Ghidra is an open-source software reverse engineering framework written in Java. The project needed tweaks to make the build environment and project aware of Haiku, and to edit the C-based decompiler to compile on Haiku.
Dependency: OpenJDK 11.
Known issue: It can’t analyze Haiku ELF files, since it seems to think they’re iOS apps, and this makes Ghidra crash and burn. But I was able to test it out with OSX, Linux, and Windows executables to ensure it works. There are probably other bugs in there too, let me know if you find any.
How do I add a screenshot to be shown when looking at the package with HaikuDepot?
How is the integration with Java and Haiku? I’m thinking of writing a launcher which would appear in the applications menu, and how the Ghidra name and logo in the application list, instead of just “java”. I’ve done some Java programming with C++, but not much, and I’m not sure how well OpenJDK & Java work together.
Some outstanding issues:
Data/config resides under the Unix/Linux default of $HOME/.ghdira, instead of /boot/home/config/settings/ghidra
The package doesn’t inform the package manager of the apps data files, nor now to handle them when updating.
Nothing has been done for handling installing a new version, I’d want data files to be kept, and multiple versions of Ghidra would not be allowed at the same time (doesn’t make sense to me)
Make a launcher so the user doesn’t need the Terminal to start the program, make the Java program feel more native.
I still have yet to learn about HaikuPorter, but in the meantime, Ghidra 10.1.1 is available for Haiku. Both native packages and a Zip are available. Luckily, this version also cleans up some code, which makes way for more operating system - arch support, so it wouldn’t be too hard to add RISC-V support once the support is in place.
I did start writing a C program https://github.com/rjzak/ghidra/tree/ghidra_haiku_launcher, and it compiles but doesn’t run (seems to not find the ghidra launcher function). Part of the issue is that Ghidra is (mostly) Java, and getting JNI to work is painful. Another option is a plain program which just launches the Java code and returns, but that feels cheap.
As for the screenshot appearing in HaikuDepot, how does that website have anything to do with adding the screenshot? It seems that, at best, a logged-in user can rate applications.
Not everyone can add icons, screenshots, translations at the HaikuDepot Server website. You need certain permissions. A small number of people have those and usually we manage to add those things to the new and updated packages in short time.
People can save me the work of installing and capturing informative screenshots by PMing me a few shots (and the (HVIF) icon).
I like how this example shows how to set an icon for the shell script, very cool.
Unfortunately, Ghidra is a bit of a monster, with various directories and subdirectories of .java files all over, and the occasional native binary. It already has a shell script launcher, but I wanted something nicer.