feat: upgrade to Ghidra 11.4.2 with improved transaction handling
Some checks failed
Build Ghidra Plugin / build (push) Has been cancelled

- Update all Ghidra JAR dependencies to 11.4.2
- Improve TransactionHelper to properly handle endTransaction return value
- Add GHIDRA_HOME environment variable support for flexible builds
- Update version references in extension.properties and MANIFEST.MF

The transaction fix now checks the return value from endTransaction() and
properly reports transaction failures, providing better error handling for
Ghidra 11.3.2+ compatibility.

Refs #7
This commit is contained in:
Teal Bauer 2025-11-11 13:01:47 +01:00
parent bc1e137878
commit 3222cf9866
11 changed files with 49 additions and 19 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

57
pom.xml
View File

@ -13,7 +13,14 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<ghidra.jar.location>${project.basedir}/lib</ghidra.jar.location>
<!-- Default paths to local lib - will be overridden if GHIDRA_HOME is set -->
<ghidra.generic.jar>${project.basedir}/lib/Generic.jar</ghidra.generic.jar>
<ghidra.softwaremodeling.jar>${project.basedir}/lib/SoftwareModeling.jar</ghidra.softwaremodeling.jar>
<ghidra.project.jar>${project.basedir}/lib/Project.jar</ghidra.project.jar>
<ghidra.docking.jar>${project.basedir}/lib/Docking.jar</ghidra.docking.jar>
<ghidra.decompiler.jar>${project.basedir}/lib/Decompiler.jar</ghidra.decompiler.jar>
<ghidra.utility.jar>${project.basedir}/lib/Utility.jar</ghidra.utility.jar>
<ghidra.base.jar>${project.basedir}/lib/Base.jar</ghidra.base.jar>
<maven.deploy.skip>true</maven.deploy.skip>
<maven.install.skip>true</maven.install.skip>
<maven.build.timestamp.format>yyyyMMdd-HHmmss</maven.build.timestamp.format>
@ -31,54 +38,55 @@
</dependency>
<!-- Ghidra JARs as system-scoped dependencies -->
<!-- Paths can be overridden via GHIDRA_HOME environment variable -->
<dependency>
<groupId>ghidra</groupId>
<artifactId>Generic</artifactId>
<version>11.3.1</version>
<version>11.4.2</version>
<scope>system</scope>
<systemPath>${ghidra.jar.location}/Generic.jar</systemPath>
<systemPath>${ghidra.generic.jar}</systemPath>
</dependency>
<dependency>
<groupId>ghidra</groupId>
<artifactId>SoftwareModeling</artifactId>
<version>11.3.1</version>
<version>11.4.2</version>
<scope>system</scope>
<systemPath>${ghidra.jar.location}/SoftwareModeling.jar</systemPath>
<systemPath>${ghidra.softwaremodeling.jar}</systemPath>
</dependency>
<dependency>
<groupId>ghidra</groupId>
<artifactId>Project</artifactId>
<version>11.3.1</version>
<version>11.4.2</version>
<scope>system</scope>
<systemPath>${ghidra.jar.location}/Project.jar</systemPath>
<systemPath>${ghidra.project.jar}</systemPath>
</dependency>
<dependency>
<groupId>ghidra</groupId>
<artifactId>Docking</artifactId>
<version>11.3.1</version>
<version>11.4.2</version>
<scope>system</scope>
<systemPath>${ghidra.jar.location}/Docking.jar</systemPath>
<systemPath>${ghidra.docking.jar}</systemPath>
</dependency>
<dependency>
<groupId>ghidra</groupId>
<artifactId>Decompiler</artifactId>
<version>11.3.1</version>
<version>11.4.2</version>
<scope>system</scope>
<systemPath>${ghidra.jar.location}/Decompiler.jar</systemPath>
<systemPath>${ghidra.decompiler.jar}</systemPath>
</dependency>
<dependency>
<groupId>ghidra</groupId>
<artifactId>Utility</artifactId>
<version>11.3.1</version>
<version>11.4.2</version>
<scope>system</scope>
<systemPath>${ghidra.jar.location}/Utility.jar</systemPath>
<systemPath>${ghidra.utility.jar}</systemPath>
</dependency>
<dependency>
<groupId>ghidra</groupId>
<artifactId>Base</artifactId>
<version>11.3.1</version>
<version>11.4.2</version>
<scope>system</scope>
<systemPath>${ghidra.jar.location}/Base.jar</systemPath>
<systemPath>${ghidra.base.jar}</systemPath>
</dependency>
<!-- Test dependencies -->
@ -251,6 +259,25 @@
</build>
<profiles>
<!-- Profile activated when GHIDRA_HOME environment variable is set -->
<profile>
<id>use-ghidra-home</id>
<activation>
<property>
<name>env.GHIDRA_HOME</name>
</property>
</activation>
<properties>
<ghidra.generic.jar>${env.GHIDRA_HOME}/Ghidra/Framework/Generic/lib/Generic.jar</ghidra.generic.jar>
<ghidra.softwaremodeling.jar>${env.GHIDRA_HOME}/Ghidra/Framework/SoftwareModeling/lib/SoftwareModeling.jar</ghidra.softwaremodeling.jar>
<ghidra.project.jar>${env.GHIDRA_HOME}/Ghidra/Framework/Project/lib/Project.jar</ghidra.project.jar>
<ghidra.docking.jar>${env.GHIDRA_HOME}/Ghidra/Framework/Docking/lib/Docking.jar</ghidra.docking.jar>
<ghidra.decompiler.jar>${env.GHIDRA_HOME}/Ghidra/Features/Decompiler/lib/Decompiler.jar</ghidra.decompiler.jar>
<ghidra.utility.jar>${env.GHIDRA_HOME}/Ghidra/Framework/Utility/lib/Utility.jar</ghidra.utility.jar>
<ghidra.base.jar>${env.GHIDRA_HOME}/Ghidra/Features/Base/lib/Base.jar</ghidra.base.jar>
</properties>
</profile>
<!-- Profile for building just the Ghidra plugin -->
<profile>
<id>plugin-only</id>

View File

@ -38,7 +38,10 @@ public class TransactionHelper {
Msg.error(TransactionHelper.class, "Transaction failed: " + transactionName, e);
} finally {
if (txId >= 0) {
success = program.endTransaction(txId, success);
if (!program.endTransaction(txId, success)) {
Msg.error(TransactionHelper.class, "Failed to end transaction: " + transactionName);
exception.set(new TransactionException("Failed to end transaction: " + transactionName));
}
}
}
});

View File

@ -1,7 +1,7 @@
Manifest-Version: 1.0
Plugin-Class: eu.starsong.ghidra.GhydraMCP
Plugin-Name: GhydraMCP
Plugin-Version: 11.3.1
Plugin-Version: 11.4.2
Bundle-Version: dev-SNAPSHOT
Plugin-Author: LaurieWired, Teal Bauer
Plugin-Description: Expose multiple Ghidra tools to MCP servers with variable management

View File

@ -2,5 +2,5 @@ name=GhydraMCP
description=A multi-headed REST interface for Ghidra for use with MCP agents.
author=Laurie Wired, Teal Bauer
createdOn=2025-03-29
version=11.3.1
ghidraVersion=11.3.1
version=11.4.2
ghidraVersion=11.4.2