Package ghidra
Class GhidraLauncher
java.lang.Object
ghidra.GhidraLauncher
Class used to prepare Ghidra for launching
A main(String[])
method is provided which redirects execution to a
GhidraLaunchable
class passed in as a command line argument
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSearches the given directory (non-recursively) for jars and returns their paths in a list.static long
Returns the current number of milliseconds that have elapsed since execution began.static GhidraApplicationLayout
Initializes the Ghidra environment by discovering itslayout
and adding all relevant modules and libraries to the classpathstatic void
Launches the givenGhidraLaunchable
specified in the first command line argumentstatic void
Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
GhidraLauncher
public GhidraLauncher()
-
-
Method Details
-
launch
Launches the givenGhidraLaunchable
specified in the first command line argument- Parameters:
args
- The first argument is the name of theGhidraLaunchable
to launch. The remaining args get passed through to the class'sGhidraLaunchable.launch(ghidra.GhidraApplicationLayout, java.lang.String[])
method.- Throws:
Exception
- If there was a problem launching. See the exception's message for more details on what went wrong.
-
main
Deprecated, for removal: This API element is subject to removal in a future version.UseGhidra.main(String[])
insteadLaunches the givenGhidraLaunchable
specified in the first command line argument- Parameters:
args
- The first argument is the name of theGhidraLaunchable
to launch. The remaining args get passed through to the class'sGhidraLaunchable.launch(ghidra.GhidraApplicationLayout, java.lang.String[])
method.- Throws:
Exception
- If there was a problem launching. See the exception's message for more details on what went wrong.
-
getMillisecondsFromLaunch
public static long getMillisecondsFromLaunch()Returns the current number of milliseconds that have elapsed since execution began.- Returns:
- the current number of milliseconds that have elapsed since execution began
-
initializeGhidraEnvironment
public static GhidraApplicationLayout initializeGhidraEnvironment() throws IOException, ClassNotFoundExceptionInitializes the Ghidra environment by discovering itslayout
and adding all relevant modules and libraries to the classpathNOTE: This method expects that the
GhidraClassLoader
is the active classloader- Returns:
- Ghidra's
layout
- Throws:
IOException
- if there was an issue getting thelayout
ClassNotFoundException
- if theGhidraClassLoader
is not the active classloader
-
findJarsInDir
Searches the given directory (non-recursively) for jars and returns their paths in a list. The paths will be sorted by jar file name.- Parameters:
dir
- The directory to search for jars in- Returns:
- A list of discovered jar paths, sorted by jar file name
-
Ghidra.main(String[])
instead