Package ghidra

Class GhidraApplicationLayout

Direct Known Subclasses:
GhidraJarApplicationLayout, GhidraTestApplicationLayout

public class GhidraApplicationLayout extends ApplicationLayout
The Ghidra application layout defines the customizable elements of the Ghidra application's directory structure.
  • Constructor Details

    • GhidraApplicationLayout

      public GhidraApplicationLayout() throws IOException
      Constructs a new Ghidra application layout object.
      Throws:
      IOException - if there was a problem getting a user directory or the application properties or modules.
    • GhidraApplicationLayout

      public GhidraApplicationLayout(File applicationInstallationDir) throws IOException
      Constructs a new Ghidra application layout object using a provided application installation directory instead of this layout's default.

      This is used when something external to Ghidra needs Ghidra's layout (like the Eclipse GhidraDevPlugin).

      Parameters:
      applicationInstallationDir - The application installation directory.
      Throws:
      IOException - if there was a problem getting a user directory or the application properties.
  • Method Details

    • findGhidraApplicationRootDirs

      protected Collection<ResourceFile> findGhidraApplicationRootDirs()
      Finds the application root directories for this application layout.
      Returns:
      A collection of the application root directories for this layout.
    • findGhidraApplicationInstallationDir

      protected ResourceFile findGhidraApplicationInstallationDir()
      Finds the application installation directory for this Ghidra application layout.
      Returns:
      The application installation directory for this Ghidra application layout. Could be null if there is no application installation directory.
    • findGhidraModules

      protected Map<String,GModule> findGhidraModules() throws IOException
      Finds the modules for this Ghidra application layout.
      Returns:
      The modules for this Ghidra application layout.
      Throws:
      IOException - if there was a problem finding the modules on disk.
    • findPatchDirectory

      protected ResourceFile findPatchDirectory()
      Returns the directory that allows users to add jar and class files to override existing distribution files
      Returns:
      the patch dir; null if not in a distribution
    • findExtensionArchiveDirectory

      protected ResourceFile findExtensionArchiveDirectory()
      Returns the directory where all Ghidra extension archives are stored. This should be at the following location:
      • {install dir}/Extensions/Ghidra
      Returns:
      the archive folder, or null if can't be determined
    • findExtensionInstallationDirectories

      protected List<ResourceFile> findExtensionInstallationDirectories()
      Returns a prioritized list of directories where Ghidra extensions are installed. These should be at the following locations:
      • [user settings dir]/Extensions
      • [application install dir]/Ghidra/Extensions (Release Mode)
      • ghidra/Ghidra/Extensions (Development Mode)
      Returns:
      the install folder, or null if can't be determined