GhidraDev README

GhidraDev README

GhidraDev provides support for developing and debugging Ghidra scripts and modules in Eclipse.

The information provided in this document is effective as of GhidraDev 2.1.4 and is subject to change with future releases.

Change History

2.1.4: Fixed exception that occurred when performing a "Link Ghidra" on projects that use a Gradle classpath container.

2.1.3: Fixed a bug that prevented Ghidra projects from recognizing extensions installed in the user's ~/.ghidra/.ghidra_<version>/Extensions directory.

2.1.2: Fixed exception that occurred when creating a new Ghidra scripting project if a ~/ghidra_scripts directory does not exist.

2.1.1:

2.1.0:

2.0.1: Fixed exception that occurred when performing certain actions on a Ghidra project that was imported from a previously exported Archive File.

2.0.0:

1.0.2: Fixed exception that occurred when performing a "Link Ghidra" on projects that specify other projects on their build paths.

1.0.1: Initial Release.

Minimum Requirements

(Back to Top)

Optional Requirements

(Back to Top)

Installing GhidraDev

GhidraDev can be installed either manually into Eclipse or automatically by Ghidra, depending on your uses cases. The following two sections outline both procedures.

Manual Installation in Eclipse

GhidraDev can be installed into an existing installation of Eclipse the same way most Eclipse plugins are installed. From Eclipse:

  1. Click Help → Install New Software...
  2. Click Add...
  3. Click Archive...
  4. Select GhidraDev zip file from <GhidraInstallDir>/Extensions/Eclipse/GhidraDev/
  5. Click OK (name field can be blank)
  6. Check Ghidra category (or GhidraDev entry)
  7. Click Next
  8. Click Next
  9. Accept the terms of the license agreement
  10. Click Finish
  11. Click Install anyway
  12. Click Restart Now

Automatic Installation through Ghidra

Ghidra 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.

(Back to Top)

Features

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".

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...

(Back to Top)

Launching and Debugging 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:

There are two ways to create Ghidra run configurations:

  1. Click Run → Run Configurations...
  2. Right-click on Ghidra (or Ghidra Headless), and click New
  3. In the Main tab, click Browse... and select the Ghidra project to launch
  4. Optionally rename the new run configuration by editing the Name field at the top

Alternatively, 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.

(Back to Top)

PyDev Support

GhidraDev is able to integrate with PyDev to conveniently configure Python support into Ghidra script and module projects.

Installing PyDev

From Eclipse:

  1. Download PyDev (see optional requirements for supported versions)
  2. Unzip PyDev
  3. Click Help → Install New Software...
  4. Click Add...
  5. Click Local...
  6. Select unzipped PyDev directory
  7. Click OK (name field can be blank)
  8. Uncheck Group items by category (if applicable)
  9. Check PyDev for Eclipse
  10. Click Next
  11. Click Next
  12. Accept the terms of the license agreement
  13. Click Finish
  14. Click Restart Now

Configuring PyDev

GhidraDev can add Python support to a Ghidra project when:

In order for GhidraDev to add in Python support, PyDev must have a Jython interpreter configured. GhidraDev will present a list of detected Jython interpreters that it found in PyDev's preferences. If no Jython interpreters were found, one can be added from GhidraDev by clicking the + icon. When the + 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.

(Back to Top)

Upgrading

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 GhidraDev section.

(Back to Top)

Uninstalling

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:

  1. Click Help → About Eclipse
  2. Click Installation Details
  3. Select GhidraDev
  4. Click Uninstall...
  5. Select GhidraDev
  6. Click Finish
  7. Click Restart Now

If 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.

(Back to Top)

Frequently Asked Questions

(Back to Top)

Additional Resources

For more information on the GhidraDev plugin and developing for Ghidra in an Eclipse environment, please see:

(Back to Top)