mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-19 16:40:38 -09:00
Simplify dirnames + support prehyphen dirs
This commit is contained in:
@@ -23,6 +23,6 @@ VMARG_LIST="${GHIDRA_JAVA_OPTIONS} ${GHIDRA_GUI_JAVA_OPTIONS} "
|
||||
# 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="$(cd "$(dirname "$SCRIPT_FILE")" && pwd)"
|
||||
SCRIPT_DIR="$(dirname -- "$SCRIPT_FILE")"
|
||||
# Launch Ghidra
|
||||
"${SCRIPT_DIR}"/support/launch.sh bg jdk Ghidra "${GHIDRA_GUI_MAXMEM}" "${VMARG_LIST}" ghidra.GhidraRun "$@"
|
||||
|
||||
@@ -75,7 +75,7 @@ WRAPPER_TMPDIR="${TMPDIR:-/tmp}"
|
||||
# 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="$(cd "$(dirname "$SCRIPT_FILE")" && pwd)"
|
||||
SCRIPT_DIR="$(dirname -- "$SCRIPT_FILE")"
|
||||
# Ensure Ghidra path doesn't contain illegal characters
|
||||
if [[ "${SCRIPT_DIR}" = *"!"* ]]; then
|
||||
echo "Ghidra path cannot contain a \"!\" character."
|
||||
|
||||
@@ -31,7 +31,7 @@ MAXMEM=128M
|
||||
# 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="$(cd "$(dirname "$SCRIPT_FILE")" && pwd)"
|
||||
SCRIPT_DIR="$(dirname -- "$SCRIPT_FILE")"
|
||||
if [ -d "${SCRIPT_DIR}/../Ghidra" ]; then
|
||||
# Production Environment
|
||||
CONFIG="${SCRIPT_DIR}/server.conf"
|
||||
|
||||
@@ -10,6 +10,6 @@ LAUNCH_MODE=fg
|
||||
# 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="$(cd "$(dirname "$SCRIPT_FILE")" && pwd)"
|
||||
SCRIPT_DIR="$(dirname -- "$SCRIPT_FILE")"
|
||||
# Launch Filesystem Conversion
|
||||
"${SCRIPT_DIR}"/../launch.sh $LAUNCH_MODE jdk GhidraGo "" "" ghidra.GhidraGo "$@"
|
||||
|
||||
@@ -36,7 +36,7 @@ DEBUG_ADDRESS=127.0.0.1:13002
|
||||
# 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="$(cd "$(dirname "$SCRIPT_FILE")" && pwd)"
|
||||
SCRIPT_DIR="$(dirname -- "$SCRIPT_FILE")"
|
||||
# Launch HeadlessAnalyzer.
|
||||
# DEBUG_ADDRESS set via environment for launch.sh
|
||||
DEBUG_ADDRESS=${DEBUG_ADDRESS} "${SCRIPT_DIR}"/launch.sh "${LAUNCH_MODE}" jdk Ghidra-Headless "${GHIDRA_HEADLESS_MAXMEM}" "${VMARG_LIST}" ghidra.app.util.headless.AnalyzeHeadless "$@"
|
||||
|
||||
@@ -27,5 +27,5 @@ LAUNCH_MODE=fg
|
||||
# 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="$(cd "$(dirname "$SCRIPT_FILE")" && pwd)"
|
||||
SCRIPT_DIR="$(dirname -- "$SCRIPT_FILE")"
|
||||
${SCRIPT_DIR}/launch.sh $LAUNCH_MODE jdk "BSim" "${GHIDRA_BSIM_MAXMEM}" "${VMARG_LIST}" ghidra.features.bsim.query.ingest.BSimLaunchable "$@"
|
||||
|
||||
@@ -15,5 +15,5 @@ VMARG_LIST="-Djava.awt.headless=true "
|
||||
# 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="$(cd "$(dirname "$SCRIPT_FILE")" && pwd)"
|
||||
SCRIPT_DIR="$(dirname -- "$SCRIPT_FILE")"
|
||||
${SCRIPT_DIR}/launch.sh $LAUNCH_MODE jdk "BSimControl" $MAXMEM "${VMARG_LIST}" ghidra.features.bsim.query.BSimControlLaunchable "$@"
|
||||
|
||||
@@ -16,7 +16,7 @@ LAUNCH_MODE=fg
|
||||
# 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="$(cd "$(dirname "$SCRIPT_FILE")" && pwd)"
|
||||
SCRIPT_DIR="$(dirname -- "$SCRIPT_FILE")"
|
||||
GHIDRA_ROOT_DIR="${SCRIPT_DIR}"/../Ghidra
|
||||
if [ ! -d "${GHIDRA_ROOT_DIR}" ]; then
|
||||
echo "This script does not support development mode use"
|
||||
|
||||
@@ -13,6 +13,6 @@ MAXMEM=128M
|
||||
# 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="$(cd "$(dirname "$SCRIPT_FILE")" && pwd)"
|
||||
SCRIPT_DIR="$(dirname -- "$SCRIPT_FILE")"
|
||||
# Launch Filesystem Conversion
|
||||
"${SCRIPT_DIR}"/launch.sh fg jdk ConvertStorage "${MAXMEM}" "" ghidra.framework.data.ConvertFileSystem "$@"
|
||||
|
||||
@@ -13,6 +13,6 @@
|
||||
# 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="$(cd "$(dirname "$SCRIPT_FILE")" && pwd)"
|
||||
SCRIPT_DIR="$(dirname -- "$SCRIPT_FILE")"
|
||||
# Launch Ghidra
|
||||
"${SCRIPT_DIR}"/launch.sh fg jdk GdbAgent "${MAXMEM}" "" agent.gdb.gadp.GdbGadpServerLaunchShim $@
|
||||
|
||||
@@ -16,5 +16,5 @@ VMARG_LIST="-Djava.awt.headless=true "
|
||||
# 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="$(cd "$(dirname "$SCRIPT_FILE")" && pwd)"
|
||||
SCRIPT_DIR="$(dirname -- "$SCRIPT_FILE")"
|
||||
"${SCRIPT_DIR}"/launch.sh fg jre Ghidra-Clean "$MAXMEM" "$VMARG_LIST" utility.application.AppCleaner Ghidra
|
||||
|
||||
@@ -30,7 +30,7 @@ DEBUG_ADDRESS=127.0.0.1:18001
|
||||
# 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="$(cd "$(dirname "$SCRIPT_FILE")" && pwd)"
|
||||
SCRIPT_DIR="$(dirname -- "$SCRIPT_FILE")"
|
||||
# Launch Ghidra in debug mode
|
||||
# DEBUG_ADDRESS set via environment for launch.sh
|
||||
DEBUG_ADDRESS=${DEBUG_ADDRESS} "${SCRIPT_DIR}"/launch.sh "${LAUNCH_MODE}" jdk Ghidra "${GHIDRA_GUI_MAXMEM}" "${VMARG_LIST}" ghidra.GhidraRun "$@"
|
||||
|
||||
@@ -23,6 +23,6 @@ VMARG_LIST="${GHIDRA_JAVA_OPTIONS} ${GHIDRA_JSHELL_JAVA_OPTIONS} "
|
||||
# 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="$(cd "$(dirname "$SCRIPT_FILE")" && pwd)"
|
||||
SCRIPT_DIR="$(dirname -- "$SCRIPT_FILE")"
|
||||
# Launch Ghidra
|
||||
"${SCRIPT_DIR}"/launch.sh fg jdk Ghidra-JShell "${GHIDRA_JSHELL_MAXMEM}" "${VMARG_LIST}" ghidra.JShellRun "$@"
|
||||
|
||||
@@ -35,7 +35,7 @@ DEBUG_ADDRESS=127.0.0.1:13002
|
||||
# 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="$(cd "$(dirname "$SCRIPT_FILE")" && pwd)"
|
||||
SCRIPT_DIR="$(dirname -- "$SCRIPT_FILE")"
|
||||
# Launch Ghidra Jython
|
||||
# DEBUG_ADDRESS set via environment for launch.sh
|
||||
DEBUG_ADDRESS=${DEBUG_ADDRESS} "${SCRIPT_DIR}"/launch.sh "${LAUNCH_MODE}" jdk "Ghidra-Jython" "${GHIDRA_JYTHON_MAXMEM}" "${VMARG_LIST}" ghidra.jython.JythonRun "$@"
|
||||
|
||||
@@ -93,7 +93,7 @@ if [[ ${INDEX} -lt 6 ]]; then
|
||||
fi
|
||||
|
||||
# Sets SUPPORT_DIR to the directory that contains this file (launch.sh)
|
||||
SUPPORT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
SUPPORT_DIR="$(dirname -- "$0")"
|
||||
# Ensure Ghidra path doesn't contain illegal characters
|
||||
if [[ "${SUPPORT_DIR}" = *"!"* ]]; then
|
||||
echo "Ghidra path cannot contain a \"!\" character."
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# 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="$(cd "$(dirname "$SCRIPT_FILE")" && pwd)"
|
||||
SCRIPT_DIR="$(dirname -- "$SCRIPT_FILE")"
|
||||
# Since JPype doesn't seem to pick up JDK_JAVA_OPTIONS automatically, include it ourselves
|
||||
VMARG_LIST="${JDK_JAVA_OPTIONS}"
|
||||
|
||||
|
||||
@@ -15,5 +15,5 @@ VMARG_LIST="-Djava.awt.headless=true "
|
||||
# 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="$(cd "$(dirname "$SCRIPT_FILE")" && pwd)"
|
||||
SCRIPT_DIR="$(dirname -- "$SCRIPT_FILE")"
|
||||
"${SCRIPT_DIR}"/launch.sh fg jdk Sleigh "$MAXMEM" "${VMARG_LIST}" ghidra.pcodeCPort.slgh_compile.SleighCompileLauncher "$@"
|
||||
|
||||
Reference in New Issue
Block a user