Package ghidra.program.util
Class ProgramUtilities
java.lang.Object
ghidra.program.util.ProgramUtilities
General utility class that provides convenience methods
to deal with Program objects.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addTrackedProgram
(Program program) Programs will only be stored during testing and are maintained as weak references.static void
convertFunctionWrappedExternalPointer
(Symbol functionSymbol) Convert old function wrapped external pointers.static String
Get the bytes associated with the specified code unit cu formatted as a string.static DataConverter
getDataConverter
(Program program) Returns an iterator for all of theProgram
objects in the system, which is all created programs in any state that have not been garbage collected.static boolean
isChangedWithUpgradeOnly
(Program program) Determine if a program has a single unsaved change which corresponds to an upgrade which occured during instantiation.static Address
parseAddress
(Program program, String addressString)
-
Method Details
-
getDataConverter
-
addTrackedProgram
Programs will only be stored during testing and are maintained as weak references.- Parameters:
program
- The program that is being tracked (all programs during testing.
-
getSystemPrograms
Returns an iterator for all of theProgram
objects in the system, which is all created programs in any state that have not been garbage collected.Note:The Iterator is backed by an unmodifiable set, so any attempts to modify the Iterator will throw an
UnsupportedOperationException
.- Returns:
- an iterator for all of the programs in the system
-
parseAddress
-
getByteCodeString
Get the bytes associated with the specified code unit cu formatted as a string. Bytes will be returned as 2-digit hex separated with a space. Any undefined bytes will be represented by "??".- Parameters:
cu
- code unit- Returns:
- formatted byte string
-
convertFunctionWrappedExternalPointer
Convert old function wrapped external pointers. Migrate function to external function. -
isChangedWithUpgradeOnly
Determine if a program has a single unsaved change which corresponds to an upgrade which occured during instantiation.- Parameters:
program
- the program to be checked for an unsaved upgrade condition.- Returns:
- true if program upgraded and has not been saved, else false
-