Class AbstractGhidraVersionTrackingScript

java.lang.Object
ghidra.program.flatapi.FlatProgramAPI
ghidra.app.script.GhidraScript
ghidra.feature.vt.AbstractGhidraVersionTrackingScript

public abstract class AbstractGhidraVersionTrackingScript extends ghidra.app.script.GhidraScript
  • Nested Class Summary

    Nested classes/interfaces inherited from class ghidra.app.script.GhidraScript

    ghidra.app.script.GhidraScript.AnalysisMode
  • Field Summary

    Fields inherited from class ghidra.app.script.GhidraScript

    currentAddress, currentHighlight, currentLocation, currentSelection, potentialPropertiesFileLocs, propertiesFileParams, sourceFile, state, writer

    Fields inherited from class ghidra.program.flatapi.FlatProgramAPI

    currentProgram, MAX_REFERENCES_TO, monitor
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    cleanup(boolean success)
     
    void
    This will release the current session and both source and destination programs.
    createVersionTrackingSession(String name, ghidra.program.model.listing.Program source, ghidra.program.model.listing.Program destination)
     
    createVersionTrackingSession(String sourceProgramPath, String destinationProgramPath)
     
    ghidra.program.model.listing.Function
     
     
    protected ghidra.program.model.listing.Program
     
     
     
    ghidra.program.model.listing.Function
     
     
    protected ghidra.program.model.listing.Program
     
    protected VTSession
     
     
    void
     
    void
     
    void
     

    Methods inherited from class ghidra.app.script.GhidraScript

    analyzeAll, analyzeChanges, askAddress, askAddress, askBytes, askChoice, askChoices, askChoices, askDirectory, askDomainFile, askDouble, askFile, askInt, askLanguage, askLong, askPassword, askProgram, askProgram, askProjectFolder, askString, askString, askValues, askYesNo, clearBackgroundColor, clearBackgroundColor, closeProgram, createHighlight, createProgram, createProgram, createProgram, createSelection, createTableChooserDialog, createTableChooserDialog, execute, getAnalysisOptionDefaultValue, getAnalysisOptionDefaultValues, getAnalysisOptionDescription, getAnalysisOptionDescriptions, getCategory, getCodeUnitFormat, getCurrentAnalysisOptionsAndValues, getDefaultLanguage, getDemangled, getEOLCommentAsRendered, getGhidraVersion, getLanguage, getPlateCommentAsRendered, getPostCommentAsRendered, getPreCommentAsRendered, getProjectRootFolder, getRepeatableCommentAsRendered, getReusePreviousChoices, getScriptAnalysisMode, getScriptArgs, getScriptName, getSourceFile, getState, getUserName, goTo, goTo, goTo, importFile, importFileAsBinary, isAnalysisOptionDefaultValue, isRunningHeadless, loadPropertiesFile, loadVariablesFromState, openProgram, parseAddress, parseBoolean, parseBytes, parseChoice, parseChoices, parseChoices, parseDirectory, parseDomainFile, parseDouble, parseFile, parseInt, parseLanguageCompileSpecPair, parseLong, parseProjectFolder, popup, print, printerr, printf, println, println, promptToKeepChangesOnException, removeHighlight, removeSelection, resetAllAnalysisOptions, resetAnalysisOption, resetAnalysisOptions, run, runCommand, runCommand, runScript, runScript, runScript, runScript, runScriptPreserveMyState, set, setAnalysisOption, setAnalysisOptions, setAnonymousServerCredentials, setBackgroundColor, setBackgroundColor, setCurrentHighlight, setCurrentLocation, setCurrentSelection, setPotentialPropertiesFileLocations, setPropertiesFile, setPropertiesFileLocation, setReusePreviousChoices, setScriptArgs, setServerCredentials, setSourceFile, setToolStatusMessage, show, show, toHexString, toHexString, toHexString, toHexString, toString, updateStateFromVariables

    Methods inherited from class ghidra.program.flatapi.FlatProgramAPI

    addEntryPoint, addInstructionXref, analyze, clearListing, clearListing, clearListing, clearListing, createAddressSet, createAsciiString, createAsciiString, createBookmark, createByte, createChar, createClass, createData, createDouble, createDWord, createDwords, createEquate, createEquate, createExternalReference, createExternalReference, createExternalReference, createFloat, createFragment, createFragment, createFragment, createFragment, createFunction, createLabel, createLabel, createLabel, createMemoryBlock, createMemoryBlock, createMemoryReference, createMemoryReference, createNamespace, createQWord, createStackReference, createSymbol, createSymbol, createUnicodeString, createWord, disassemble, end, find, find, find, findBytes, findBytes, findBytes, findBytes, findBytes, findPascalStrings, findStrings, getAddressFactory, getBookmarks, getByte, getBytes, getCurrentProgram, getDataAfter, getDataAfter, getDataAt, getDataBefore, getDataBefore, getDataContaining, getDataTypes, getDouble, getEOLComment, getEquate, getEquate, getEquates, getFirstData, getFirstFunction, getFirstInstruction, getFirstInstruction, getFloat, getFragment, getFunction, getFunctionAfter, getFunctionAfter, getFunctionAt, getFunctionBefore, getFunctionBefore, getFunctionContaining, getGlobalFunctions, getInstructionAfter, getInstructionAfter, getInstructionAt, getInstructionBefore, getInstructionBefore, getInstructionContaining, getInt, getLastData, getLastFunction, getLastInstruction, getLong, getMemoryBlock, getMemoryBlock, getMemoryBlocks, getMonitor, getNamespace, getPlateComment, getPostComment, getPreComment, getProgramFile, getReference, getReference, getReferencesFrom, getReferencesTo, getRepeatableComment, getShort, getSymbol, getSymbolAfter, getSymbolAfter, getSymbolAt, getSymbolAt, getSymbolAt, getSymbolBefore, getSymbolBefore, getSymbols, getUndefinedDataAfter, getUndefinedDataAt, getUndefinedDataBefore, openDataTypeArchive, removeBookmark, removeData, removeDataAt, removeEntryPoint, removeEquate, removeEquate, removeEquates, removeFunction, removeFunctionAt, removeInstruction, removeInstructionAt, removeMemoryBlock, removeReference, removeSymbol, saveProgram, saveProgram, set, setByte, setBytes, setDouble, setEOLComment, setFloat, setInt, setLong, setPlateComment, setPostComment, setPreComment, setReferencePrimary, setReferencePrimary, setRepeatableComment, setShort, start, toAddr, toAddr, toAddr

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AbstractGhidraVersionTrackingScript

      public AbstractGhidraVersionTrackingScript()
  • Method Details

    • getVTSession

      protected VTSession getVTSession()
    • getSourceProgram

      protected ghidra.program.model.listing.Program getSourceProgram()
    • getDestinationProgram

      protected ghidra.program.model.listing.Program getDestinationProgram()
    • createVersionTrackingSession

      public VTSession createVersionTrackingSession(String sourceProgramPath, String destinationProgramPath) throws ghidra.util.exception.VersionException, ghidra.util.exception.CancelledException, IOException
      Throws:
      ghidra.util.exception.VersionException
      ghidra.util.exception.CancelledException
      IOException
    • createVersionTrackingSession

      public VTSession createVersionTrackingSession(String name, ghidra.program.model.listing.Program source, ghidra.program.model.listing.Program destination) throws IOException
      Throws:
      IOException
    • openVersionTrackingSession

      public VTSession openVersionTrackingSession(String path) throws ghidra.util.exception.VersionException, ghidra.util.exception.CancelledException, IOException
      Throws:
      ghidra.util.exception.VersionException
      ghidra.util.exception.CancelledException
      IOException
    • saveVersionTrackingSession

      public void saveVersionTrackingSession() throws IOException
      Throws:
      IOException
    • saveSessionAs

      public void saveSessionAs(String path, String name) throws ghidra.util.InvalidNameException, ghidra.util.exception.CancelledException, IOException
      Throws:
      ghidra.util.InvalidNameException
      ghidra.util.exception.CancelledException
      IOException
    • cleanup

      public void cleanup(boolean success)
      Overrides:
      cleanup in class ghidra.app.script.GhidraScript
    • closeVersionTrackingSession

      public void closeVersionTrackingSession()
      This will release the current session and both source and destination programs. If either program needs to be held it is the script's responsibility to first retain the instance and add itself as a consumer. Any program consumer must release it when done using it.
    • getSourceFunctions

      public Set<String> getSourceFunctions()
    • getDestinationFunctions

      public Set<String> getDestinationFunctions()
    • getProgramCorrelators

      public List<String> getProgramCorrelators()
    • runCorrelator

      public void runCorrelator(String name) throws ghidra.util.exception.CancelledException
      Throws:
      ghidra.util.exception.CancelledException
    • getMatchesFromLastRunCorrelator

      public Collection<VTMatch> getMatchesFromLastRunCorrelator()
    • getSourceFunction

      public ghidra.program.model.listing.Function getSourceFunction(VTMatch vtMatch)
    • getDestinationFunction

      public ghidra.program.model.listing.Function getDestinationFunction(VTMatch vtMatch)