GhidraDev provides support for developing and debugging Ghidra scripts and modules in Eclipse.
The information provided in this document is effective as of GhidraDev 5.0.1 and is subject to change with future releases.
5.0.1:
5.0.0:
4.0.1:
README.md file.4.0.0:
GhidraHelpService exception when launching
Ghidra. GhidraDev now properly enforces that Ghidra is only launched with Utility.jar on the
initial classpath.3.1.0:
build directory is detected. Presence of
this intermediate build artifact can cause Ghidra to have runtime/debugging issues.3.0.2:
Link Ghidra action on a Ghidra
project whose original Ghidra installation moved.3.0.1:
build directory within the
project. This build directory now gets automatically cleaned up to avoid Ghidra
runtime/debugging issues.3.0.0:
Link Ghidra.2.1.5:
2.1.4:
Link Ghidra on projects that use a Gradle
classpath container.2.1.3:
~/.ghidra/.ghidra_<version>/Extensions directory.2.1.2:
~/ghidra_scripts
directory does not exist.2.1.1:
dropins directory.2.1.0:
Environments tab to the Ghidra run configuration for setting environment variables
when launching Ghidra.2.0.1:
2.0.0:
1.0.2:
Link Ghidra on projects that specify other
projects on their build paths.1.0.1:
GhidraDev can be installed either manually into Eclipse or automatically by Ghidra, depending on your uses cases. The following sections outline the different procedures.
GhidraDev can be installed into an existing installation of Eclipse the same way most Eclipse plugins are installed. From Eclipse:
Help -> Install New Software...Add...Archive...<GhidraInstallDir>/Extensions/Eclipse/GhidraDev/OK (name field can be blank)Ghidra category (or GhidraDev entry)NextNextFinishUnsigned table entryTrust SelectedRestart NowIf you have an Internet connection, the latest GhidraDev can be installed by adding the official update site to an existing installation of Eclipse. This has the benefit of early access to new GhidraDev versions before the next version of Ghidra is released, and automatic updates (if you have updates enabled in Eclipse). From Eclipse:
Help -> Install New Software...https://github.com/NationalSecurityAgency/ghidra-data/raw/main/Eclipse/GhidraDev/latestEnterGhidra category (or GhidraDev entry)NextNextFinishUnsigned table entryTrust SelectedRestart NowGhidra has the ability to launch an externally linked Eclipse when certain actions are performed,
such as choosing to edit a Ghidra script by clicking the Eclipse icon in the Ghidra Script Manager.
Ghidra requires knowledge of where Eclipse is installed before it can launch it, and will prompt the
user to enter this information if it has not been defined. Before Ghidra attempts to launch
Eclipse, it will attempt to install GhidraDev into Eclipse's dropins directory if GhidraDev
is not already installed.
GhidraDev provides a variety of features for creating and interacting with Ghidra-related projects in Eclipse. GhidraDev supports creating both Ghidra script and Ghidra module projects. Ghidra scripts are typically designed as a single Java source file that is compiled by Ghidra at runtime and run through Ghidra's Script Manager or passed to the Headless Analyzer on the command line for execution. Ghidra modules are intended to represent larger, more complex features such as Analyzers or Plugins. When Ghidra modules are ready for production, they can be exported and installed into Ghidra as an "extension".
Opens a wizard that creates a new Ghidra script with the provided metadata in the specified location. Ghidra scripts can be created in both Ghidra script and Ghidra module projects.
Opens a wizard that creates a new Ghidra scripting project that is linked
against a specified Ghidra installation. The project can be set up to develop scripts in both the
user's home ghidra_scripts directory, as well as any scripts found in the Ghidra installation.
Opens a wizard that creates a new Ghidra module project that is linked against a specified Ghidra installation. The project can be initialized with optional template source files that provide a good starting point for implementing advanced Ghidra features such as Analyzers, Plugins, Loaders, etc.
Opens a wizard that imports a Ghidra module source directory as a new Ghidra module project.
Opens a wizard that exports a Ghidra module project as a Ghidra extension to the project's dist
folder. The exported extension archive file can be distributed to other users and imported via
Ghidra's front-end GUI. The export process requires Gradle, which is configured in the wizard. Note
that the Gradle version to use is specified in the linked Ghidra release's
<GhidraInstallDir>/Ghidra/application.properties file.
Links a Ghidra installation to an existing Java project, which enables Ghidra script/module development for the project. If a Ghidra installation is already linked to the project when this operation is performed, the project will be relinked to the specified Ghidra installation, which can be used to build the project for a different version of Ghidra, discover new Ghidra extensions that were later added to a Ghidra installation, or repair a corrupted project.
Eclipse Integration tool options. Disable this preference to
prevent GhidraDev from listening on a port for this feature.Eclipse Integration tool options. Disable
this preference to prevent GhidraDev from listening on a port for this feature. Symbol lookup
requires the Eclipse CDT plugin to be installed
(see optional requirements for supported versions).Most GhidraDev features can also be accessed by right-clicking on appropriate project elements in
Eclipse's Project/Package Explorer. For example, the Link Ghidra feature can be
accessed by right-clicking on an existing Java project, and then clicking
Ghidra -> Link Ghidra....
GhidraDev introduces two new run configurations to Eclipse which are capable of launching the installation of Ghidra that an Eclipse Ghidra project is linked to:
Ghidra Headless run configurations
will have to be modified with the desired headless program arguments. For more information on
headless command line arguments, see <GhidraInstallDir>/support/analyzeHeadlessREADME.html.There are two ways to create Ghidra run configurations:
Run -> Run Configurations...Ghidra (or Ghidra Headless), and click NewMain tab, click Browse... and select the Ghidra project to launchName field at the topAlternatively, you can right-click on any Ghidra project in the Eclipse package explorer, and then
click Run As -> Ghidra.
To debug Ghidra, click Debug As -> Ghidra. GhidraDev will automatically switch Eclipse to the
debug perspective.
NOTE: Ghidra can only be launched/debugged from an existing Eclipse Ghidra project. Launching Ghidra from Eclipse independent of a project is not supported.
GhidraDev is able to integrate with PyDev to conveniently configure Python support into Ghidra script and module projects. GhidraDev supports both Jython and PyGhidra Python implementations.
NOTE: PyDev discontinued Jython 2 support in version 10.0.0. If you want to use GhidraDev with Jython, you must use PyDev 9.3.0. The latest vesions of PyDev support PyGhidra.
From Eclipse:
Help -> Install New Software...Add...Local...OK (name field can be blank)Group items by category (if applicable)PyDev for EclipseNextNextFinishRestart NowGhidraDev can add Python support to a Ghidra project when:
In order for GhidraDev to add in Python support, PyDev must have a PyGhidra or Jython interpreter
configured. GhidraDev will present a list of detected PyGhidra/Jython interpreters that it found in
PyDev's preferences. If no interpreters were found, one can be added from GhidraDev by clicking
the + icons.
When the Jython + icon is clicked, GhidraDev will attempt to find the Jython interpreter bundled
with the selected Ghidra installation and automatically configure PyDev to use it. If for some
reason GhidraDev was unable to find a Jython interpreter in the Ghidra installation, one will have
to be added manually in the PyDev preferences.
When the PyGhidra + icon is clicked, GhidraDev will attempt to find the PyGhidra interpreter
that was last used to launch PyGhidra. If it cannot find it, you will have to launch PyGhidra
and try again.
GhidraDev is upgraded differently depending on how it was installed. If GhidraDev was manually installed in Eclipse, it can be upgraded the same was it was installed.
If GhidraDev was automatically installed through Ghidra,
it can be upgraded by simply removing the GhidraDev file from Eclipse's dropins directory before
following one of the two techniques described in the Installing section.
GhidraDev is uninstalled differently depending on how it was installed. If GhidraDev was manually installed in Eclipse, it can be uninstalled as follows from Eclipse:
Help -> About Eclipse
Eclipse -> About EclipseInstallation DetailsGhidraDevUninstall...GhidraDevFinishRestart NowIf GhidraDev was automatically installed through Ghidra,
it can be uninstalled by simply removing the GhidraDev file from Eclipse's dropins directory and
restarting Eclipse. The dropins directory can be found at the top level of Eclipse's
installation directory.
~/ghidra_scripts directory because
Ghidra will automatically find them there without any additional configuration. By default,
your Ghidra script project will have a folder named Home scripts which is linked to your
home ~/ghidra_scripts directory. Either right-click on this folder in Eclipse and do
GhidraDev -> New -> GhidraScript... or from the menu bar do GhidraDev -> New -> GhidraScript... and populate the Script folder box with your project's Home scripts
folder.For more information on the GhidraDev plugin and developing for Ghidra in an Eclipse environment,
please see the Ghidra Scripting slide deck
at <GhidraInstallDir>/docs/GhidraClass/Intermediate/Scripting.html.
GhidraDev is currently built from Eclipse and distributed with Ghidra manually. Ideally we will use Gradle one day, but we aren't there yet. We do rely on Gradle to generate the Eclipse project and build GhidraDev's dependencies though.
NOTE: Only "Eclipse for RCP and RAP Developers" has the ability to do the below instructions. The following instructions assume that you are using this version of Eclipse.
gradle prepGhidraDev eclipse -PeclipsePDEFile -> Import -> General -> Existing Projects into WorkspaceEclipse GhidraDevFeature and Eclipse GhidraDevPluginplugin.xml in the GhidraDevPlugin projectOverview tab, update the Version field to x.y.z.qualifier and savefeature.xmlin the GhidraDevFeature projectOverview tab, update the Version field to x.y.z.qualifier and savecategory.xml in the GhidraDevFeature projectghidra.ghidradev (x.y.z.qualifier), and click Removeghidra.ghidradev and click Add Featureghidra.ghidradev (x.y.z.qualifer), click OK, and savegradle prepDev to ensure GhidraDev's dependencies are up-to-dateFile -> Export -> Plug-in Development -> Deployable featuresghidra.ghidradev (x.y.z.qualifier)Archive file and choose a directory to save it to. Name it GhidraDev-x.y.z.zip.Options tab make sure things look like this: