Package ghidra.program.database
Class ProgramDB
java.lang.Object
ghidra.framework.data.DomainObjectAdapter
ghidra.framework.data.DomainObjectAdapterDB
ghidra.program.database.ProgramDB
- All Implemented Interfaces:
ErrorHandler,DataTypeManagerOwner,DomainObject,DataTypeManagerDomainObject,ProgramArchitecture,Program,ChangeManager
Database implementation for Program.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intKey version numbers which require special upgrade handlingstatic final intstatic final intstatic final Stringstatic final intstatic final intstatic final intFields inherited from class ghidra.framework.data.DomainObjectAdapterDB
changeSet, dbh, NUM_UNDOS, optionsFields inherited from class ghidra.framework.data.DomainObjectAdapter
changed, changeSupportMap, DEFAULT_NAME, lock, metadata, name, temporaryFields inherited from interface ghidra.program.util.ChangeManager
DOCR_ADDRESS_SET_PROPERTY_MAP_ADDED, DOCR_ADDRESS_SET_PROPERTY_MAP_CHANGED, DOCR_ADDRESS_SET_PROPERTY_MAP_REMOVED, DOCR_BOOKMARK_ADDED, DOCR_BOOKMARK_CHANGED, DOCR_BOOKMARK_REMOVED, DOCR_BOOKMARK_TYPE_ADDED, DOCR_BOOKMARK_TYPE_REMOVED, DOCR_CATEGORY_ADDED, DOCR_CATEGORY_MOVED, DOCR_CATEGORY_REMOVED, DOCR_CATEGORY_RENAMED, DOCR_CODE_ADDED, DOCR_CODE_MOVED, DOCR_CODE_REMOVED, DOCR_CODE_REPLACED, DOCR_CODE_UNIT_PROPERTY_ALL_REMOVED, DOCR_CODE_UNIT_PROPERTY_CHANGED, DOCR_CODE_UNIT_PROPERTY_RANGE_REMOVED, DOCR_CODE_UNIT_USER_DATA_CHANGED, DOCR_COMPOSITE_ADDED, DOCR_COMPOSITE_REMOVED, DOCR_DATA_TYPE_ADDED, DOCR_DATA_TYPE_CHANGED, DOCR_DATA_TYPE_MOVED, DOCR_DATA_TYPE_REMOVED, DOCR_DATA_TYPE_RENAMED, DOCR_DATA_TYPE_REPLACED, DOCR_DATA_TYPE_SETTING_CHANGED, DOCR_EOL_COMMENT_CHANGED, DOCR_EQUATE_ADDED, DOCR_EQUATE_REFERENCE_ADDED, DOCR_EQUATE_REFERENCE_REMOVED, DOCR_EQUATE_REMOVED, DOCR_EQUATE_RENAMED, DOCR_EXTERNAL_ENTRY_POINT_ADDED, DOCR_EXTERNAL_ENTRY_POINT_REMOVED, DOCR_EXTERNAL_NAME_ADDED, DOCR_EXTERNAL_NAME_CHANGED, DOCR_EXTERNAL_NAME_REMOVED, DOCR_EXTERNAL_PATH_CHANGED, DOCR_EXTERNAL_REFERENCE_ADDED, DOCR_EXTERNAL_REFERENCE_REMOVED, DOCR_FALLTHROUGH_CHANGED, DOCR_FLOWOVERRIDE_CHANGED, DOCR_FRAGMENT_MOVED, DOCR_FUNCTION_ADDED, DOCR_FUNCTION_BODY_CHANGED, DOCR_FUNCTION_CHANGED, DOCR_FUNCTION_REMOVED, DOCR_FUNCTION_TAG_CHANGED, DOCR_FUNCTION_TAG_CREATED, DOCR_FUNCTION_TAG_DELETED, DOCR_GROUP_ADDED, DOCR_GROUP_ALIAS_CHANGED, DOCR_GROUP_COMMENT_CHANGED, DOCR_GROUP_REMOVED, DOCR_GROUP_RENAMED, DOCR_GROUP_REPARENTED, DOCR_IMAGE_BASE_CHANGED, DOCR_INT_ADDRESS_SET_PROPERTY_MAP_ADDED, DOCR_INT_ADDRESS_SET_PROPERTY_MAP_CHANGED, DOCR_INT_ADDRESS_SET_PROPERTY_MAP_REMOVED, DOCR_LANGUAGE_CHANGED, DOCR_LENGTH_OVERRIDE_CHANGED, DOCR_MEM_REF_PRIMARY_REMOVED, DOCR_MEM_REF_PRIMARY_SET, DOCR_MEM_REF_TYPE_CHANGED, DOCR_MEM_REFERENCE_ADDED, DOCR_MEM_REFERENCE_REMOVED, DOCR_MEMORY_BLOCK_ADDED, DOCR_MEMORY_BLOCK_CHANGED, DOCR_MEMORY_BLOCK_MOVED, DOCR_MEMORY_BLOCK_REMOVED, DOCR_MEMORY_BLOCK_SPLIT, DOCR_MEMORY_BLOCKS_JOINED, DOCR_MEMORY_BYTES_CHANGED, DOCR_MODULE_REORDERED, DOCR_OVERLAY_SPACE_ADDED, DOCR_OVERLAY_SPACE_REMOVED, DOCR_OVERLAY_SPACE_RENAMED, DOCR_PLATE_COMMENT_CHANGED, DOCR_POST_COMMENT_CHANGED, DOCR_PRE_COMMENT_CHANGED, DOCR_REGISTER_VALUES_CHANGED, DOCR_REPEATABLE_COMMENT_CHANGED, DOCR_SOURCE_ARCHIVE_ADDED, DOCR_SOURCE_ARCHIVE_CHANGED, DOCR_SYMBOL_ADDED, DOCR_SYMBOL_ADDRESS_CHANGED, DOCR_SYMBOL_ANCHORED_FLAG_CHANGED, DOCR_SYMBOL_ASSOCIATION_ADDED, DOCR_SYMBOL_ASSOCIATION_REMOVED, DOCR_SYMBOL_DATA_CHANGED, DOCR_SYMBOL_REMOVED, DOCR_SYMBOL_RENAMED, DOCR_SYMBOL_SCOPE_CHANGED, DOCR_SYMBOL_SET_AS_PRIMARY, DOCR_SYMBOL_SOURCE_CHANGED, DOCR_TREE_CREATED, DOCR_TREE_REMOVED, DOCR_TREE_RENAMED, DOCR_USER_DATA_CHANGED, DOCR_VARIABLE_REFERENCE_ADDED, DOCR_VARIABLE_REFERENCE_REMOVED, FUNCTION_CHANGED_CALL_FIXUP, FUNCTION_CHANGED_INLINE, FUNCTION_CHANGED_NORETURN, FUNCTION_CHANGED_PARAMETERS, FUNCTION_CHANGED_PURGE, FUNCTION_CHANGED_RETURN, FUNCTION_CHANGED_THUNKFields inherited from interface ghidra.framework.model.DomainObject
DO_DOMAIN_FILE_CHANGED, DO_OBJECT_CLOSED, DO_OBJECT_ERROR, DO_OBJECT_RENAMED, DO_OBJECT_RESTORED, DO_OBJECT_SAVED, DO_PROPERTY_CHANGED, undoLockFields inherited from interface ghidra.program.model.listing.Program
ANALYSIS_PROPERTIES, ANALYSIS_START_DATE, ANALYSIS_START_DATE_FORMAT, ANALYZED_OPTION_NAME, ASK_TO_ANALYZE_OPTION_NAME, CREATED_WITH_GHIDRA_VERSION, DATE_CREATED, DISASSEMBLER_PROPERTIES, JANUARY_1_1970, MAX_OPERANDS, PREFERRED_ROOT_NAMESPACE_CATEGORY_PROPERTY, PROGRAM_INFO -
Constructor Summary
ConstructorsConstructorDescriptionProgramDB(DBHandle dbh, OpenMode openMode, TaskMonitor monitor, Object consumer) Constructs a new ProgramDBProgramDB(String name, Language language, CompilerSpec compilerSpec, Object consumer) Constructs a new ProgramDB -
Method Summary
Modifier and TypeMethodDescriptionvoidcategoryAdded(long categoryID, ProgramEvent eventType, Object oldValue, Object newValue) Notification that a category was added.voidcategoryChanged(long categoryID, ProgramEvent eventType, Object oldValue, Object newValue) Notification that a category was changed.protected voidclearCache(boolean all) protected voidclose()createAddressSetPropertyMap(String mapName) Create a new AddressSetPropertyMap with the specified name.createIntRangeMap(String mapName) Create a new IntRangeMap with the specified name.createOverlaySpace(String overlaySpaceName, AddressSpace baseSpace) Create a new overlay space based upon the given base AddressSpacevoiddataTypeAdded(long dataTypeID, ProgramEvent eventType, Object oldValue, Object newValue) Notification that a datatype was added.voiddataTypeChanged(long dataTypeID, ProgramEvent eventType, boolean isAutoChange, Object oldValue, Object newValue) notification the a datatype has changedvoiddeleteAddressRange(Address startAddr, Address endAddr, TaskMonitor monitor) Deletes given range from the program.voiddeleteAddressSetPropertyMap(String mapName) Remove the property map from the program.voiddeleteIntRangeMap(String mapName) Remove the property map from the program.protected voidIndicates that this domain object has been restored to a completely different state due to a transaction undo/redo/rollback or a database merge operation.voidFlush any pending database changes.voidForce transaction lock and terminate current transaction.Returns the AddressFactory for this program.Returns this programs address map.getAddressSetPropertyMap(String mapName) Get the property map with the given name.protected FileSystemReturns the hidden user-filesystem associated with this objects domain file, or null if unknown.Get the bookmark manager.Get the program changes since the last save as a set of addresses.Gets the name of the compiler believed to have been used to create this program.Returns the CompilerSpec currently used by this program.Returns the creation date of this program.Returns the program's datatype manager.intGets the default pointer size in bytes as it may be stored within the program listing.Returns a word or short phrase that best describes or categorizes the object in terms that a user will understand.Get the equate table object.Returns a value corresponding to the original file format.Returns a value corresponding to the original binary file MD5 hash.Gets the path to the program's executable file.Returns a value corresponding to the original binary file SHA256 hash.Returns the external manager.Returns the programs function manager.Returns the global namespace for this programReturns the current program image base addressgetIntRangeMap(String mapName) Get the property map with the given name.Returns the language used by this program.Return the name of the language used by this program.Get the listing object.Get the programs maximum address.Get the memory object.Returns a map containing all the stored metadata associated with this domain object.Get the program's minimum address.Gets the preferred root data type category path which corresponds to the global namespace of a namespace-based storage area.Returns the program context.Returns the user-specific data manager for this program.Get the reference manager.getRegister(Address addr) Returns the largest register located at the specified addressgetRegister(Address addr, int size) Returns a specific register based upon its address and sizegetRegister(Varnode varnode) Returns the register which corresponds to the specified varnodegetRegister(String regName) Returns the register with the given name;Register[]getRegisters(Address addr) Returns all registers located at the specified addressGets the relocation table.Returns the program'sSourceFileManager.intGet the symbol table object.longReturns an ID that is unique for this program.protected DomainObjectAdapterDBReturns the user data object or null if not supported by this domain object.Get the user propertyMangager stored with this program.protected voidInstall updated compiler spec extension options.voidInvalidate (i.e., clear) any pending database changes not yet written.booleanReturns true if changes are permitted.booleanDetermine if program initialization requires a language upgradebooleanAttempt to obtain a modification lock on the domain object.voidmoveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor) Moves all information stored in the given range to the new locationAddress[]parseAddress(String addrStr) Return an array of Addresses that could represent the given string.Address[]parseAddress(String addrStr, boolean caseSensitive) Return an array of Addresses that could represent the given string.voidprogramTreeAdded(long id, ProgramEvent eventType, Object oldValue, Object newValue) Notification that a program tree was added.voidprogramTreeChanged(long id, ProgramEvent eventType, Object affectedObj, Object oldValue, Object newValue) Notification that a program tree was changed.protected booleanpropertyChanged(String propertyName, Object oldValue, Object newValue) Notification of property changebooleanremoveOverlaySpace(String overlaySpaceName) Remove the specified overlay address space from this program.voidrenameOverlaySpace(String overlaySpaceName, String newName) Rename an existing overlay address space.voidRestores the last committed image base.protected voidsetChanged(boolean state) voidsetChanged(ProgramChangeRecord changeRecord) voidsetChanged(ProgramEvent event, Address start, Address end, Object oldValue, Object newValue) Mark the state of a Program as having changed and generate the event of the specified type.voidsetChanged(ProgramEvent event, Object oldValue, Object newValue) Mark the state of a Program as having changed and generate the event of the specified type.voidsetCompiler(String compiler) Sets the name of the compiler which created this program.protected voidSet theDomainFileassociated with this instance.voidsetEffectiveImageBase(Address imageBase) Deprecated.voidsetExecutableFormat(String format) Sets the value corresponding to the original file format.voidsetExecutableMD5(String md5) Sets the value corresponding to the original binary file MD5 hash.voidsetExecutablePath(String path) Sets the path to the program's executable file.voidsetExecutableSHA256(String sha256) Sets the value corresponding to the original binary file SHA256 hash.voidsetImageBase(Address base, boolean commit) Sets the program's image base address.voidsetLanguage(Language newLanguage, CompilerSpecID newCompilerSpecID, boolean forceRedisassembly, TaskMonitor monitor) Sets the language for the program.voidSet the name for this domain object.voidsetObjChanged(ProgramEvent eventType, Address addr, Object affectedObj, Object oldValue, Object newValue) Mark the state of a Program as having changed and generate the event of the specified type.voidsetObjChanged(ProgramEvent eventType, Object affected, Object oldValue, Object newValue) Mark the state of a Program as having changed and generate the event of the specified type.voidsetPreferredRootNamespaceCategoryPath(String categoryPath) Sets the preferred data type category path which corresponds to the root of a namespace hierarchy storage area.voidsetPropertyChanged(String propertyName, Address codeUnitAddr, Object oldValue, Object newValue) Mark the state of a Program as having changed and generate the DOCR_CODE_UNIT_PROPERTY_CHANGED event.voidsetPropertyRangeRemoved(String propertyName, Address start, Address end) Mark the state of the Program as having changed and generate the DOCR_CODE_UNIT_PROPERTY_RANGE_REMOVED event.voidsetRegisterValuesChanged(Register register, Address start, Address end) Notifies that register values have changed over the indicated address range.voidsourceArchiveAdded(UniversalID sourceArchiveID, ProgramEvent eventType) voidsourceArchiveChanged(UniversalID sourceArchiveID, ProgramEvent eventType) voidsymbolAdded(Symbol symbol, ProgramEvent eventType, Address addr, Object oldValue, Object newValue) Notification that a symbol was added.voidsymbolChanged(Symbol symbol, ProgramEvent eventType, Address addr, Object affectedObj, Object oldValue, Object newValue) Notification that a symbol was changed.voidtagChanged(FunctionTag tag, ProgramEvent eventType, Object oldValue, Object newValue) Notification that aFunctionTagwas changed.voidtagCreated(FunctionTag tag, ProgramEvent eventType) Notification that a newFunctionTagwas created.voidunlock()Release a modification lock previously granted with the lock method.protected voidThis method is called before a save, saveAs, or saveToPackedFile to update common meta dataprotected voiduserDataChanged(String propertyName, Object oldValue, Object newValue) Methods inherited from class ghidra.framework.data.DomainObjectAdapterDB
addSynchronizedDomainObject, addTransactionListener, canLock, canRedo, canSave, canUndo, clearUndo, clearUndo, dbError, endTransaction, getAllRedoNames, getAllUndoNames, getChangeSet, getCurrentTransactionInfo, getDBHandle, getOptions, getOptionsNames, getRedoName, getSynchronizedDomainObjects, getUndoName, getUndoStackDepth, hasTerminatedTransaction, invalidate, isChanged, isClosed, isLocked, loadMetadata, openTransaction, performPropertyListAlterations, redo, releaseSynchronizedDomainObject, removeTransactionListener, save, saveMetadata, saveToPackedFile, setImmutable, startTransaction, startTransaction, undoMethods inherited from class ghidra.framework.data.DomainObjectAdapter
addCloseListener, addConsumer, addDomainFileListener, addListener, checkExclusiveAccess, createPrivateEventQueue, fatalErrorOccurred, fireEvent, flushEvents, flushPrivateEventQueue, getChangeStatus, getConsumerList, getContentHandler, getContentHandler, getContentHandler, getContentHandlers, getDomainFile, getLock, getModificationNumber, getName, hasExclusiveAccess, isSendingEvents, isTemporary, isUsedBy, release, removeCloseListener, removeDomainFileListener, removeListener, removePrivateEventQueue, setEventsEnabled, setTemporary, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.framework.model.DomainObject
addCloseListener, addConsumer, addDomainFileListener, addListener, addSynchronizedDomainObject, addTransactionListener, canLock, canRedo, canSave, canUndo, clearUndo, createPrivateEventQueue, endTransaction, flushEvents, flushPrivateEventQueue, getAllRedoNames, getAllUndoNames, getConsumerList, getCurrentTransactionInfo, getDomainFile, getModificationNumber, getName, getOptions, getOptionsNames, getRedoName, getSynchronizedDomainObjects, getUndoName, hasExclusiveAccess, hasTerminatedTransaction, isChanged, isClosed, isLocked, isSendingEvents, isTemporary, isUsedBy, openTransaction, redo, release, releaseSynchronizedDomainObject, removeCloseListener, removeDomainFileListener, removeListener, removePrivateEventQueue, removeTransactionListener, save, saveToPackedFile, setEventsEnabled, setTemporary, startTransaction, startTransaction, undo, withTransaction, withTransactionMethods inherited from interface ghidra.program.model.lang.ProgramArchitecture
getLanguageCompilerSpecPair
-
Field Details
-
CONTENT_TYPE
- See Also:
-
ANALYSIS_OPTIONS_MOVED_VERSION
public static final int ANALYSIS_OPTIONS_MOVED_VERSIONKey version numbers which require special upgrade handling- See Also:
-
ADDED_VARIABLE_STORAGE_MANAGER_VERSION
public static final int ADDED_VARIABLE_STORAGE_MANAGER_VERSION- See Also:
-
METADATA_ADDED_VERSION
public static final int METADATA_ADDED_VERSION- See Also:
-
EXTERNAL_FUNCTIONS_ADDED_VERSION
public static final int EXTERNAL_FUNCTIONS_ADDED_VERSION- See Also:
-
COMPOUND_VARIABLE_STORAGE_ADDED_VERSION
public static final int COMPOUND_VARIABLE_STORAGE_ADDED_VERSION- See Also:
-
AUTO_PARAMETERS_ADDED_VERSION
public static final int AUTO_PARAMETERS_ADDED_VERSION- See Also:
-
RELOCATION_STATUS_ADDED_VERSION
public static final int RELOCATION_STATUS_ADDED_VERSION- See Also:
-
-
Constructor Details
-
ProgramDB
public ProgramDB(String name, Language language, CompilerSpec compilerSpec, Object consumer) throws IOException Constructs a new ProgramDB- Parameters:
name- the name of the programlanguage- the Language used by this programcompilerSpec- compiler specificationconsumer- the object that is using this program.- Throws:
IOException- if there is an error accessing the database.
-
ProgramDB
public ProgramDB(DBHandle dbh, OpenMode openMode, TaskMonitor monitor, Object consumer) throws IOException, VersionException, LanguageNotFoundException, CancelledException Constructs a new ProgramDB- Parameters:
dbh- a handle to an open program database.openMode- one of: READ_ONLY: the original database will not be modified UPDATE: the database can be written to. UPGRADE: the database is upgraded to the latest schema as it is opened.monitor- TaskMonitor that allows the open to be canceled.consumer- the object that keeping the program open.- Throws:
IOException- if an error accessing the database occurs.VersionException- if database version does not match implementation, UPGRADE may be possible.CancelledException- if instantiation is canceled by monitorLanguageNotFoundException- if a language cannot be found for this program
-
-
Method Details
-
isLanguageUpgradePending
public boolean isLanguageUpgradePending()Determine if program initialization requires a language upgrade- Returns:
- true if language upgrade is pending
-
setDomainFile
Description copied from class:DomainObjectAdapterSet theDomainFileassociated with this instance.- Overrides:
setDomainFilein classDomainObjectAdapter- Parameters:
df- domain file
-
propertyChanged
Description copied from class:DomainObjectAdapterDBNotification of property change- Overrides:
propertyChangedin classDomainObjectAdapterDB- Parameters:
propertyName-oldValue-newValue-- Returns:
- true if change is OK, false value should be reverted
-
getProgramUserData
Description copied from interface:ProgramReturns the user-specific data manager for this program.- Specified by:
getProgramUserDatain interfaceProgram- Returns:
- the program-specific user data manager
-
getAssociatedUserFilesystem
Description copied from class:DomainObjectAdapterReturns the hidden user-filesystem associated with this objects domain file, or null if unknown.- Overrides:
getAssociatedUserFilesystemin classDomainObjectAdapter- Returns:
- user data file system
-
getUserData
Description copied from class:DomainObjectAdapterDBReturns the user data object or null if not supported by this domain object.- Overrides:
getUserDatain classDomainObjectAdapterDB
-
getListing
Description copied from interface:ProgramGet the listing object.- Specified by:
getListingin interfaceProgram- Returns:
- the Listing interface to the listing object.
-
getSymbolTable
Description copied from interface:ProgramGet the symbol table object.- Specified by:
getSymbolTablein interfaceProgram- Returns:
- the symbol table object.
-
getExternalManager
Description copied from interface:ProgramReturns the external manager.- Specified by:
getExternalManagerin interfaceProgram- Returns:
- the external manager
-
getEquateTable
Description copied from interface:ProgramGet the equate table object.- Specified by:
getEquateTablein interfaceProgram- Returns:
- the equate table.
-
getMemory
Description copied from interface:ProgramGet the memory object. -
getNamespaceManager
-
getReferenceManager
Description copied from interface:ProgramGet the reference manager.- Specified by:
getReferenceManagerin interfaceProgram- Returns:
- the reference manager
-
getCodeManager
-
getTreeManager
-
getDataTypeManager
Description copied from interface:ProgramReturns the program's datatype manager.- Specified by:
getDataTypeManagerin interfaceDataTypeManagerOwner- Specified by:
getDataTypeManagerin interfaceProgram- Returns:
- the data type manager.
-
getFunctionManager
Description copied from interface:ProgramReturns the programs function manager.- Specified by:
getFunctionManagerin interfaceProgram- Returns:
- the function manager
-
getBookmarkManager
Description copied from interface:ProgramGet the bookmark manager.- Specified by:
getBookmarkManagerin interfaceProgram- Returns:
- the bookmark manager
-
getRelocationTable
Description copied from interface:ProgramGets the relocation table.- Specified by:
getRelocationTablein interfaceProgram- Returns:
- relocation table object
-
getSourceFileManager
Description copied from interface:ProgramReturns the program'sSourceFileManager.- Specified by:
getSourceFileManagerin interfaceProgram- Returns:
- the source file manager
-
getCompiler
Description copied from interface:ProgramGets the name of the compiler believed to have been used to create this program. If the compiler hasn't been determined then "unknown" is returned.- Specified by:
getCompilerin interfaceProgram- Returns:
- name of the compiler or "unknown".
-
setCompiler
Description copied from interface:ProgramSets the name of the compiler which created this program.- Specified by:
setCompilerin interfaceProgram- Parameters:
compiler- the name
-
getPreferredRootNamespaceCategoryPath
Description copied from interface:ProgramGets the preferred root data type category path which corresponds to the global namespace of a namespace-based storage area. Preference will be given to this category when searching for data types within a specific namespace. This setting corresponds to the Program Information option "Preferred Root Namespace Category. SeeDataTypeUtilitiesand its various find methods for its usage details.- Specified by:
getPreferredRootNamespaceCategoryPathin interfaceProgram- Returns:
- data type category path for root namespace or null if not set or is invalid.
-
setPreferredRootNamespaceCategoryPath
Description copied from interface:ProgramSets the preferred data type category path which corresponds to the root of a namespace hierarchy storage area. Preference will be given to this category when searching for data types within a specific namespace. This setting corresponds to the Program Information option "Preferred Root Namespace Category. SeeDataTypeUtilitiesand its various find methods for its usage details.- Specified by:
setPreferredRootNamespaceCategoryPathin interfaceProgram- Parameters:
categoryPath- data type category path for root namespace or null to clear option. The specified path must be absolute and start with "/" and must not end with one (e.g., /ClassDataTypes). An invalid path setting will be ignored.
-
getExecutablePath
Description copied from interface:ProgramGets the path to the program's executable file. For example,/home/user/foo.exe. This will allow plugins to execute the program.NOTE: The format of the path is not guaranteed to follow any standard naming conventions. If used for anything other than display purpose, callers of this method should take extra steps to ensure the path is in a form suitable for their needs.
- Specified by:
getExecutablePathin interfaceProgram- Returns:
- String path to program's exe file
-
setExecutablePath
Description copied from interface:ProgramSets the path to the program's executable file. For example,/home/user/foo.exe.- Specified by:
setExecutablePathin interfaceProgram- Parameters:
path- the path to the program's exe
-
getExecutableFormat
Description copied from interface:ProgramReturns a value corresponding to the original file format.- Specified by:
getExecutableFormatin interfaceProgram- Returns:
- original file format used to load program or null if unknown
-
setExecutableFormat
Description copied from interface:ProgramSets the value corresponding to the original file format.- Specified by:
setExecutableFormatin interfaceProgram- Parameters:
format- the binary file format string to set.
-
getExecutableMD5
Description copied from interface:ProgramReturns a value corresponding to the original binary file MD5 hash.- Specified by:
getExecutableMD5in interfaceProgram- Returns:
- original loaded file MD5 or null
-
setExecutableMD5
Description copied from interface:ProgramSets the value corresponding to the original binary file MD5 hash.- Specified by:
setExecutableMD5in interfaceProgram- Parameters:
md5- MD5 binary file hash
-
getExecutableSHA256
Description copied from interface:ProgramReturns a value corresponding to the original binary file SHA256 hash.- Specified by:
getExecutableSHA256in interfaceProgram- Returns:
- original loaded file SHA256 or null
-
setExecutableSHA256
Description copied from interface:ProgramSets the value corresponding to the original binary file SHA256 hash.- Specified by:
setExecutableSHA256in interfaceProgram- Parameters:
sha256- SHA256 binary file hash
-
getCreationDate
Description copied from interface:ProgramReturns the creation date of this program. If the program was created before this property existed, then Jan 1, 1970 is returned.- Specified by:
getCreationDatein interfaceProgram- Returns:
- the creation date of this program
-
getDefaultPointerSize
public int getDefaultPointerSize()Description copied from interface:ProgramGets the default pointer size in bytes as it may be stored within the program listing.- Specified by:
getDefaultPointerSizein interfaceProgram- Returns:
- default pointer size.
- See Also:
-
getLanguageID
Description copied from interface:ProgramReturn the name of the language used by this program.- Specified by:
getLanguageIDin interfaceProgram- Returns:
- the name of the language
-
getLanguage
Description copied from interface:ProgramReturns the language used by this program.- Specified by:
getLanguagein interfaceProgram- Specified by:
getLanguagein interfaceProgramArchitecture- Returns:
- the language used by this program.
-
getCompilerSpec
Description copied from interface:ProgramReturns the CompilerSpec currently used by this program.- Specified by:
getCompilerSpecin interfaceProgram- Specified by:
getCompilerSpecin interfaceProgramArchitecture- Returns:
- the compilerSpec currently used by this program.
-
getUsrPropertyManager
Description copied from interface:ProgramGet the user propertyMangager stored with this program. The user property manager is used to store arbitrary address indexed information associated with the program.- Specified by:
getUsrPropertyManagerin interfaceProgram- Returns:
- the user property manager.
-
getProgramContext
Description copied from interface:ProgramReturns the program context.- Specified by:
getProgramContextin interfaceProgram- Returns:
- the program context object
-
getMinAddress
Description copied from interface:ProgramGet the program's minimum address. NOTE: AnAddressRangeshould generally not be formed using this address andProgram.getMaxAddress()since it may span multipleAddressSpaces.- Specified by:
getMinAddressin interfaceProgram- Returns:
- the program's minimum address or null if no memory blocks have been defined in the program.
-
getMaxAddress
Description copied from interface:ProgramGet the programs maximum address. NOTE: AnAddressRangeshould generally not be formed using this address andProgram.getMinAddress()since it may span multipleAddressSpaces.- Specified by:
getMaxAddressin interfaceProgram- Returns:
- the program's maximum address or null if no memory blocks have been defined in the program.
-
getChanges
Description copied from interface:ProgramGet the program changes since the last save as a set of addresses.- Specified by:
getChangesin interfaceProgram- Returns:
- set of changed addresses within program.
-
getAddressFactory
Description copied from interface:ProgramReturns the AddressFactory for this program.- Specified by:
getAddressFactoryin interfaceProgram- Specified by:
getAddressFactoryin interfaceProgramArchitecture- Returns:
- the program address factory
-
getAddressMap
Returns this programs address map. NOTE: This method should be dropped from thePrograminterface to help discourage the its use external to this implementation since bad assumptions are frequently made about address keys which may not be ordered or sequential across an entire address space.- Specified by:
getAddressMapin interfaceProgram- Returns:
- internal address map
-
parseAddress
Description copied from interface:ProgramReturn an array of Addresses that could represent the given string.- Specified by:
parseAddressin interfaceProgram- Parameters:
addrStr- the string to parse.- Returns:
- zero length array if addrStr is properly formatted but no matching addresses were found or if the address is improperly formatted.
-
parseAddress
Description copied from interface:ProgramReturn an array of Addresses that could represent the given string.- Specified by:
parseAddressin interfaceProgram- Parameters:
addrStr- the string to parse.caseSensitive- whether or not to process any addressSpace names as case sensitive.- Returns:
- zero length array if addrStr is properly formatted but no matching addresses were found or if the address is improperly formatted.
-
dataTypeChanged
public void dataTypeChanged(long dataTypeID, ProgramEvent eventType, boolean isAutoChange, Object oldValue, Object newValue) notification the a datatype has changed- Parameters:
dataTypeID- the id of the datatype that changed.eventType- the type of the change (moved, renamed, etc.)isAutoChange- true if change was an automatic change in response to another datatype's change (e.g., size, alignment), else false in which case this change will be added to program change-set to aid merge conflict detection.oldValue- the old datatype.newValue- the new datatype.
-
dataTypeAdded
public void dataTypeAdded(long dataTypeID, ProgramEvent eventType, Object oldValue, Object newValue) Notification that a datatype was added.- Parameters:
dataTypeID- the id if the datatype that was added.eventType- should always be DATATYPE_ADDEDoldValue- always nullnewValue- the datatype added.
-
categoryChanged
public void categoryChanged(long categoryID, ProgramEvent eventType, Object oldValue, Object newValue) Notification that a category was changed.- Parameters:
categoryID- the id of the datatype that was added.eventType- the type of change.oldValue- old value depends on the type.newValue- new value depends on the type.
-
categoryAdded
public void categoryAdded(long categoryID, ProgramEvent eventType, Object oldValue, Object newValue) Notification that a category was added.- Parameters:
categoryID- the id of the datatype that was added.eventType- the type of change (should always be CATEGORY_ADDED)oldValue- always nullnewValue- new value depends on the type.
-
sourceArchiveAdded
-
sourceArchiveChanged
-
programTreeAdded
Notification that a program tree was added.- Parameters:
id- the id of the program tree that was added.eventType- the type of changeoldValue- old value is nullnewValue- new value depends the tree that was added.
-
programTreeChanged
public void programTreeChanged(long id, ProgramEvent eventType, Object affectedObj, Object oldValue, Object newValue) Notification that a program tree was changed.- Parameters:
id- the id of the program tree that was changed.eventType- theEventTypefor this eventaffectedObj- the object that was changedoldValue- old value depends on the type of the changenewValue- old value depends on the type of the change
-
tagChanged
Notification that aFunctionTagwas changed. This can be either an edit or a delete.- Parameters:
tag- the tag that was changed.eventType- the type of changeoldValue- old valuenewValue- new value
-
tagCreated
Notification that a newFunctionTagwas created.- Parameters:
tag- the tag that was created.eventType- the type of change
-
symbolChanged
public void symbolChanged(Symbol symbol, ProgramEvent eventType, Address addr, Object affectedObj, Object oldValue, Object newValue) Notification that a symbol was changed.- Parameters:
symbol- the symbol that was changed.eventType- the type of changeaddr- the address of the symbol that changedaffectedObj- the object that was changedoldValue- old value depends on the type of the changenewValue- old value depends on the type of the change
-
symbolAdded
public void symbolAdded(Symbol symbol, ProgramEvent eventType, Address addr, Object oldValue, Object newValue) Notification that a symbol was added.- Parameters:
symbol- the symbol that was added.eventType- the type of changeaddr- the address of the symbol that addedoldValue- old value depends on the type of the changenewValue- old value depends on the type of the change
-
setRegisterValuesChanged
Description copied from interface:ChangeManagerNotifies that register values have changed over the indicated address range.- Specified by:
setRegisterValuesChangedin interfaceChangeManager- Parameters:
register- register value which was modified (a value of null indicates all registers affected or unknown)start- the start address for the range where values changedend- the end address (inclusive) for the range where values changed
-
setChanged
Description copied from interface:ChangeManagerMark the state of a Program as having changed and generate the event of the specified type. Any or all parameters may be null.- Specified by:
setChangedin interfaceChangeManager- Parameters:
event- the event typeoldValue- original value or an Object that is related to the eventnewValue- new value or an Object that is related to the the event
-
setChanged
-
setChanged
public void setChanged(ProgramEvent event, Address start, Address end, Object oldValue, Object newValue) Description copied from interface:ChangeManagerMark the state of a Program as having changed and generate the event of the specified type. Any or all parameters may be null.- Specified by:
setChangedin interfaceChangeManager- Parameters:
event- the event typestart- starting address that is affected by the eventend- ending address that is affected by the eventoldValue- original value or an Object that is related to the eventnewValue- new value or an Object that is related to the the event
-
setObjChanged
public void setObjChanged(ProgramEvent eventType, Object affected, Object oldValue, Object newValue) Description copied from interface:ChangeManagerMark the state of a Program as having changed and generate the event of the specified type. Any or all parameters may be null.- Specified by:
setObjChangedin interfaceChangeManager- Parameters:
eventType- the event typeaffected- object that is the subject of the eventoldValue- original value or an Object that is related to the eventnewValue- new value or an Object that is related to the the event
-
setObjChanged
public void setObjChanged(ProgramEvent eventType, Address addr, Object affectedObj, Object oldValue, Object newValue) Description copied from interface:ChangeManagerMark the state of a Program as having changed and generate the event of the specified type. Any or all parameters may be null.- Specified by:
setObjChangedin interfaceChangeManager- Parameters:
eventType- the event typeaddr- program address affectedaffectedObj- object that is the subject of the eventoldValue- original value or an Object that is related to the eventnewValue- new value or an Object that is related to the the event
-
setPropertyChanged
public void setPropertyChanged(String propertyName, Address codeUnitAddr, Object oldValue, Object newValue) Description copied from interface:ChangeManagerMark the state of a Program as having changed and generate the DOCR_CODE_UNIT_PROPERTY_CHANGED event.- Specified by:
setPropertyChangedin interfaceChangeManager- Parameters:
propertyName- name of property for the range that changedcodeUnitAddr- address of the code unit with the property changeoldValue- old value for the propertynewValue- new value for the property
-
setPropertyRangeRemoved
Description copied from interface:ChangeManagerMark the state of the Program as having changed and generate the DOCR_CODE_UNIT_PROPERTY_RANGE_REMOVED event.- Specified by:
setPropertyRangeRemovedin interfaceChangeManager- Parameters:
propertyName- name of property for the range being removedstart- start address of the rangeend- end address of the range
-
userDataChanged
-
setName
Description copied from interface:DomainObjectSet the name for this domain object.- Specified by:
setNamein interfaceDomainObject- Overrides:
setNamein classDomainObjectAdapter- Parameters:
newName- object name
-
createOverlaySpace
public ProgramOverlayAddressSpace createOverlaySpace(String overlaySpaceName, AddressSpace baseSpace) throws IllegalStateException, DuplicateNameException, InvalidNameException, LockException Description copied from interface:ProgramCreate a new overlay space based upon the given base AddressSpace- Specified by:
createOverlaySpacein interfaceProgram- Parameters:
overlaySpaceName- the name of the new overlay space.baseSpace- the base AddressSpace to overlay (i.e., overlayed-space)- Returns:
- the new overlay space
- Throws:
IllegalStateException- if image base override is activeDuplicateNameException- if an address space already exists with specified overlaySpaceName.InvalidNameException- if overlaySpaceName contains invalid charactersLockException- if the program is shared and not checked out exclusively.
-
renameOverlaySpace
public void renameOverlaySpace(String overlaySpaceName, String newName) throws NotFoundException, InvalidNameException, DuplicateNameException, LockException Description copied from interface:ProgramRename an existing overlay address space. NOTE: This experimental method has known limitations with existingAddressandAddressSpaceobjects following an undo/redo which may continue to refer to the old overlay name which may lead to unxpected errors.- Specified by:
renameOverlaySpacein interfaceProgram- Parameters:
overlaySpaceName- overlay address space namenewName- new name for overlay- Throws:
NotFoundException- if the specified overlay space was not foundInvalidNameException- if new name is invalidDuplicateNameException- if new name already used by another address spaceLockException- if program does not has exclusive access
-
removeOverlaySpace
Description copied from interface:ProgramRemove the specified overlay address space from this program.- Specified by:
removeOverlaySpacein interfaceProgram- Parameters:
overlaySpaceName- overlay address space name- Returns:
- true if successfully removed, else false if blocks still make use of overlay space.
- Throws:
LockException- if program does not has exclusive accessNotFoundException- if specified overlay space not found in program
-
getImageBase
Description copied from interface:ProgramReturns the current program image base address- Specified by:
getImageBasein interfaceProgram- Returns:
- program image base address within default space
-
setEffectiveImageBase
Deprecated. -
setImageBase
public void setImageBase(Address base, boolean commit) throws AddressOverflowException, LockException, IllegalStateException Description copied from interface:ProgramSets the program's image base address.- Specified by:
setImageBasein interfaceProgram- Parameters:
base- the new image base address;commit- if false, then the image base change is temporary and does not really change the program and will be lost once the program is closed. If true, the change is permanent and marks the program as "changed" (needs saving).- Throws:
AddressOverflowException- if the new image would cause a memory block to end past the the address space.LockException- if the program is shared and the user does not have an exclusive checkout. This will never be thrown if commit is false.IllegalStateException- if the program state is not suitable for setting the image base.
-
restoreImageBase
public void restoreImageBase()Description copied from interface:ProgramRestores the last committed image base.- Specified by:
restoreImageBasein interfaceProgram
-
getDescription
Description copied from interface:DomainObjectReturns a word or short phrase that best describes or categorizes the object in terms that a user will understand.- Specified by:
getDescriptionin interfaceDomainObject- Specified by:
getDescriptionin classDomainObjectAdapter- Returns:
- the description
-
getStoredVersion
- Throws:
IOException
-
clearCache
protected void clearCache(boolean all) - Overrides:
clearCachein classDomainObjectAdapterDB
-
isChangeable
public boolean isChangeable()Description copied from interface:DomainObjectReturns true if changes are permitted.- Specified by:
isChangeablein interfaceDomainObject- Returns:
- true if changes are permitted.
-
getRegister
Description copied from interface:ProgramReturns the largest register located at the specified address- Specified by:
getRegisterin interfaceProgram- Parameters:
addr- register minimum address- Returns:
- largest register at addr or null
-
getRegisters
Description copied from interface:ProgramReturns all registers located at the specified address- Specified by:
getRegistersin interfaceProgram- Parameters:
addr- register minimum address- Returns:
- all registers at addr
-
getRegister
Description copied from interface:ProgramReturns a specific register based upon its address and size- Specified by:
getRegisterin interfaceProgram- Parameters:
addr- register addresssize- the size of the register (in bytes);- Returns:
- register or null
-
getRegister
Description copied from interface:ProgramReturns the register which corresponds to the specified varnode- Specified by:
getRegisterin interfaceProgram- Parameters:
varnode- the varnode- Returns:
- register or null
-
getRegister
Description copied from interface:ProgramReturns the register with the given name;- Specified by:
getRegisterin interfaceProgram- Parameters:
regName- the name of the register to retrieve- Returns:
- register or null
-
setChanged
protected void setChanged(boolean state) - Overrides:
setChangedin classDomainObjectAdapterDB
-
deleteAddressRange
public void deleteAddressRange(Address startAddr, Address endAddr, TaskMonitor monitor) throws RollbackException Deletes given range from the program.- Parameters:
startAddr- the first address in the range.endAddr- the last address in the range.monitor- the task monitor to use while deleting information in the given range.- Throws:
RollbackException- if the user cancelled the operation via the task monitor.
-
moveAddressRange
public void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor) throws AddressOverflowException, RollbackException Moves all information stored in the given range to the new location- Parameters:
fromAddr- the first address in the range to be movedtoAddr- the address to move tolength- the number of addresses to movemonitor- the task monitor to use while deleting information in the given range- Throws:
AddressOverflowException- if there is a problem moving address rangesRollbackException- if the user cancelled the operation via the task monitor
-
getGlobalNamespace
Description copied from interface:ProgramReturns the global namespace for this program- Specified by:
getGlobalNamespacein interfaceProgram- Returns:
- the global namespace
-
setLanguage
public void setLanguage(Language newLanguage, CompilerSpecID newCompilerSpecID, boolean forceRedisassembly, TaskMonitor monitor) throws IllegalStateException, IncompatibleLanguageException, LockException Description copied from interface:ProgramSets the language for the program. If the new language is "compatible" with the old language, the addressMap is adjusted then the program is "re-disassembled".- Specified by:
setLanguagein interfaceProgram- Parameters:
newLanguage- the new language to use.newCompilerSpecID- the new compiler specification IDforceRedisassembly- if true a redisassembly will be forced. This should always be false.monitor- the task monitor- Throws:
IllegalStateException- thrown if any error occurs, including a cancelled monitor, which leaves this program object in an unusable state. The current transaction should be aborted and the program instance discarded.IncompatibleLanguageException- thrown if the new language is too different from the existing language.LockException- if the program is shared and not checked out exclusively.
-
createAddressSetPropertyMap
public AddressSetPropertyMap createAddressSetPropertyMap(String mapName) throws DuplicateNameException Description copied from interface:ProgramCreate a new AddressSetPropertyMap with the specified name.- Specified by:
createAddressSetPropertyMapin interfaceProgram- Parameters:
mapName- name of the property map.- Returns:
- the newly created property map.
- Throws:
DuplicateNameException- if a property map already exists with the given name.
-
getAddressSetPropertyMap
Description copied from interface:ProgramGet the property map with the given name.- Specified by:
getAddressSetPropertyMapin interfaceProgram- Parameters:
mapName- name of the property map- Returns:
- null if no property map exist with the given name
-
deleteAddressSetPropertyMap
Description copied from interface:ProgramRemove the property map from the program.- Specified by:
deleteAddressSetPropertyMapin interfaceProgram- Parameters:
mapName- name of the property map to remove
-
createIntRangeMap
Description copied from interface:ProgramCreate a new IntRangeMap with the specified name.- Specified by:
createIntRangeMapin interfaceProgram- Parameters:
mapName- name of the property map.- Returns:
- the newly created property map.
- Throws:
DuplicateNameException- if a property map already exists with the given name.
-
getIntRangeMap
Description copied from interface:ProgramGet the property map with the given name.- Specified by:
getIntRangeMapin interfaceProgram- Parameters:
mapName- name of the property map- Returns:
- null if no property map exist with the given name
-
deleteIntRangeMap
Description copied from interface:ProgramRemove the property map from the program.- Specified by:
deleteIntRangeMapin interfaceProgram- Parameters:
mapName- name of the property map to remove
-
close
protected void close()- Overrides:
closein classDomainObjectAdapterDB
-
getMetadata
Description copied from interface:DomainObjectReturns a map containing all the stored metadata associated with this domain object. The map contains key,value pairs and are ordered by their insertion order.- Specified by:
getMetadatain interfaceDomainObject- Overrides:
getMetadatain classDomainObjectAdapter- Returns:
- a map containing all the stored metadata associated with this domain object.
-
updateMetadata
Description copied from class:DomainObjectAdapterDBThis method is called before a save, saveAs, or saveToPackedFile to update common meta data- Overrides:
updateMetadatain classDomainObjectAdapterDB- Throws:
IOException
-
lock
Description copied from interface:DomainObjectAttempt to obtain a modification lock on the domain object. Multiple locks may be granted on this domain object, although all lock owners must release their lock in a timely fashion.- Specified by:
lockin interfaceDomainObject- Overrides:
lockin classDomainObjectAdapterDB- Parameters:
reason- very short reason for requesting lock- Returns:
- true if lock obtained successfully, else false which indicates that a modification is in process.
-
forceLock
Description copied from interface:DomainObjectForce transaction lock and terminate current transaction.- Specified by:
forceLockin interfaceDomainObject- Overrides:
forceLockin classDomainObjectAdapterDB- Parameters:
rollback- true if rollback of non-commited changes should occurs, false if commit should be done. NOTE: it can be potentially detrimental to commit an incomplete transaction which should be avoided.reason- very short reason for requesting lock
-
unlock
public void unlock()Description copied from interface:DomainObjectRelease a modification lock previously granted with the lock method.- Specified by:
unlockin interfaceDomainObject- Overrides:
unlockin classDomainObjectAdapterDB
-
getUniqueProgramID
public long getUniqueProgramID()Description copied from interface:ProgramReturns an ID that is unique for this program. This provides an easy way to store references to a program across client persistence.- Specified by:
getUniqueProgramIDin interfaceProgram- Returns:
- unique program ID
-
invalidateWriteCache
public void invalidateWriteCache()Description copied from class:DomainObjectAdapterDBInvalidate (i.e., clear) any pending database changes not yet written. This method will be invoked by the transaction manager prior to aborting a transaction.- Overrides:
invalidateWriteCachein classDomainObjectAdapterDB
-
flushWriteCache
public void flushWriteCache()Description copied from class:DomainObjectAdapterDBFlush any pending database changes. This method will be invoked by the transaction manager prior to closing a transaction.- Overrides:
flushWriteCachein classDomainObjectAdapterDB
-
installExtensions
protected void installExtensions()Install updated compiler spec extension options. SeeSpecExtension. -
domainObjectRestored
protected void domainObjectRestored()Description copied from class:DomainObjectAdapterDBIndicates that this domain object has been restored to a completely different state due to a transaction undo/redo/rollback or a database merge operation.- Overrides:
domainObjectRestoredin classDomainObjectAdapterDB
-