GP-1999: mods for windows

GP-1999: launchers for the agents
GP-1999: launchers for the agents
This commit is contained in:
d-millar
2023-01-26 13:02:14 -05:00
parent ba0b42dc82
commit b4698475b6
7 changed files with 155 additions and 0 deletions
@@ -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);
}
}
}
@@ -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);
}
}
}
@@ -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);
}
}
}
+19
View File
@@ -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
@@ -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
@@ -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
@@ -16,6 +16,7 @@ Linux/support/analyzeHeadless||GHIDRA||||END|
Linux/support/buildGhidraJar||GHIDRA||||END| Linux/support/buildGhidraJar||GHIDRA||||END|
Linux/support/buildNatives||GHIDRA||||END| Linux/support/buildNatives||GHIDRA||||END|
Linux/support/convertStorage||GHIDRA||||END| Linux/support/convertStorage||GHIDRA||||END|
Linux/support/gdbGADPServerRun||GHIDRA||||END|
Linux/support/ghidraDebug||GHIDRA||||END| Linux/support/ghidraDebug||GHIDRA||||END|
Linux/support/pythonRun||GHIDRA||||END| Linux/support/pythonRun||GHIDRA||||END|
Linux/support/sleigh||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/buildNatives.bat||GHIDRA||||END|
Windows/support/convertStorage.bat||GHIDRA||||END| Windows/support/convertStorage.bat||GHIDRA||||END|
Windows/support/createPdbXmlFiles.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/ghidra.ico||GHIDRA||||END|
Windows/support/ghidraDebug.bat||GHIDRA||||END| Windows/support/ghidraDebug.bat||GHIDRA||||END|
Windows/support/launch.bat||GHIDRA||||END| Windows/support/launch.bat||GHIDRA||||END|