java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.sig.codeless.MatchingState

@Ser public class MatchingState extends Object
Matching result (not necessarily final), between a target model and a reference model.
  • Field Details

  • Constructor Details

    • MatchingState

      public MatchingState()
  • Method Details

    • addConstraint

      public void addConstraint(Func targetFunc, Constraint constraint)
      Add a possible-reference constraint for a target function.
      Parameters:
      targetFunc - target function
      constraint - constraint to add
    • getModuleAt

      public Module getModuleAt(long address)
      Get the target module mapped at an address.
      Parameters:
      address - target address
      Returns:
      module containing the address, or null
    • getMatchedRangeStartAddress

      public long getMatchedRangeStartAddress()
      Get the start address of the matched range.
      Returns:
      matched range start address
    • getMatchedRangeEndAddress

      public long getMatchedRangeEndAddress()
      Get the end address of the matched range.
      Returns:
      matched range end address
    • deserialize

      public static MatchingState deserialize(String statePath)
      Deserialize a matching state from a file.
      Parameters:
      statePath - serialized state path
      Returns:
      deserialized matching state, or null
    • serialize

      public static void serialize(MatchingState state, String outFolder) throws IOException
      Serialize a matching state to the default file name in an output folder.
      Parameters:
      state - matching state to serialize
      outFolder - output folder
      Throws:
      IOException - if the state cannot be written
    • getIdentifiedRoutinesRange

      public Couple<Long,Long> getIdentifiedRoutinesRange()
      Get the address range containing identified routines.
      Returns:
      identified routines range, or null
    • setIdentifiedRoutinesRange

      public void setIdentifiedRoutinesRange(long startAddr, long endAddr)
      Set the address range containing identified routines.
      Parameters:
      startAddr - range start address
      endAddr - range end address
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getIdentifiedRoutines

      public BiMap<Func,Func> getIdentifiedRoutines()
      Get identified target-to-reference routines.
      Returns:
      identified routines map
    • setIdentifiedRoutines

      public void setIdentifiedRoutines(BiMap<Func,Func> identifiedRoutines)
      Set identified target-to-reference routines.
      Parameters:
      identifiedRoutines - identified routines map
    • getRoutinesConstraints

      public Map<Func,List<Constraint>> getRoutinesConstraints()
      Get constraints attached to target routines.
      Returns:
      routine constraints
    • setRoutinesConstraints

      public void setRoutinesConstraints(Map<Func,List<Constraint>> routinesConstraints)
      Set constraints attached to target routines.
      Parameters:
      routinesConstraints - routine constraints
    • getTargetModulesMapping

      public SegmentMap<Long,Module> getTargetModulesMapping()
      Get target modules mapped by address range.
      Returns:
      target modules mapping
    • setTargetModulesMapping

      public void setTargetModulesMapping(SegmentMap<Long,Module> targetModulesMapping)
      Set target modules mapped by address range.
      Parameters:
      targetModulesMapping - target modules mapping
    • getTargetModules

      public Map<ModuleId,Module> getTargetModules()
      Get target modules by identifier.
      Returns:
      target modules
    • setTargetModules

      public void setTargetModules(Map<ModuleId,Module> targetModules)
      Set target modules by identifier.
      Parameters:
      targetModules - target modules
    • getNonIdentifiableRoutines

      public Set<Func> getNonIdentifiableRoutines()
      Get routines that could not be identified.
      Returns:
      non-identifiable routines
    • setNonIdentifiableRoutines

      public void setNonIdentifiableRoutines(Set<Func> nonIdentifiableRoutines)
      Set routines that could not be identified.
      Parameters:
      nonIdentifiableRoutines - non-identifiable routines
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getRefMetadata

      public ExecutableModelMetadata getRefMetadata()
      Get reference model metadata.
      Returns:
      reference model metadata
    • setRefMetadata

      public void setRefMetadata(ExecutableModelMetadata refMetadata)
      Set reference model metadata.
      Parameters:
      refMetadata - reference model metadata
    • getResultLog

      public String getResultLog()
      Get the matching result log.
      Returns:
      result log, or null
    • setResultLog

      public void setResultLog(String resultLog)
      Set the matching result log.
      Parameters:
      resultLog - result log