support Ghidra v12

This commit is contained in:
Mike Hunhoff
2025-12-10 19:58:21 +00:00
parent 3687bb95e9
commit 98873c8570
4 changed files with 7 additions and 6 deletions

View File

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

View File

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

View File

@@ -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:

View File

@@ -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")