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

Consider using JNI/JNA for Decompiler, Sleigh and PDB? #175

Closed
dazzleworth opened this issue Mar 12, 2019 · 2 comments
Closed

Consider using JNI/JNA for Decompiler, Sleigh and PDB? #175

dazzleworth opened this issue Mar 12, 2019 · 2 comments
Assignees
Labels
Type: Question Further information is requested

Comments

@dazzleworth
Copy link

dazzleworth commented Mar 12, 2019

Requires less resources than invoking an executable

ghidra_9.0/Ghidra/Features/Decompiler/os/win64/decompile.exe ghidra_9.0/Ghidra/Features/Decompiler/os/win64/sleigh.exe ghidra_9.0/Ghidra/Features/PDB/os/win64/pdb.exe

@dazzleworth dazzleworth added the Type: Question Further information is requested label Mar 12, 2019
@saruman9
Copy link
Contributor

From $GHIDRA_DIR/docs/GhidraClass/AdvancedDevelopment/GhidraAdvancedDevelopment.html:

  • NEVER EVER USE JNI!
    • Communicate with a native process using sockets, I/O stream, etc.

@ryanmkurtz ryanmkurtz self-assigned this Mar 12, 2019
@ryanmkurtz
Copy link
Collaborator

We advise against using JNI when developing extensions for a couple of reasons. First, if there is a problem in an extension's native code, we don't want it to bring down the entire Ghidra process. Second, Ghidra discovers extensions at runtime and adds them to the classpath, but it cannot add native libraries to the process's library search path at runtime for all supported platforms. That would require a custom launch script which would be tough to distribute generically.

The decompiler and other native executables also benefit from the process isolation I mentioned above, at hopefully a lost cost in resources on modern hardware. Also, it might be worth noting that the sleigh executable can be run standalone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants