I would like to access an SQLite database from within a Java Ghidra script. However, if I include the line import java.sql.*;
in the script, Ghidra gives the error > Unable to locate script class:
. If I understand correctly, only certain Java libraries are available within Ghidra, so is there an SQL library available?
1 Answer
It doesn't look like Ghidra ships with any kind of SQLite library by default, but since Ghidra (I think) 9.2 you can import OSGI compatible .jar files in your scripts. Supposedly the official SQLite Jar is OSGI compatible already.
The details are explained in the Ghidra Help documents, so for the pretty HTML view: F1
in Ghidra, Ghidra Functionality
, Scripting
, Ghidra Bundles
or read the document on some mirror like https://fossies.org/linux/ghidra/Ghidra/Features/Base/src/main/help/help/topics/BundleManager/BundleManager.htm