Class GhidraLauncher

java.lang.Object
ghidra.GhidraLauncher

public class GhidraLauncher extends Object
Class used to prepare Ghidra for launching
  • Constructor Details

    • GhidraLauncher

      public GhidraLauncher()
  • Method Details

    • launch

      public static void launch(String[] args) throws Exception
      Launches the given GhidraLaunchable specified in the first command line argument
      Parameters:
      args - The first argument is the name of the GhidraLaunchable to launch. The remaining args get passed through to the class's GhidraLaunchable.launch(GhidraApplicationLayout, 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, ClassNotFoundException
      Initializes the Ghidra environment by discovering its layout and adding all relevant modules and libraries to the classpath

      NOTE: This method expects that the GhidraClassLoader is the active classloader

      Returns:
      Ghidra's layout
      Throws:
      IOException - if there was an issue getting the layout
      ClassNotFoundException - if the GhidraClassLoader is not the active classloader
    • findJarsInDir

      public static List<String> findJarsInDir(ResourceFile dir)
      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