Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-1999: mods for windows GP-1999: launchers for the agents GP-1999: launchers for the agents

d-millarb4698475b6cd
diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/DbgEngGadpServerLaunchShim.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/DbgEngGadpServerLaunchShim.java
new file mode 100644
index 0000000000..65306763df
--- /dev/null
+++ b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/DbgEngGadpServerLaunchShim.java
@@ -0,0 +1,37 @@
+/* ###
+ * IP: GHIDRA
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package agent.dbgeng.gadp;
+
+import org.apache.commons.lang3.exception.ExceptionUtils;
+
+import agent.dbgeng.gadp.DbgEngGadpServer.DbgEngRunner;
+import ghidra.GhidraApplicationLayout;
+import ghidra.GhidraLaunchable;
+
+public class DbgEngGadpServerLaunchShim implements GhidraLaunchable {
+
+ @Override
+ public void launch(GhidraApplicationLayout layout, String[] args) throws Exception {
+ try {
+ new DbgEngRunner().run(args);
+ }
+ catch (Throwable t) {
+ System.err.println(ExceptionUtils.getMessage(t));
+ System.exit(1);
+ }
+ }
+
+}
diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/DbgModelGadpServerLaunchShim.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/DbgModelGadpServerLaunchShim.java
new file mode 100644
index 0000000000..dddffdc629
--- /dev/null
+++ b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/DbgModelGadpServerLaunchShim.java
@@ -0,0 +1,37 @@
+/* ###
+ * IP: GHIDRA
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package agent.dbgmodel.gadp;
+
+import org.apache.commons.lang3.exception.ExceptionUtils;
+
+import agent.dbgmodel.gadp.DbgModelGadpServer.DbgModelRunner;
+import ghidra.GhidraApplicationLayout;
+import ghidra.GhidraLaunchable;
+
+public class DbgModelGadpServerLaunchShim implements GhidraLaunchable {
+
+ @Override
+ public void launch(GhidraApplicationLayout layout, String[] args) throws Exception {
+ try {
+ new DbgModelRunner().run(args);
+ }
+ catch (Throwable t) {
+ System.err.println(ExceptionUtils.getMessage(t));
+ System.exit(1);
+ }
+ }
+
+}
diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/GdbGadpServerLaunchShim.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/GdbGadpServerLaunchShim.java
new file mode 100644
index 0000000000..ed51cf4677
--- /dev/null
+++ b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/GdbGadpServerLaunchShim.java
@@ -0,0 +1,37 @@
+/* ###
+ * IP: GHIDRA
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package agent.gdb.gadp;
+
+import org.apache.commons.lang3.exception.ExceptionUtils;
+
+import agent.gdb.gadp.GdbGadpServer.Runner;
+import ghidra.GhidraApplicationLayout;
+import ghidra.GhidraLaunchable;
+
+public class GdbGadpServerLaunchShim implements GhidraLaunchable {
+
+ @Override
+ public void launch(GhidraApplicationLayout layout, String[] args) throws Exception {
+ try {
+ new Runner().run(args);
+ }
+ catch (Throwable t) {
+ System.err.println(ExceptionUtils.getMessage(t));
+ System.exit(1);
+ }
+ }
+
+}
diff --git a/Ghidra/RuntimeScripts/Linux/support/gdbGADPServerRun b/Ghidra/RuntimeScripts/Linux/support/gdbGADPServerRun
new file mode 100755
index 0000000000..85bec25c73
--- /dev/null
+++ b/Ghidra/RuntimeScripts/Linux/support/gdbGADPServerRun
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+#----------------------------------------
+# GADP Server launch
+#----------------------------------------
+
+# Maximum heap memory may be changed if default is inadequate. This will generally be up to 1/4 of
+# the physical memory available to the OS. Uncomment MAXMEM setting if non-default value is needed.
+#MAXMEM=2G
+
+# Resolve symbolic link if present and get the directory this script lives in.
+# NOTE: "readlink -f" is best but works on Linux only, "readlink" will only work if your PWD
+# contains the link you are calling (which is the best we can do on macOS), and the "echo" is the
+# fallback, which doesn't attempt to do anything with links.
+SCRIPT_FILE="$(readlink -f "$0" 2>/dev/null || readlink "$0" 2>/dev/null || echo "$0")"
+SCRIPT_DIR="${SCRIPT_FILE%/*}"
+
+# Launch Ghidra
+"${SCRIPT_DIR}"/launch.sh fg jdk GdbAgent "${MAXMEM}" "" agent.gdb.gadp.GdbGadpServerLaunchShim --gadp-args -H localhost -p 0 -g /usr/bin/gdb
diff --git a/Ghidra/RuntimeScripts/Windows/support/dbgengGADPServerRun.bat b/Ghidra/RuntimeScripts/Windows/support/dbgengGADPServerRun.bat
new file mode 100644
index 0000000000..2223462406
--- /dev/null
+++ b/Ghidra/RuntimeScripts/Windows/support/dbgengGADPServerRun.bat
@@ -0,0 +1,11 @@
+:: GADP Server launch
+
+@echo off
+setlocal
+
+:: Maximum heap memory may be changed if default is inadequate. This will generally be up to 1/4 of
+:: the physical memory available to the OS. Uncomment MAXMEM setting if non-default value is needed.
+::set MAXMEM=2G
+
+call "%~dp0launch.bat" fg jdk DbgEngAgent "%MAXMEM%" "" agent.dbgeng.gadp.DbgEngGadpServerLaunchShim -H localhost -p 0
+
diff --git a/Ghidra/RuntimeScripts/Windows/support/dbgmodelGADPServerRun.bat b/Ghidra/RuntimeScripts/Windows/support/dbgmodelGADPServerRun.bat
new file mode 100644
index 0000000000..eb360d3c2c
--- /dev/null
+++ b/Ghidra/RuntimeScripts/Windows/support/dbgmodelGADPServerRun.bat
@@ -0,0 +1,11 @@
+:: GADP Server launch
+
+@echo off
+setlocal
+
+:: Maximum heap memory may be changed if default is inadequate. This will generally be up to 1/4 of
+:: the physical memory available to the OS. Uncomment MAXMEM setting if non-default value is needed.
+::set MAXMEM=2G
+
+call "%~dp0launch.bat" fg jdk DbgEngAgent "%MAXMEM%" "" agent.dbgmodel.gadp.DbgModelGadpServerLaunchShim -H localhost -p 0
+
diff --git a/Ghidra/RuntimeScripts/certification.manifest b/Ghidra/RuntimeScripts/certification.manifest
index cfc9b7e8c7..58661dbd10 100644
--- a/Ghidra/RuntimeScripts/certification.manifest
+++ b/Ghidra/RuntimeScripts/certification.manifest
@@ -16,6 +16,7 @@ Linux/support/analyzeHeadless||GHIDRA||||END|
Linux/support/buildGhidraJar||GHIDRA||||END|
Linux/support/buildNatives||GHIDRA||||END|
Linux/support/convertStorage||GHIDRA||||END|
+Linux/support/gdbGADPServerRun||GHIDRA||||END|
Linux/support/ghidraDebug||GHIDRA||||END|
Linux/support/pythonRun||GHIDRA||||END|
Linux/support/sleigh||GHIDRA||||END|
@@ -30,6 +31,8 @@ Windows/support/buildGhidraJar.bat||GHIDRA||||END|
Windows/support/buildNatives.bat||GHIDRA||||END|
Windows/support/convertStorage.bat||GHIDRA||||END|
Windows/support/createPdbXmlFiles.bat||GHIDRA||||END|
+Windows/support/dbgengGADPServerRun.bat||GHIDRA||||END|
+Windows/support/dbgmodelGADPServerRun.bat||GHIDRA||||END|
Windows/support/ghidra.ico||GHIDRA||||END|
Windows/support/ghidraDebug.bat||GHIDRA||||END|
Windows/support/launch.bat||GHIDRA||||END|