From 98873c857045d312993b971dc106119cfa636455 Mon Sep 17 00:00:00 2001 From: Mike Hunhoff Date: Wed, 10 Dec 2025 19:58:21 +0000 Subject: [PATCH] support Ghidra v12 --- .github/workflows/tests.yml | 4 ++-- capa/ghidra/README.md | 2 +- capa/ghidra/helpers.py | 4 ++-- tests/test_ghidra_features.py | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9e3d4394..d51fc9bd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -173,8 +173,8 @@ jobs: matrix: python-version: ["3.10", "3.13"] java-version: ["21"] - ghidra-version: ["11.4"] - public-version: ["PUBLIC_20250620"] # for ghidra releases + ghidra-version: ["12.0"] + public-version: ["PUBLIC_20251205"] # for ghidra releases steps: - name: Checkout capa with submodules uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 diff --git a/capa/ghidra/README.md b/capa/ghidra/README.md index eb691d13..4f6035ad 100644 --- a/capa/ghidra/README.md +++ b/capa/ghidra/README.md @@ -8,7 +8,7 @@ ## Prerequisites -- Ghidra >= 11.4 must be installed and available to PyGhidra (e.g. set `GHIDRA_INSTALL_DIR` environment variable) +- Ghidra >= 12.0 must be installed and available to PyGhidra (e.g. set `GHIDRA_INSTALL_DIR` environment variable) ## Usage diff --git a/capa/ghidra/helpers.py b/capa/ghidra/helpers.py index 613f54cd..31145de3 100644 --- a/capa/ghidra/helpers.py +++ b/capa/ghidra/helpers.py @@ -90,11 +90,11 @@ def is_supported_ghidra_version(): try: # version format example: "11.1.2" or "11.4" major, minor = map(int, version.split(".")[:2]) - if major < 11 or (major == 11 and minor < 4): + if major < 12: logger.error("-" * 80) logger.error(" Ghidra version %s is not supported.", version) logger.error(" ") - logger.error(" capa requires Ghidra 11.4 or higher.") + logger.error(" capa requires Ghidra 12.0 or higher.") logger.error("-" * 80) return False except ValueError: diff --git a/tests/test_ghidra_features.py b/tests/test_ghidra_features.py index fc1ae7bd..ec902856 100644 --- a/tests/test_ghidra_features.py +++ b/tests/test_ghidra_features.py @@ -12,13 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. import importlib.util +import os import pytest import fixtures import capa.features.common -ghidra_present = importlib.util.find_spec("pyghidra") is not None +ghidra_present = importlib.util.find_spec("pyghidra") is not None and "GHIDRA_INSTALL_DIR" in os.environ @pytest.mark.skipif(ghidra_present is False, reason="PyGhidra not installed")