mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 19:42:36 +02:00
Merge remote-tracking branch 'origin/GP-4906_Dan_optsImageTag--SQUASHED'
This commit is contained in:
commit
ffaa97cbd9
31 changed files with 497 additions and 462 deletions
|
@ -3,7 +3,6 @@
|
|||
Module.manifest||GHIDRA||||END|
|
||||
data/debugger-launchers/local-gdb.bat||GHIDRA||||END|
|
||||
data/debugger-launchers/qemu-gdb.bat||GHIDRA||||END|
|
||||
data/debugger-launchers/raw-gdb.bat||GHIDRA||||END|
|
||||
data/debugger-launchers/remote-gdb.bat||GHIDRA||||END|
|
||||
data/debugger-launchers/ssh-gdb.bat||GHIDRA||||END|
|
||||
data/debugger-launchers/ssh-gdbserver.bat||GHIDRA||||END|
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
::@title gdb
|
||||
::@image-opt env:OPT_TARGET_IMG
|
||||
::@desc <html><body width="300px">
|
||||
::@desc <h3>Launch with <tt>gdb</tt></h3>
|
||||
::@desc <p>
|
||||
|
@ -14,6 +15,8 @@
|
|||
::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target"
|
||||
::@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb. Omit the full path to resolve using the system PATH."
|
||||
::@env OPT_START_CMD:StartCmd="starti" "Run command" "The gdb command to actually run the target."
|
||||
::@env OPT_ARCH:str="i386:x86-64" "Architecture" "Target architecture"
|
||||
|
||||
|
||||
@echo off
|
||||
set PYTHONPATH0=%GHIDRA_HOME%\Ghidra\Debug\Debugger-agent-gdb\pypkg\src
|
||||
|
@ -28,18 +31,31 @@ IF EXIST %GHIDRA_HOME%\ghidra\.git (
|
|||
)
|
||||
set PYTHONPATH=%PYTHONPATH1%;%PYTHONPATH0%;%PYTHONPATH%
|
||||
|
||||
"%OPT_GDB_PATH%" ^
|
||||
-q ^
|
||||
-ex "set pagination off" ^
|
||||
-ex "set confirm off" ^
|
||||
-ex "show version" ^
|
||||
-ex "python import ghidragdb" ^
|
||||
-ex "target exec %OPT_TARGET_IMG%" ^
|
||||
-ex "set args %OPT_TARGET_ARGS%" ^
|
||||
-ex "set inferior-tty %TTY_TARGET%" ^
|
||||
-ex "ghidra trace connect '%GHIDRA_TRACE_RMI_ADDR%'" ^
|
||||
-ex "ghidra trace start" ^
|
||||
-ex "ghidra trace sync-enable" ^
|
||||
-ex "%OPT_START_CMD%" ^
|
||||
-ex "set confirm on" ^
|
||||
-ex "set pagination on"
|
||||
IF "%OPT_TARGET_IMG%"=="" (
|
||||
"%OPT_GDB_PATH%" ^
|
||||
-q ^
|
||||
-ex "set pagination off" ^
|
||||
-ex "set confirm off" ^
|
||||
-ex "show version" ^
|
||||
-ex "python import ghidragdb" ^
|
||||
-ex "ghidra trace connect '%GHIDRA_TRACE_RMI_ADDR%'" ^
|
||||
-ex "ghidra trace start" ^
|
||||
-ex "ghidra trace sync-enable" ^
|
||||
-ex "set confirm on" ^
|
||||
-ex "set pagination on"
|
||||
) ELSE (
|
||||
"%OPT_GDB_PATH%" ^
|
||||
-q ^
|
||||
-ex "set pagination off" ^
|
||||
-ex "set confirm off" ^
|
||||
-ex "show version" ^
|
||||
-ex "python import ghidragdb" ^
|
||||
-ex "target exec %OPT_TARGET_IMG%" ^
|
||||
-ex "set args %OPT_TARGET_ARGS%" ^
|
||||
-ex "ghidra trace connect '%GHIDRA_TRACE_RMI_ADDR%'" ^
|
||||
-ex "ghidra trace start" ^
|
||||
-ex "ghidra trace sync-enable" ^
|
||||
-ex "%OPT_START_CMD%" ^
|
||||
-ex "set confirm on" ^
|
||||
-ex "set pagination on"
|
||||
)
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
#!/usr/bin/bash
|
||||
## ###
|
||||
# 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.
|
||||
# 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.
|
||||
##
|
||||
#@title gdb
|
||||
#@image-opt arg:1
|
||||
#@desc <html><body width="300px">
|
||||
#@desc <h3>Launch with <tt>gdb</tt></h3>
|
||||
#@desc <p>
|
||||
|
@ -26,10 +27,11 @@
|
|||
#@icon icon.debugger
|
||||
#@help TraceRmiLauncherServicePlugin#gdb
|
||||
#@enum StartCmd:str run start starti
|
||||
#@arg :file "Image" "The target binary executable image"
|
||||
#@arg :file "Image" "The target binary executable image, empty for no target"
|
||||
#@args "Arguments" "Command-line arguments to pass to the target"
|
||||
#@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb. Omit the full path to resolve using the system PATH."
|
||||
#@env OPT_START_CMD:StartCmd="starti" "Run command" "The gdb command to actually run the target."
|
||||
#@env OPT_ARCH:str="i386:x86-64" "Architecture" "Target architecture"
|
||||
#@env OPT_EXTRA_TTY:bool=false "Inferior TTY" "Provide a separate terminal emulator for the target."
|
||||
#@tty TTY_TARGET if env:OPT_EXTRA_TTY
|
||||
|
||||
|
@ -50,20 +52,38 @@ target_image="$1"
|
|||
shift
|
||||
target_args="$@"
|
||||
|
||||
# NOTE: Ghidra will leave TTY_TARGET empty, which gdb takes for the same terminal.
|
||||
# Ghidra will leave TTY_TARGET empty when OPT_EXTRA_TTY is false. Gdb takes empty to mean the same terminal.
|
||||
|
||||
"$OPT_GDB_PATH" \
|
||||
-q \
|
||||
-ex "set pagination off" \
|
||||
-ex "set confirm off" \
|
||||
-ex "show version" \
|
||||
-ex "python import ghidragdb" \
|
||||
-ex "file \"$target_image\"" \
|
||||
-ex "set args $target_args" \
|
||||
-ex "set inferior-tty $TTY_TARGET" \
|
||||
-ex "ghidra trace connect \"$GHIDRA_TRACE_RMI_ADDR\"" \
|
||||
-ex "ghidra trace start" \
|
||||
-ex "ghidra trace sync-enable" \
|
||||
-ex "$OPT_START_CMD" \
|
||||
-ex "set confirm on" \
|
||||
-ex "set pagination on"
|
||||
if [ -z "$target_image" ]
|
||||
then
|
||||
"$OPT_GDB_PATH" \
|
||||
-q \
|
||||
-ex "set pagination off" \
|
||||
-ex "set confirm off" \
|
||||
-ex "show version" \
|
||||
-ex "python import ghidragdb" \
|
||||
-ex "set architecture $OPT_ARCH" \
|
||||
-ex "set inferior-tty $TTY_TARGET" \
|
||||
-ex "ghidra trace connect \"$GHIDRA_TRACE_RMI_ADDR\"" \
|
||||
-ex "ghidra trace start" \
|
||||
-ex "ghidra trace sync-enable" \
|
||||
-ex "set confirm on" \
|
||||
-ex "set pagination on"
|
||||
else
|
||||
"$OPT_GDB_PATH" \
|
||||
-q \
|
||||
-ex "set pagination off" \
|
||||
-ex "set confirm off" \
|
||||
-ex "show version" \
|
||||
-ex "python import ghidragdb" \
|
||||
-ex "set architecture $OPT_ARCH" \
|
||||
-ex "file \"$target_image\"" \
|
||||
-ex "set args $target_args" \
|
||||
-ex "set inferior-tty $TTY_TARGET" \
|
||||
-ex "ghidra trace connect \"$GHIDRA_TRACE_RMI_ADDR\"" \
|
||||
-ex "ghidra trace start" \
|
||||
-ex "ghidra trace sync-enable" \
|
||||
-ex "$OPT_START_CMD" \
|
||||
-ex "set confirm on" \
|
||||
-ex "set pagination on"
|
||||
fi
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
::@title qemu + gdb
|
||||
::@image-opt env:OPT_TARGET_IMG
|
||||
::@desc <html><body width="300px">
|
||||
::@desc <h3>Launch with <tt>qemu</tt> and connect with <tt>gdb</tt></h3>
|
||||
::@desc <p>
|
||||
|
@ -10,7 +11,7 @@
|
|||
::@menu-group cross
|
||||
::@icon icon.debugger
|
||||
::@help TraceRmiLauncherServicePlugin#gdb_qemu
|
||||
::@env OPT_TARGET_IMG:file="" "Image" "The target binary executable image"
|
||||
::@env OPT_TARGET_IMG:file!="" "Image" "The target binary executable image"
|
||||
::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target"
|
||||
::@env GHIDRA_LANG_EXTTOOL_qemu:file="" "QEMU command" "The path to qemu for the target architecture."
|
||||
::@env QEMU_GDB:int=1234 "QEMU Port" "Port for gdb connection to qemu"
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
# limitations under the License.
|
||||
##
|
||||
#@title qemu + gdb
|
||||
#@image-opt arg:1
|
||||
#@desc <html><body width="300px">
|
||||
#@desc <h3>Launch with <tt>qemu</tt> and connect with <tt>gdb</tt></h3>
|
||||
#@desc <p>
|
||||
|
@ -26,7 +27,7 @@
|
|||
#@menu-group cross
|
||||
#@icon icon.debugger
|
||||
#@help TraceRmiLauncherServicePlugin#gdb_qemu
|
||||
#@arg :file "Image" "The target binary executable image"
|
||||
#@arg :file! "Image" "The target binary executable image"
|
||||
#@args "Arguments" "Command-line arguments to pass to the target"
|
||||
#@env GHIDRA_LANG_EXTTOOL_qemu:file="" "QEMU command" "The path to qemu for the target architecture."
|
||||
#@env QEMU_GDB:int=1234 "QEMU Port" "Port for gdb connection to qemu"
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
::@title raw gdb
|
||||
::@no-image
|
||||
::@desc <html><body width="300px">
|
||||
::@desc <h3>Start <tt>gdb</tt></h3>
|
||||
::@desc <p>
|
||||
::@desc This will start <tt>gdb</tt> and connect to it.
|
||||
::@desc It will not launch a target, so you can (must) set up your target manually.
|
||||
::@desc For setup instructions, press <b>F1</b>.
|
||||
::@desc </p>
|
||||
::@desc </body></html>
|
||||
::@menu-group raw
|
||||
::@icon icon.debugger
|
||||
::@help TraceRmiLauncherServicePlugin#gdb_raw
|
||||
::@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb. Omit the full path to resolve using the system PATH."
|
||||
::@env OPT_ARCH:str="i386:x86-64" "Architecture" "Target architecture"
|
||||
|
||||
@echo off
|
||||
set PYTHONPATH0=%GHIDRA_HOME%\Ghidra\Debug\Debugger-agent-gdb\pypkg\src
|
||||
set PYTHONPATH1=%GHIDRA_HOME%\Ghidra\Debug\Debugger-rmi-trace\pypkg\src
|
||||
IF EXIST %GHIDRA_HOME%\.git (
|
||||
set PYTHONPATH0=%GHIDRA_HOME%\Ghidra\Debug\Debugger-agent-gdb\build\pypkg\src
|
||||
set PYTHONPATH1=%GHIDRA_HOME%\Ghidra\Debug\Debugger-rmi-trace\build\pypkg\src
|
||||
)
|
||||
IF EXIST %GHIDRA_HOME%\ghidra\.git (
|
||||
set PYTHONPATH0=%GHIDRA_HOME%\ghidra\Ghidra\Debug\Debugger-agent-gdb\build\pypkg\src
|
||||
set PYTHONPATH1=%GHIDRA_HOME%\ghidra\Ghidra\Debug\Debugger-rmi-trace\build\pypkg\src
|
||||
)
|
||||
set PYTHONPATH=%PYTHONPATH1%;%PYTHONPATH0%;%PYTHONPATH%
|
||||
|
||||
"%OPT_GDB_PATH%" ^
|
||||
-q ^
|
||||
-ex "set pagination off" ^
|
||||
-ex "set confirm off" ^
|
||||
-ex "show version" ^
|
||||
-ex "python import ghidragdb" ^
|
||||
-ex "set architecture %OPT_ARCH%" ^
|
||||
-ex "ghidra trace connect '%GHIDRA_TRACE_RMI_ADDR%'" ^
|
||||
-ex "ghidra trace start" ^
|
||||
-ex "ghidra trace sync-enable" ^
|
||||
-ex "set confirm on" ^
|
||||
-ex "set pagination on"
|
|
@ -1,57 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
## ###
|
||||
# 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.
|
||||
##
|
||||
#@title raw gdb
|
||||
#@no-image
|
||||
#@desc <html><body width="300px">
|
||||
#@desc <h3>Start <tt>gdb</tt></h3>
|
||||
#@desc <p>
|
||||
#@desc This will start <tt>gdb</tt> and connect to it.
|
||||
#@desc It will not launch a target, so you can (must) set up your target manually.
|
||||
#@desc For setup instructions, press <b>F1</b>.
|
||||
#@desc </p>
|
||||
#@desc </body></html>
|
||||
#@menu-group raw
|
||||
#@icon icon.debugger
|
||||
#@help TraceRmiLauncherServicePlugin#gdb_raw
|
||||
#@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb. Omit the full path to resolve using the system PATH."
|
||||
#@env OPT_ARCH:str="i386:x86-64" "Architecture" "Target architecture"
|
||||
|
||||
if [ -d ${GHIDRA_HOME}/ghidra/.git ]
|
||||
then
|
||||
export PYTHONPATH=$GHIDRA_HOME/ghidra/Ghidra/Debug/Debugger-agent-gdb/build/pypkg/src:$PYTHONPATH
|
||||
export PYTHONPATH=$GHIDRA_HOME/ghidra/Ghidra/Debug/Debugger-rmi-trace/build/pypkg/src:$PYTHONPATH
|
||||
elif [ -d ${GHIDRA_HOME}/.git ]
|
||||
then
|
||||
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-agent-gdb/build/pypkg/src:$PYTHONPATH
|
||||
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-rmi-trace/build/pypkg/src:$PYTHONPATH
|
||||
else
|
||||
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-agent-gdb/pypkg/src:$PYTHONPATH
|
||||
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-rmi-trace/pypkg/src:$PYTHONPATH
|
||||
fi
|
||||
|
||||
"$OPT_GDB_PATH" \
|
||||
-q \
|
||||
-ex "set pagination off" \
|
||||
-ex "set confirm off" \
|
||||
-ex "show version" \
|
||||
-ex "python import ghidragdb" \
|
||||
-ex "set architecture $OPT_ARCH" \
|
||||
-ex "ghidra trace connect \"$GHIDRA_TRACE_RMI_ADDR\"" \
|
||||
-ex "ghidra trace start" \
|
||||
-ex "ghidra trace sync-enable" \
|
||||
-ex "set confirm on" \
|
||||
-ex "set pagination on"
|
|
@ -1,5 +1,4 @@
|
|||
::@title remote gdb
|
||||
::@no-image
|
||||
::@desc <html><body width="300px">
|
||||
::@desc <h3>Launch with local <tt>gdb</tt> and connect to a stub (e.g., <tt>gdbserver</tt>)</h3>
|
||||
::@desc <p>
|
||||
|
@ -14,7 +13,7 @@
|
|||
::@env OPT_TARGET_TYPE:TargetType="remote" "Target" "The type of remote target"
|
||||
::@env OPT_HOST:str="localhost" "Host" "The hostname of the target"
|
||||
::@env OPT_PORT:int=9999 "Port" "The host's listening port"
|
||||
::@env OPT_ARCH:str="" "Architecture (optional)" "Target architecture override"
|
||||
::@env OPT_ARCH:str="auto" "Architecture" "Target architecture override"
|
||||
::@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb on the local system. Omit the full path to resolve using the system PATH."
|
||||
|
||||
@echo off
|
||||
|
@ -30,19 +29,13 @@ IF EXIST %GHIDRA_HOME%\ghidra\.git (
|
|||
)
|
||||
set PYTHONPATH=%PYTHONPATH1%;%PYTHONPATH0%;%PYTHONPATH%
|
||||
|
||||
IF "%OPT_ARCH%"=="" (
|
||||
set archcmd=
|
||||
) ELSE (
|
||||
set archcmd=-ex "set arch %OPT_ARCH%"
|
||||
)
|
||||
|
||||
"%OPT_GDB_PATH%" ^
|
||||
-q ^
|
||||
-ex "set pagination off" ^
|
||||
-ex "set confirm off" ^
|
||||
-ex "show version" ^
|
||||
-ex "python import ghidragdb" ^
|
||||
%archcmd% ^
|
||||
-ex "set arch %OPT_ARCH%" ^
|
||||
-ex "echo Connecting to %OPT_HOST%:%OPT_PORT%... " ^
|
||||
-ex "target %OPT_TARGET_TYPE% %OPT_HOST%:%OPT_PORT%" ^
|
||||
-ex "ghidra trace connect '%GHIDRA_TRACE_RMI_ADDR%'" ^
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
# limitations under the License.
|
||||
##
|
||||
#@title remote gdb
|
||||
#@no-image
|
||||
#@desc <html><body width="300px">
|
||||
#@desc <h3>Launch with local <tt>gdb</tt> and connect to a stub (e.g., <tt>gdbserver</tt>)</h3>
|
||||
#@desc <p>
|
||||
|
@ -30,7 +29,7 @@
|
|||
#@env OPT_TARGET_TYPE:TargetType="remote" "Target" "The type of remote target"
|
||||
#@env OPT_HOST:str="localhost" "Host" "The hostname of the target"
|
||||
#@env OPT_PORT:int=9999 "Port" "The host's listening port"
|
||||
#@env OPT_ARCH:str="" "Architecture (optional)" "Target architecture override"
|
||||
#@env OPT_ARCH:str="auto" "Architecture" "Target architecture override"
|
||||
#@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb on the local system. Omit the full path to resolve using the system PATH."
|
||||
|
||||
if [ -d ${GHIDRA_HOME}/ghidra/.git ]
|
||||
|
@ -46,20 +45,13 @@ else
|
|||
export PYTHONPATH=$GHIDRA_HOME/Ghidra/Debug/Debugger-rmi-trace/pypkg/src:$PYTHONPATH
|
||||
fi
|
||||
|
||||
if [ -z "$OPT_ARCH" ]
|
||||
then
|
||||
archcmd=
|
||||
else
|
||||
archcmd=-ex "set arch $OPT_ARCH"
|
||||
fi
|
||||
|
||||
"$OPT_GDB_PATH" \
|
||||
-q \
|
||||
-ex "set pagination off" \
|
||||
-ex "set confirm off" \
|
||||
-ex "show version" \
|
||||
-ex "python import ghidragdb" \
|
||||
$archcmd \
|
||||
-ex "set arch $OPT_ARCH" \
|
||||
-ex "echo Connecting to $OPT_HOST:$OPT_PORT... " \
|
||||
-ex "target $OPT_TARGET_TYPE $OPT_HOST:$OPT_PORT" \
|
||||
-ex "ghidra trace connect \"$GHIDRA_TRACE_RMI_ADDR\"" \
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
::@timeout 60000
|
||||
::@title gdb via ssh
|
||||
::@image-opt env:OPT_TARGET_IMG
|
||||
::@desc <html><body width="300px">
|
||||
::@desc <h3>Launch with <tt>gdb</tt> via <tt>ssh</tt></h3>
|
||||
::@desc <p>
|
||||
|
@ -19,21 +20,39 @@
|
|||
::@env OPT_EXTRA_SSH_ARGS:str="" "Extra ssh arguments" "Extra arguments to pass to ssh. Use with care."
|
||||
::@env OPT_GDB_PATH:str="gdb" "gdb command" "The path to gdb on the remote system. Omit the full path to resolve using the system PATH."
|
||||
::@env OPT_START_CMD:StartCmd="starti" "Run command" "The gdb command to actually run the target."
|
||||
::@env OPT_ARCH:str="i386:x86-64" "Architecture" "Target architecture"
|
||||
|
||||
@echo off
|
||||
set cmd=TERM='%TERM%' '%OPT_GDB_PATH%' ^
|
||||
-q ^
|
||||
-ex 'set pagination off' ^
|
||||
-ex 'set confirm off' ^
|
||||
-ex 'show version' ^
|
||||
-ex 'python import ghidragdb' ^
|
||||
-ex 'file \"%OPT_TARGET_IMG%\"' ^
|
||||
-ex 'set args %OPT_TARGET_ARGS%' ^
|
||||
-ex 'ghidra trace connect \"localhost:%OPT_REMOTE_PORT%\"' ^
|
||||
-ex 'ghidra trace start' ^
|
||||
-ex 'ghidra trace sync-enable' ^
|
||||
-ex '%OPT_START_CMD%' ^
|
||||
-ex 'set confirm on' ^
|
||||
-ex 'set pagination on'
|
||||
|
||||
IF "%OPT_TARGET_IMG%" == "" (
|
||||
set cmd=TERM='%TERM%' '%OPT_GDB_PATH%' ^
|
||||
-q ^
|
||||
-ex 'set pagination off' ^
|
||||
-ex 'set confirm off' ^
|
||||
-ex 'show version' ^
|
||||
-ex 'python import ghidragdb' ^
|
||||
-ex 'set architecture %OPT_ARCH%' ^
|
||||
-ex 'ghidra trace connect \"localhost:%OPT_REMOTE_PORT%\"' ^
|
||||
-ex 'ghidra trace start' ^
|
||||
-ex 'ghidra trace sync-enable' ^
|
||||
-ex 'set confirm on' ^
|
||||
-ex 'set pagination on'
|
||||
) ELSE (
|
||||
set cmd=TERM='%TERM%' '%OPT_GDB_PATH%' ^
|
||||
-q ^
|
||||
-ex 'set pagination off' ^
|
||||
-ex 'set confirm off' ^
|
||||
-ex 'show version' ^
|
||||
-ex 'python import ghidragdb' ^
|
||||
-ex 'set architecture %OPT_ARCH%' ^
|
||||
-ex 'file \"%OPT_TARGET_IMG%\"' ^
|
||||
-ex 'set args %OPT_TARGET_ARGS%' ^
|
||||
-ex 'ghidra trace connect \"localhost:%OPT_REMOTE_PORT%\"' ^
|
||||
-ex 'ghidra trace start' ^
|
||||
-ex 'ghidra trace sync-enable' ^
|
||||
-ex '%OPT_START_CMD%' ^
|
||||
-ex 'set confirm on' ^
|
||||
-ex 'set pagination on'
|
||||
)
|
||||
|
||||
"%OPT_SSH_PATH%" "-R%OPT_REMOTE_PORT%:%GHIDRA_TRACE_RMI_ADDR%" -t %OPT_EXTRA_SSH_ARGS% "%OPT_HOST%" "%cmd%"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
##
|
||||
#@timeout 60000
|
||||
#@title gdb via ssh
|
||||
#@image-opt arg:1
|
||||
#@desc <html><body width="300px">
|
||||
#@desc <h3>Launch with <tt>gdb</tt> via <tt>ssh</tt></h3>
|
||||
#@desc <p>
|
||||
|
@ -29,28 +30,46 @@
|
|||
#@enum StartCmd:str run start starti
|
||||
#@arg :str "Image" "The target binary executable image on the remote system"
|
||||
#@args "Arguments" "Command-line arguments to pass to the target"
|
||||
#@env OPT_SSH_PATH:file="ssh" "ssh command" "The path to ssh on the local system. Omit the full path to resolve using the system PATH."
|
||||
#@env OPT_SSH_PATH:file!="ssh" "ssh command" "The path to ssh on the local system. Omit the full path to resolve using the system PATH."
|
||||
#@env OPT_HOST:str="localhost" "[User@]Host" "The hostname or user@host"
|
||||
#@env OPT_REMOTE_PORT:int=12345 "Remote Trace RMI Port" "A free port on the remote end to receive and forward the Trace RMI connection."
|
||||
#@env OPT_EXTRA_SSH_ARGS:str="" "Extra ssh arguments" "Extra arguments to pass to ssh. Use with care."
|
||||
#@env OPT_GDB_PATH:str="gdb" "gdb command" "The path to gdb on the remote system. Omit the full path to resolve using the system PATH."
|
||||
#@env OPT_START_CMD:StartCmd="starti" "Run command" "The gdb command to actually run the target."
|
||||
#@env OPT_ARCH:str="i386:x86-64" "Architecture" "Target architecture"
|
||||
|
||||
target_image="$1"
|
||||
shift
|
||||
target_args="$@"
|
||||
|
||||
"$OPT_SSH_PATH" "-R$OPT_REMOTE_PORT:$GHIDRA_TRACE_RMI_ADDR" -t $OPT_EXTRA_SSH_ARGS "$OPT_HOST" "TERM='$TERM' '$OPT_GDB_PATH' \
|
||||
-q \
|
||||
-ex 'set pagination off' \
|
||||
-ex 'set confirm off' \
|
||||
-ex 'show version' \
|
||||
-ex 'python import ghidragdb' \
|
||||
-ex 'file \"$target_image\"' \
|
||||
-ex 'set args $target_args' \
|
||||
-ex 'ghidra trace connect \"localhost:$OPT_REMOTE_PORT\"' \
|
||||
-ex 'ghidra trace start' \
|
||||
-ex 'ghidra trace sync-enable' \
|
||||
-ex '$OPT_START_CMD' \
|
||||
-ex 'set confirm on' \
|
||||
-ex 'set pagination on'"
|
||||
if [ -z "$target_image" ]
|
||||
then
|
||||
"$OPT_SSH_PATH" "-R$OPT_REMOTE_PORT:$GHIDRA_TRACE_RMI_ADDR" -t $OPT_EXTRA_SSH_ARGS "$OPT_HOST" "TERM='$TERM' '$OPT_GDB_PATH' \
|
||||
-q \
|
||||
-ex 'set pagination off' \
|
||||
-ex 'set confirm off' \
|
||||
-ex 'show version' \
|
||||
-ex 'python import ghidragdb' \
|
||||
-ex 'set architecture $OPT_ARCH' \
|
||||
-ex 'ghidra trace connect \"localhost:$OPT_REMOTE_PORT\"' \
|
||||
-ex 'ghidra trace start' \
|
||||
-ex 'ghidra trace sync-enable' \
|
||||
-ex 'set confirm on' \
|
||||
-ex 'set pagination on'"
|
||||
else
|
||||
"$OPT_SSH_PATH" "-R$OPT_REMOTE_PORT:$GHIDRA_TRACE_RMI_ADDR" -t $OPT_EXTRA_SSH_ARGS "$OPT_HOST" "TERM='$TERM' '$OPT_GDB_PATH' \
|
||||
-q \
|
||||
-ex 'set pagination off' \
|
||||
-ex 'set confirm off' \
|
||||
-ex 'show version' \
|
||||
-ex 'python import ghidragdb' \
|
||||
-ex 'set architecture $OPT_ARCH' \
|
||||
-ex 'file \"$target_image\"' \
|
||||
-ex 'set args $target_args' \
|
||||
-ex 'ghidra trace connect \"localhost:$OPT_REMOTE_PORT\"' \
|
||||
-ex 'ghidra trace start' \
|
||||
-ex 'ghidra trace sync-enable' \
|
||||
-ex '$OPT_START_CMD' \
|
||||
-ex 'set confirm on' \
|
||||
-ex 'set pagination on'"
|
||||
fi
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
::@timeout 60000
|
||||
::@title gdb + gdbserver via ssh
|
||||
::@image-opt env:OPT_TARGET_IMG
|
||||
::@desc <html><body width="300px">
|
||||
::@desc <h3>Launch with local <tt>gdb</tt> and <tt>gdbserver</tt> via <tt>ssh</tt></h3>
|
||||
::@desc <p>
|
||||
|
@ -10,7 +11,7 @@
|
|||
::@menu-group remote
|
||||
::@icon icon.debugger
|
||||
::@help TraceRmiLauncherServicePlugin#gdb_gdbserver_ssh
|
||||
::@env OPT_TARGET_IMG:str="" "Image" "The target binary executable image on the remote system"
|
||||
::@env OPT_TARGET_IMG:str!="" "Image" "The target binary executable image on the remote system"
|
||||
::@env OPT_TARGET_ARGS:str="" "Arguments" "Command-line arguments to pass to the target"
|
||||
::@env OPT_SSH_PATH:file="ssh" "ssh command" "The path to ssh on the local system. Omit the full path to resolve using the system PATH."
|
||||
::@env OPT_HOST:str="localhost" "[User@]Host" "The hostname or user@host"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
##
|
||||
#@timeout 60000
|
||||
#@title gdb + gdbserver via ssh
|
||||
#@image-opt arg:1
|
||||
#@desc <html><body width="300px">
|
||||
#@desc <h3>Launch with local <tt>gdb</tt> and <tt>gdbserver</tt> via <tt>ssh</tt></h3>
|
||||
#@desc <p>
|
||||
|
@ -26,9 +27,9 @@
|
|||
#@menu-group remote
|
||||
#@icon icon.debugger
|
||||
#@help TraceRmiLauncherServicePlugin#gdb_gdbserver_ssh
|
||||
#@arg :str "Image" "The target binary executable image on the remote system"
|
||||
#@arg :str! "Image" "The target binary executable image on the remote system"
|
||||
#@args "Arguments" "Command-line arguments to pass to the target"
|
||||
#@env OPT_SSH_PATH:file="ssh" "ssh command" "The path to ssh on the local system. Omit the full path to resolve using the system PATH."
|
||||
#@env OPT_SSH_PATH:file!="ssh" "ssh command" "The path to ssh on the local system. Omit the full path to resolve using the system PATH."
|
||||
#@env OPT_HOST:str="localhost" "[User@]Host" "The hostname or user@host"
|
||||
#@env OPT_EXTRA_SSH_ARGS:str="" "Extra ssh arguments" "Extra arguments to pass to ssh. Use with care."
|
||||
#@env OPT_GDBSERVER_PATH:str="gdbserver" "gdbserver command (remote)" "The path to gdbserver on the remote system. Omit the full path to resolve using the system PATH."
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
#!/usr/bin/bash
|
||||
## ###
|
||||
# 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.
|
||||
# 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.
|
||||
##
|
||||
#@title wine + gdb
|
||||
#@image-opt arg:1
|
||||
#@desc <html><body width="300px">
|
||||
#@desc <h3>Launch with <tt>gdb</tt> and <tt>wine</tt></h3>
|
||||
#@desc <p>
|
||||
|
@ -25,10 +26,11 @@
|
|||
#@menu-group cross
|
||||
#@icon icon.debugger
|
||||
#@help TraceRmiLauncherServicePlugin#gdb_wine
|
||||
#@arg :file "Image" "The target binary executable image"
|
||||
#@arg :file! "Image" "The target binary executable image"
|
||||
#@args "Arguments" "Command-line arguments to pass to the target"
|
||||
#@env OPT_WINE_PATH:file="/usr/lib/wine/wine64" "Path to wine binary" "The path to the wine executable for your target architecture."
|
||||
#@env OPT_GDB_PATH:file="gdb" "gdb command" "The path to gdb. Omit the full path to resolve using the system PATH."
|
||||
#@env OPT_ARCH:str="i386:x86-64" "Architecture" "Target architecture"
|
||||
#@env OPT_EXTRA_TTY:bool=false "Inferior TTY" "Provide a separate terminal emulator for the target."
|
||||
#@tty TTY_TARGET if env:OPT_EXTRA_TTY
|
||||
|
||||
|
@ -53,6 +55,7 @@ fi
|
|||
-ex "set confirm off" \
|
||||
-ex "show version" \
|
||||
-ex "python import ghidragdb.wine" \
|
||||
-ex "set architecture $OPT_ARCH" \
|
||||
-ex "file \"$OPT_WINE_PATH\"" \
|
||||
-ex "set args $@" \
|
||||
-ex "set inferior-tty $TTY_TARGET" \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue