Class ImpliedMatchUtils

java.lang.Object
ghidra.feature.vt.gui.util.ImpliedMatchUtils

public class ImpliedMatchUtils extends Object
Utility class for finding version tracking implied matches given an accepted matched function. Each referenced data and function that exist in equivalent sections of the matched source and destination functions will added to the current version tracking session as an implied match.
  • Constructor Details

    • ImpliedMatchUtils

      public ImpliedMatchUtils()
  • Method Details

    • updateImpliedMatchForAcceptedAssocation

      public static void updateImpliedMatchForAcceptedAssocation(ghidra.program.model.listing.Function sourceFunction, ghidra.program.model.listing.Function destinationFunction, VTSession session, AddressCorrelatorManager correlatorManager, ghidra.util.task.TaskMonitor monitor) throws ghidra.util.exception.CancelledException
      Called when a VTAssociation is accepted. This method will create implied matches in the current session based on the association.
      Parameters:
      sourceFunction - The matched function from the source program
      destinationFunction - The matched function from the destination program
      session - The Version Tracking session
      correlatorManager - Keeps track of which section of the source function corresponds to the which section of the destination function
      monitor - Handles user cancellations
      Throws:
      ghidra.util.exception.CancelledException - if cancelled
    • updateImpliedMatchForClearedAssocation

      public static void updateImpliedMatchForClearedAssocation(ghidra.program.model.listing.Function sourceFunction, ghidra.program.model.listing.Function destinationFunction, VTSession session, AddressCorrelatorManager correlatorManager, ghidra.util.task.TaskMonitor monitor) throws ghidra.util.exception.CancelledException
      Called when a VTAssociation is cleared. This method will create implied matches in the current session based on the association.
      Parameters:
      sourceFunction - The matched function from the source program
      destinationFunction - The matched function from the destination program
      session - The Version Tracking session
      correlatorManager - Keeps track of which section of the source function corresponds to the which section of the destination function
      monitor - Handles user cancellations
      Throws:
      ghidra.util.exception.CancelledException - if cancelled
    • findImpliedMatches

      public static Set<VTImpliedMatchInfo> findImpliedMatches(ghidra.program.model.listing.Function sourceFunction, ghidra.program.model.listing.Function destinationFunction, VTSession session, AddressCorrelatorManager correlatorManager, ghidra.util.task.TaskMonitor monitor) throws ghidra.util.exception.CancelledException
      Method for finding version tracking implied matches given an accepted matched function. Each referenced data and function that exist in equivalent sections of the matched source and destination functions will be returned in the given set.
      Parameters:
      sourceFunction - The matched function from the source program
      destinationFunction - The matched function from the destination program
      session - The Version Tracking session
      correlatorManager - Keeps track of which section of the source function corresponds to the which section of the destination function
      monitor - Handles user cancellations
      Returns:
      a set of VTImpliedMatchInfo objects
      Throws:
      ghidra.util.exception.CancelledException - if cancelled
    • resolveImpliedMatch

      public static VTMatch resolveImpliedMatch(VTImpliedMatchInfo impliedMatch, VTSession session)
      Returns an existing match that best correlates to the implied match; returns null if no existing match can be found.
      Parameters:
      impliedMatch - The implied match for which to find a real match
      session - The session to search for the match
      Returns:
      an existing match that best correlates to the implied match; returns null if no existing match can be found.
    • getSourceFunction

      public static ghidra.program.model.listing.Function getSourceFunction(VTSession session, VTAssociation association)
      Returns the source function given a version tracking session and association pair
      Parameters:
      session - The Version Tracking session
      association - The association pair for a match
      Returns:
      the source function given a version tracking session and association pair
    • getDestinationFunction

      public static ghidra.program.model.listing.Function getDestinationFunction(VTSession session, VTAssociation association)
      Returns the destination function given a version tracking session and association pair
      Parameters:
      session - The Version Tracking session
      association - The association pair for a match
      Returns:
      the destination function given a version tracking session and association pair