Class MatchingState
java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.sig.codeless.MatchingState
Matching result (not necessarily final), between a target model and a reference model.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault serialized matching state file name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConstraint(Func targetFunc, Constraint constraint) Add a possible-reference constraint for a target function.static MatchingStatedeserialize(String statePath) Deserialize a matching state from a file.booleanGet identified target-to-reference routines.Get the address range containing identified routines.longGet the end address of the matched range.longGet the start address of the matched range.getModuleAt(long address) Get the target module mapped at an address.Get routines that could not be identified.Get reference model metadata.Get the matching result log.Get constraints attached to target routines.Get target modules by identifier.Get target modules mapped by address range.inthashCode()static voidserialize(MatchingState state, String outFolder) Serialize a matching state to the default file name in an output folder.voidsetIdentifiedRoutines(BiMap<Func, Func> identifiedRoutines) Set identified target-to-reference routines.voidsetIdentifiedRoutinesRange(long startAddr, long endAddr) Set the address range containing identified routines.voidsetNonIdentifiableRoutines(Set<Func> nonIdentifiableRoutines) Set routines that could not be identified.voidsetRefMetadata(ExecutableModelMetadata refMetadata) Set reference model metadata.voidsetResultLog(String resultLog) Set the matching result log.voidsetRoutinesConstraints(Map<Func, List<Constraint>> routinesConstraints) Set constraints attached to target routines.voidsetTargetModules(Map<ModuleId, Module> targetModules) Set target modules by identifier.voidsetTargetModulesMapping(SegmentMap<Long, Module> targetModulesMapping) Set target modules mapped by address range.toString()
-
Field Details
-
DEFAULT_NAME
Default serialized matching state file name.- See Also:
-
-
Constructor Details
-
MatchingState
public MatchingState()
-
-
Method Details
-
addConstraint
Add a possible-reference constraint for a target function.- Parameters:
targetFunc- target functionconstraint- constraint to add
-
getModuleAt
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
Deserialize a matching state from a file.- Parameters:
statePath- serialized state path- Returns:
- deserialized matching state, or null
-
serialize
Serialize a matching state to the default file name in an output folder.- Parameters:
state- matching state to serializeoutFolder- output folder- Throws:
IOException- if the state cannot be written
-
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 addressendAddr- range end address
-
toString
-
getIdentifiedRoutines
Get identified target-to-reference routines.- Returns:
- identified routines map
-
setIdentifiedRoutines
Set identified target-to-reference routines.- Parameters:
identifiedRoutines- identified routines map
-
getRoutinesConstraints
Get constraints attached to target routines.- Returns:
- routine constraints
-
setRoutinesConstraints
Set constraints attached to target routines.- Parameters:
routinesConstraints- routine constraints
-
getTargetModulesMapping
Get target modules mapped by address range.- Returns:
- target modules mapping
-
setTargetModulesMapping
Set target modules mapped by address range.- Parameters:
targetModulesMapping- target modules mapping
-
getTargetModules
Get target modules by identifier.- Returns:
- target modules
-
setTargetModules
Set target modules by identifier.- Parameters:
targetModules- target modules
-
getNonIdentifiableRoutines
Get routines that could not be identified.- Returns:
- non-identifiable routines
-
setNonIdentifiableRoutines
Set routines that could not be identified.- Parameters:
nonIdentifiableRoutines- non-identifiable routines
-
hashCode
public int hashCode() -
equals
-
getRefMetadata
Get reference model metadata.- Returns:
- reference model metadata
-
setRefMetadata
Set reference model metadata.- Parameters:
refMetadata- reference model metadata
-
getResultLog
Get the matching result log.- Returns:
- result log, or null
-
setResultLog
Set the matching result log.- Parameters:
resultLog- result log
-