Package ghidra.plugin.importer
Class ImporterUtilities
- java.lang.Object
-
- ghidra.plugin.importer.ImporterUtilities
-
public class ImporterUtilities extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static GhidraFileFilter
CONTAINER_FILES_FILTER
File extension filter for well known 'container' files for GhidraFileChoosers.static GhidraFileFilter
LOADABLE_FILES_FILTER
File extension filter for well known 'loadable' files for GhidraFileChoosers.
-
Constructor Summary
Constructors Constructor Description ImporterUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
doAddToProgram(FSRL fsrl, LoadSpec loadSpec, java.util.List<Option> options, Program program, TaskMonitor monitor, PluginTool tool)
static void
doSingleImport(FSRL fsrl, DomainFolder destFolder, LoadSpec loadSpec, java.lang.String programName, java.util.List<Option> options, PluginTool tool, ProgramManager programManager, TaskMonitor monitor)
Perform file import and open using optional programManagerstatic void
setProgramProperties(Program program, FSRL fsrl, TaskMonitor monitor)
Ensure that aProgram
's metadata includes its import origin.static void
showAddToProgramDialog(FSRL fsrl, Program program, PluginTool tool, TaskMonitor monitor)
static void
showImportDialog(FSRL fsrl, DomainFolder destFolder, java.lang.String suggestedDestinationPath, PluginTool tool, ProgramManager programManager)
Displays the appropriate import dialog for the specifiedfile
.
-
-
-
Field Detail
-
LOADABLE_FILES_FILTER
public static final GhidraFileFilter LOADABLE_FILES_FILTER
File extension filter for well known 'loadable' files for GhidraFileChoosers. TODO: will be refactored to use file_extension_icon.xml file info.
-
CONTAINER_FILES_FILTER
public static final GhidraFileFilter CONTAINER_FILES_FILTER
File extension filter for well known 'container' files for GhidraFileChoosers. TODO: will be refactored to use file_extension_icon.xml file info.
-
-
Method Detail
-
setProgramProperties
public static void setProgramProperties(Program program, FSRL fsrl, TaskMonitor monitor) throws CancelledException, java.io.IOException
Ensure that aProgram
's metadata includes its import origin.- Parameters:
program
- importedProgram
to modifyfsrl
-FSRL
of the import source.monitor
-TaskMonitor
to use when accessing filesystem stuff.- Throws:
CancelledException
- if user cancelsjava.io.IOException
- if IO error
-
showImportDialog
public static void showImportDialog(FSRL fsrl, DomainFolder destFolder, java.lang.String suggestedDestinationPath, PluginTool tool, ProgramManager programManager)
Displays the appropriate import dialog for the specifiedfile
.If the file is a container of other files, a batch import dialog will be used, otherwise the normal single file import dialog will be shown.
- Parameters:
fsrl
-FSRL
of the file to import.destFolder
-DomainFolder
destination folder where the imported file will default to. (the user will be able to choose a different location).suggestedDestinationPath
- optional string path that will automatically be pre-pended to the destination filename.tool
-PluginTool
will be used as the parent tool for dialogs.programManager
- optionalProgramManager
instance to use to open imported binaries with, or null.
-
showAddToProgramDialog
public static void showAddToProgramDialog(FSRL fsrl, Program program, PluginTool tool, TaskMonitor monitor)
-
doSingleImport
public static void doSingleImport(FSRL fsrl, DomainFolder destFolder, LoadSpec loadSpec, java.lang.String programName, java.util.List<Option> options, PluginTool tool, ProgramManager programManager, TaskMonitor monitor)
Perform file import and open using optional programManager- Parameters:
fsrl
- import file locationdestFolder
- project destination folderloadSpec
- importLoadSpec
programName
- program nameoptions
- import optionstool
- tool to which popup dialogs should be associatedprogramManager
- program manager to open imported file with or nullmonitor
- task monitor
-
doAddToProgram
public static void doAddToProgram(FSRL fsrl, LoadSpec loadSpec, java.util.List<Option> options, Program program, TaskMonitor monitor, PluginTool tool)
-
-