mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
Merge remote-tracking branch 'origin/GP-4816_ryanmkurtz_PR-6900_dc3-tsd_python3'
This commit is contained in:
0
Ghidra/RuntimeScripts/Linux/support/pythonRun → Ghidra/RuntimeScripts/Linux/support/jythonRun
Executable file → Normal file
0
Ghidra/RuntimeScripts/Linux/support/pythonRun → Ghidra/RuntimeScripts/Linux/support/jythonRun
Executable file → Normal file
33
Ghidra/RuntimeScripts/Linux/support/pyghidraRun
Normal file
33
Ghidra/RuntimeScripts/Linux/support/pyghidraRun
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#----------------------------------------
|
||||
# PyGhidra launch
|
||||
#----------------------------------------
|
||||
|
||||
# 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%/*}"
|
||||
|
||||
# Add optional JVM args inside the quotes
|
||||
VMARG_LIST=""
|
||||
|
||||
# Make sure Python3 is installed
|
||||
if ! [ -x "$(command -v python3)" ] ; then
|
||||
echo "Python 3 is not installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dev mode or production mode?
|
||||
DEV_ARG=
|
||||
INSTALL_DIR="${SCRIPT_DIR}/.."
|
||||
if [ ! -d "${INSTALL_DIR}/Ghidra" ]; then
|
||||
DEV_ARG="--dev"
|
||||
INSTALL_DIR="${SCRIPT_DIR}/../../../.."
|
||||
fi
|
||||
|
||||
PYGHIDRA_LAUNCHER="${INSTALL_DIR}/Ghidra/Features/PyGhidra/pyghidra_launcher.py"
|
||||
|
||||
python3 "${PYGHIDRA_LAUNCHER}" "${INSTALL_DIR}" ${DEV_ARG} ${VMARG_LIST} "$@"
|
||||
46
Ghidra/RuntimeScripts/Windows/support/pyghidraRun.bat
Normal file
46
Ghidra/RuntimeScripts/Windows/support/pyghidraRun.bat
Normal file
@@ -0,0 +1,46 @@
|
||||
:: PyGhidra launch
|
||||
|
||||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
:: See if we were doubled clicked or run from a command prompt
|
||||
set DOUBLE_CLICKED=n
|
||||
for /f "tokens=2" %%# in ("%cmdcmdline%") do if /i "%%#" equ "/c" set DOUBLE_CLICKED=y
|
||||
|
||||
:: Add optional JVM args inside the quotes
|
||||
set VMARG_LIST=-Dsun.java2d.dpiaware=true
|
||||
|
||||
:: Make sure Python3 is installed
|
||||
set PYTHON=py
|
||||
where /q %PYTHON%
|
||||
if not %ERRORLEVEL% == 0 (
|
||||
set PYTHON=python
|
||||
where /q !PYTHON!
|
||||
if not !ERRORLEVEL! == 0 (
|
||||
echo Python 3 is not installed.
|
||||
goto exit1
|
||||
)
|
||||
)
|
||||
|
||||
:: Dev mode or production mode?
|
||||
set DEV_ARG=
|
||||
set "SCRIPT_DIR=%~dp0"
|
||||
set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"
|
||||
set "INSTALL_DIR=%SCRIPT_DIR%\.."
|
||||
if not exist "%INSTALL_DIR%\Ghidra" (
|
||||
set DEV_ARG="--dev"
|
||||
set "INSTALL_DIR=%SCRIPT_DIR%\..\..\..\.."
|
||||
)
|
||||
|
||||
set "PYGHIDRA_LAUNCHER=%INSTALL_DIR%\Ghidra\Features\PyGhidra\pyghidra_launcher.py
|
||||
|
||||
%PYTHON% "%PYGHIDRA_LAUNCHER%" "%INSTALL_DIR%" %DEV_ARG% %VMARG_LIST% %*
|
||||
|
||||
:exit1
|
||||
if not %ERRORLEVEL% == 0 (
|
||||
if "%DOUBLE_CLICKED%"=="y" (
|
||||
pause
|
||||
)
|
||||
)
|
||||
|
||||
exit /B %ERRORLEVEL%
|
||||
@@ -4,9 +4,9 @@
|
||||
* 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.
|
||||
@@ -43,7 +43,7 @@ rootProject.PLATFORMS.each { platform ->
|
||||
include "gradlew"
|
||||
into "support/gradle"
|
||||
}
|
||||
t.from (p.file("Linux/ghidraRun"))
|
||||
t.from (p.file("Linux/ghidraRun"))
|
||||
}
|
||||
|
||||
if (isWindows(platform.name)) {
|
||||
|
||||
@@ -27,7 +27,8 @@ Linux/support/gdbGADPServerRun||GHIDRA||||END|
|
||||
Linux/support/ghidraClean||GHIDRA||||END|
|
||||
Linux/support/ghidraDebug||GHIDRA||||END|
|
||||
Linux/support/jshellRun||GHIDRA||||END|
|
||||
Linux/support/pythonRun||GHIDRA||||END|
|
||||
Linux/support/jythonRun||GHIDRA||||END|
|
||||
Linux/support/pyghidraRun||GHIDRA||||END|
|
||||
Linux/support/sleigh||GHIDRA||||END|
|
||||
Windows/ghidraRun.bat||GHIDRA||||END|
|
||||
Windows/server/ghidraSvr.bat||GHIDRA||||END|
|
||||
@@ -47,6 +48,7 @@ Windows/support/ghidra.ico||GHIDRA||||END|
|
||||
Windows/support/ghidraClean.bat||GHIDRA||||END|
|
||||
Windows/support/ghidraDebug.bat||GHIDRA||||END|
|
||||
Windows/support/jshellRun.bat||GHIDRA||||END|
|
||||
Windows/support/jythonRun.bat||GHIDRA||||END|
|
||||
Windows/support/launch.bat||GHIDRA||||END|
|
||||
Windows/support/pythonRun.bat||GHIDRA||||END|
|
||||
Windows/support/pyghidraRun.bat||GHIDRA||||END|
|
||||
Windows/support/sleigh.bat||GHIDRA||||END|
|
||||
|
||||
Reference in New Issue
Block a user