Package ghidra.app.script
Class GhidraState
java.lang.Object
ghidra.app.script.GhidraState
Represents the current state of a Ghidra tool
-
Constructor Summary
ConstructorDescriptionGhidraState
(GhidraState state) GhidraState
(PluginTool tool, Project project, Program program, ProgramLocation location, ProgramSelection selection, ProgramSelection highlight) Constructs a new Ghidra state. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEnvironmentVar
(String name, byte value) void
addEnvironmentVar
(String name, double value) void
addEnvironmentVar
(String name, float value) void
addEnvironmentVar
(String name, int value) void
addEnvironmentVar
(String name, long value) void
addEnvironmentVar
(String name, short value) void
addEnvironmentVar
(String name, Object value) Returns the current program.getEnvironmentVar
(String name) Returns the current project.getTool()
Returns the current tool.void
removeEnvironmentVar
(String name) void
setCurrentAddress
(Address address) If it differs, set the current location to the given address and fire aProgramLocationPluginEvent
.void
setCurrentHighlight
(ProgramSelection highlight) Set the currently highlighted selection and fire aProgramHighlightPluginEvent
.void
setCurrentLocation
(ProgramLocation location) If it differs, set the current location and fire aProgramLocationPluginEvent
.void
setCurrentProgram
(Program program) Sets the current program.void
setCurrentSelection
(ProgramSelection selection) Set the current selection and fire aProgramSelectionPluginEvent
.
-
Constructor Details
-
GhidraState
public GhidraState(PluginTool tool, Project project, Program program, ProgramLocation location, ProgramSelection selection, ProgramSelection highlight) Constructs a new Ghidra state.- Parameters:
tool
- the current toolproject
- the current projectprogram
- the current programlocation
- the current locationselection
- the current selectionhighlight
- the current highlight
-
GhidraState
-
-
Method Details
-
getTool
Returns the current tool.- Returns:
- the current tool
-
getProject
Returns the current project.- Returns:
- the current project
-
getCurrentProgram
Returns the current program.- Returns:
- the current program
-
setCurrentProgram
Sets the current program.- Parameters:
program
- the new program object
-
getCurrentAddress
- Returns:
- the address of the current location
-
setCurrentAddress
If it differs, set the current location to the given address and fire aProgramLocationPluginEvent
.- Parameters:
address
- the address
-
getCurrentLocation
- Returns:
- the current location
-
setCurrentLocation
If it differs, set the current location and fire aProgramLocationPluginEvent
.- Parameters:
location
- the location
-
getCurrentHighlight
- Returns:
- the currently highlighted selection
-
setCurrentHighlight
Set the currently highlighted selection and fire aProgramHighlightPluginEvent
.- Parameters:
highlight
- the selection
-
getCurrentSelection
- Returns:
- the current selection
-
setCurrentSelection
Set the current selection and fire aProgramSelectionPluginEvent
.- Parameters:
selection
- the selection
-
addEnvironmentVar
-
addEnvironmentVar
-
addEnvironmentVar
-
addEnvironmentVar
-
addEnvironmentVar
-
addEnvironmentVar
-
addEnvironmentVar
-
removeEnvironmentVar
-
getEnvironmentVar
-
getEnvironmentNames
-