//@title java //@image-opt env:OPT_TARGET_CLASS //@timeout 2000000 //@desc
//@desc//@desc This will launch the target on the local machine using java. //@desc For setup instructions, press F1. //@desc
//@desc //@menu-group local //@icon icon.debugger //@help jpda#local //@env OPT_TARGET_CLASS:file="" "Image" "The Main Class to launch (defaults to current program)." //@env OPT_TARGET_CLASSPATH:str="" "ClassPath" "The JVM classpath" //@args "Arguments" "Command-line arguments to pass to the target" //@enum Arch:str JVM Dalvik //@env OPT_ARCH:Arch="JVM" "Arch" "Either 'JVM' or 'Dalvik'" //@env OPT_INCLUDE:str=n "Include virtual threads" "Include virtual threads." //@env OPT_JSHELL_PATH:file="" "JShell cmd (if desired)" "The full path to jshell." import ghidra.dbg.jdi.rmi.jpda.*; // NB. The jshell code here is user modifiable; however, the user must provide OPT_JSHEL_PATH when // prompted in Ghidra' UI, or else this script is completely bypassed. Without a jshell, Ghidra // calls new JdiClientThread(env).start() directly. GhidraJdiInit.initApp() JdiClientThread thread = new JdiClientThread(System.getenv()); thread.start();