Metadata-Version: 2.4
Name: pyghidra-decaf
Version: 0.3.1
Summary: Enables plugins for Ghidra implemented in python.
Project-URL: Homepage, https://github.com/nightwing-us/pyghidra-decaf
Project-URL: Repository, https://github.com/nightwing-us/pyghidra-decaf
Project-URL: Bug Tracker, https://github.com/nightwing-us/pyghidra-decaf/issues
Author-email: Eric Lin <17968842+anselor@users.noreply.github.com>
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: pydantic
Requires-Dist: pyghidra
Requires-Dist: setuptools
Provides-Extra: dev
Requires-Dist: ghidra-stubs; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.0.270; extra == 'dev'
Provides-Extra: pyhidra
Requires-Dist: pyhidra; extra == 'pyhidra'
Description-Content-Type: text/markdown

# PyGhidra Decaf

Java-free Python plugin loading for Ghidra

Enables pure Python Ghidra plugins to be implemented by handling the boilerplate JPype glue code to connect the Java and Python side plugin implementations.

## Prerequisites

- **Ghidra 11.0+** with PyGhidra installed (PyGhidra is included in the Ghidra distribution by default)
- **Python 3.10+**

## Installation

1. Activate (or create) the venv that will be used to run ghidra
2. Install `pyghidra_decaf` (`pip install pyghidra_decaf`)
3. Run ghidra `pyghidra --gui --install-dir /path/to/ghidra/install` (for example ~/ghidra/ghidra_11_3_2_PUBLIC)
4. You'll be prompted to enable a new plugin, confirm that. If not, open File -> Install Extensions and enable "Pyghidra Decaf"

# Installing Decaf plugins

1. Activate the venv you previously set up with pyghidra_decaf
2. Install the python module for the Decaf plugin (e.g. `pip install <your-decaf-plugin>`)
3. Run ghidra `pyghidra --gui --install-dir /path/to/ghidra/install` (for example ~/ghidra/ghidra_11_3_2_PUBLIC)
4. You'll be prompted to enable a new plugin, confirm that. If not, open File -> Install Extensions and enable "Pyghidra Decaf"

## Troubleshooting

**Plugin doesn't appear in Ghidra after installation**
- Verify you're using **Ghidra 11.0 or later**. Older versions may not have PyGhidra bundled.
- Rerun `pyghidra --gui --install-dir /path/to/ghidra/install` to trigger the bootstrap process.
- Check that extension files were created: `ls -la ~/.config/ghidra/*/Extensions/`

**ImportError: jpype not found**
- Ensure you're using the same Python virtual environment that Ghidra runs from. PyGhidra bundles JPype, but it must be loaded in the same venv context.
- Verify venv activation: `which python` should point to your plugin venv, not system Python.

**Java class not found: myplugin.plugin.MyPlugin**
- Verify the `decaf.load` entry point name matches your actual plugin class name.
- The fully qualified name in the error message must match the first element of the tuple returned by your `decaf_load()` function.

For more detailed help, see the [Plugin Development Guide](docs/index.md) and [Architecture Guide](docs/gap-analysis-ghidra-pyghidra-decaf.md) in the main repository.
