Package soot.jimple.infoflow.results
Class InfoflowResults
java.lang.Object
soot.jimple.infoflow.results.InfoflowResults
- Direct Known Subclasses:
BackwardsInfoflowResults
Class for collecting information flow results
- Author:
- Steven Arzt
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected soot.util.MultiMap<ResultSinkInfo,ResultSourceInfo> protected booleanprotected InfoflowPerformanceDataprotected soot.util.MultiMap<ResultSinkInfo,ResultSourceInfo> static final intstatic final intstatic final intstatic final intstatic final intprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAll(Set<DataFlowResult> results) Adds the given data flow results to this result objectvoidaddAll(InfoflowResults results) Adds all results from the given data structure to this onevoidaddException(String ex) Adds an exception that has occurred during the data flow analysis to this result objectvoidaddPerformanceData(InfoflowPerformanceData performanceData) Adds the given performance data to this result objectvoidaddResult(Collection<ISourceSinkDefinition> sinkDefinitions, AccessPath sink, soot.jimple.Stmt sinkStmt, Collection<ISourceSinkDefinition> sourceDefinitions, AccessPath source, soot.jimple.Stmt sourceStmt) Collection<heros.solver.Pair<ResultSourceInfo,ResultSinkInfo>> addResult(Collection<ISourceSinkDefinition> sinkDefinitions, AccessPath sink, soot.jimple.Stmt sinkStmt, Collection<ISourceSinkDefinition> sourceDefinitions, AccessPath source, soot.jimple.Stmt sourceStmt, Object userData, List<Abstraction> propagationPath, InfoflowManager manager) Collection<heros.solver.Pair<ResultSourceInfo,ResultSinkInfo>> addResult(Collection<ISourceSinkDefinition> sinkDefinitions, AccessPath sink, soot.jimple.Stmt sinkStmt, Collection<ISourceSinkDefinition> sourceDefinitions, AccessPath source, soot.jimple.Stmt sourceStmt, Object userData, List<soot.jimple.Stmt> propagationPath, List<AccessPath> propagationAccessPath, List<soot.jimple.Stmt> propagationCallSites) Adds the given result to this data structureCollection<heros.solver.Pair<ResultSourceInfo,ResultSinkInfo>> addResult(Collection<ISourceSinkDefinition> sinkDefinitions, AccessPath sink, soot.jimple.Stmt sinkStmt, Collection<ISourceSinkDefinition> sourceDefinitions, AccessPath source, soot.jimple.Stmt sourceStmt, Object userData, List<soot.jimple.Stmt> propagationPath, List<AccessPath> propagationAccessPath, List<soot.jimple.Stmt> propagationCallSites, InfoflowManager manager) voidaddResult(DataFlowResult res) Adds the given data flow result to this data structurevoidaddResult(ResultSinkInfo sink, ResultSourceInfo source) Adds the given result to this data structurevoidclear()Removes all results from the data structurebooleancontainsSink(soot.jimple.Stmt sink) Checks whether this result object contains a sink that exactly matches the given value.booleancontainsSinkMethod(String sinkSignature) Checks whether this result object contains a sink with the given method signaturebooleansoot.util.MultiMap<ResultSinkInfo,ResultSourceInfo> Gets the additional data flow results in a flat setGets the exceptions that have happened during the data flow analysis.Gets the performance data on this FlowDroid runsoot.util.MultiMap<ResultSinkInfo,ResultSourceInfo> Gets all results in this object as a hash map from sinks to sets of sources.Gets the data flow results in a flat setintGets the termination state that describes whether the data flow analysis terminated normally or whether one or more phases terminated prematurely due to a timeout or an out-of-memory conditioninthashCode()booleanisEmpty()Gets whether this result object is empty, i.e. contains no information flowsbooleanisPathBetween(String sink, String source) Checks whether there is a path between the given source and sink.booleanisPathBetween(soot.jimple.Stmt sink, soot.jimple.Stmt source) Checks whether there is a path between the given source and sink.booleanisPathBetweenMethods(String sinkSignature, String sourceSignature) Checks whether there is an information flow between the two given methods (specified by their respective Soot signatures).intGets the total number of source-to-sink connections.voidPrints all results stored in this object to the standard outputvoidprintResults(Writer wr) Prints all results stored in this object to the given writervoidremove(DataFlowResult result) Removes the given data flow result from this result setvoidremove(ResultSinkInfo sink) Removes the given data flow result from this result setvoidremove(ResultSourceInfo source, ResultSinkInfo sink) Removes the given data flow result from this result setvoidremoveAll(Collection<ResultSinkInfo> sinks) Removes the given data flow result from this result setvoidsetPerformanceData(InfoflowPerformanceData performanceData) Sets the performance data on this FlowDroid runvoidsetTerminationState(int terminationState) Sets the termination state that describes whether the data flow analysis terminated normally or whether one or more phases terminated prematurely due to a timeout or an out-of-memory conditionintsize()Gets the number of entries in this result objecttoString()booleanGets whether the analysis was aborted due to a timeoutbooleanGets whether the analysis was terminated because it ran out of memory
-
Field Details
-
TERMINATION_SUCCESS
public static final int TERMINATION_SUCCESS- See Also:
-
TERMINATION_DATA_FLOW_TIMEOUT
public static final int TERMINATION_DATA_FLOW_TIMEOUT- See Also:
-
TERMINATION_DATA_FLOW_OOM
public static final int TERMINATION_DATA_FLOW_OOM- See Also:
-
TERMINATION_PATH_RECONSTRUCTION_TIMEOUT
public static final int TERMINATION_PATH_RECONSTRUCTION_TIMEOUT- See Also:
-
TERMINATION_PATH_RECONSTRUCTION_OOM
public static final int TERMINATION_PATH_RECONSTRUCTION_OOM- See Also:
-
results
-
additionalResults
-
performanceData
-
exceptions
-
terminationState
protected int terminationState -
pathAgnosticResults
protected volatile boolean pathAgnosticResults
-
-
Constructor Details
-
InfoflowResults
public InfoflowResults() -
InfoflowResults
public InfoflowResults(boolean pathAgnosticResults)
-
-
Method Details
-
getExceptions
Gets the exceptions that have happened during the data flow analysis. This collection is immutable.- Returns:
- exceptions that occurred during the data flow analysis
-
addException
Adds an exception that has occurred during the data flow analysis to this result object- Parameters:
ex- The exception to add
-
size
public int size()Gets the number of entries in this result object- Returns:
- The number of entries in this result object
-
numConnections
public int numConnections()Gets the total number of source-to-sink connections. If there are two connections along different paths between the same source and sink, size() will return 1, but numConnections() will return 2.- Returns:
- The number of source-to-sink connections in this result object
-
isEmpty
public boolean isEmpty()Gets whether this result object is empty, i.e. contains no information flows- Returns:
- True if this result object is empty, otherwise false.
-
containsSink
public boolean containsSink(soot.jimple.Stmt sink) Checks whether this result object contains a sink that exactly matches the given value.- Parameters:
sink- The sink to check for- Returns:
- True if this result contains the given value as a sink, otherwise false.
-
containsSinkMethod
Checks whether this result object contains a sink with the given method signature- Parameters:
sinkSignature- The method signature to check for- Returns:
- True if there is a sink with the given method signature in this result object, otherwise false.
-
addResult
public void addResult(Collection<ISourceSinkDefinition> sinkDefinitions, AccessPath sink, soot.jimple.Stmt sinkStmt, Collection<ISourceSinkDefinition> sourceDefinitions, AccessPath source, soot.jimple.Stmt sourceStmt) -
addResult
public Collection<heros.solver.Pair<ResultSourceInfo,ResultSinkInfo>> addResult(Collection<ISourceSinkDefinition> sinkDefinitions, AccessPath sink, soot.jimple.Stmt sinkStmt, Collection<ISourceSinkDefinition> sourceDefinitions, AccessPath source, soot.jimple.Stmt sourceStmt, Object userData, List<Abstraction> propagationPath, InfoflowManager manager) -
addResult
public Collection<heros.solver.Pair<ResultSourceInfo,ResultSinkInfo>> addResult(Collection<ISourceSinkDefinition> sinkDefinitions, AccessPath sink, soot.jimple.Stmt sinkStmt, Collection<ISourceSinkDefinition> sourceDefinitions, AccessPath source, soot.jimple.Stmt sourceStmt, Object userData, List<soot.jimple.Stmt> propagationPath, List<AccessPath> propagationAccessPath, List<soot.jimple.Stmt> propagationCallSites) Adds the given result to this data structure- Parameters:
sinkDefinitions- The definition of the sinksink- The access path that arrived at the sink statementsinkStmt- The sink statementsourceDefinitions- The definition of the sourcesource- The access path that originated from the source statementsourceStmt- The source statementuserData- Optional user data to associate with the sourcepropagationPath- The statements over which the data flow was propagatedpropagationAccessPath- The access paths along the data flow propagation path- Returns:
- The new data flow result
-
addResult
public Collection<heros.solver.Pair<ResultSourceInfo,ResultSinkInfo>> addResult(Collection<ISourceSinkDefinition> sinkDefinitions, AccessPath sink, soot.jimple.Stmt sinkStmt, Collection<ISourceSinkDefinition> sourceDefinitions, AccessPath source, soot.jimple.Stmt sourceStmt, Object userData, List<soot.jimple.Stmt> propagationPath, List<AccessPath> propagationAccessPath, List<soot.jimple.Stmt> propagationCallSites, InfoflowManager manager) -
addResult
Adds the given data flow result to this data structure- Parameters:
res- The data flow result to add
-
addResult
Adds the given result to this data structure- Parameters:
sink- The sink at which the taint arrivedsource- The source from which the taint originated
-
addAll
Adds all results from the given data structure to this one- Parameters:
results- The data structure from which to copy the results
-
addAll
Adds the given data flow results to this result object- Parameters:
results- The data flow results to add
-
getResults
Gets all results in this object as a hash map from sinks to sets of sources.- Returns:
- All results in this object as a hash map.
-
getAdditionalResults
-
getResultSet
Gets the data flow results in a flat set- Returns:
- The data flow results in a flat set. If no data flows are available, the return value is null.
-
getAdditionalResultSet
Gets the additional data flow results in a flat set- Returns:
- The additional data flow results in a flat set. If no data flows are available, the return value is null.
-
isPathBetween
public boolean isPathBetween(soot.jimple.Stmt sink, soot.jimple.Stmt source) Checks whether there is a path between the given source and sink.- Parameters:
sink- The sink to which there may be a pathsource- The source from which there may be a path- Returns:
- True if there is a path between the given source and sink, false otherwise
-
isPathBetween
Checks whether there is a path between the given source and sink.- Parameters:
sink- The sink to which there may be a pathsource- The source from which there may be a path- Returns:
- True if there is a path between the given source and sink, false otherwise
-
isPathBetweenMethods
Checks whether there is an information flow between the two given methods (specified by their respective Soot signatures).- Parameters:
sinkSignature- The sink to which there may be a pathsourceSignature- The source from which there may be a path- Returns:
- True if there is a path between the given source and sink, false otherwise
-
printResults
public void printResults()Prints all results stored in this object to the standard output -
printResults
Prints all results stored in this object to the given writer- Parameters:
wr- The writer to which to print the results- Throws:
IOException- Thrown when data writing fails
-
clear
public void clear()Removes all results from the data structure -
getTerminationState
public int getTerminationState()Gets the termination state that describes whether the data flow analysis terminated normally or whether one or more phases terminated prematurely due to a timeout or an out-of-memory condition- Returns:
- The termination state
-
setTerminationState
public void setTerminationState(int terminationState) Sets the termination state that describes whether the data flow analysis terminated normally or whether one or more phases terminated prematurely due to a timeout or an out-of-memory condition- Parameters:
terminationState- The termination state
-
wasAbortedTimeout
public boolean wasAbortedTimeout()Gets whether the analysis was aborted due to a timeout- Returns:
- True if the analysis was aborted due to a timeout, otherwise false
-
wasTerminatedOutOfMemory
public boolean wasTerminatedOutOfMemory()Gets whether the analysis was terminated because it ran out of memory- Returns:
- True if the analysis was terminated because it ran out of memory, otherwise false
-
getPerformanceData
Gets the performance data on this FlowDroid run- Returns:
- The performance data on this FlowDroid run
-
setPerformanceData
Sets the performance data on this FlowDroid run- Parameters:
performanceData- The performance data on this FlowDroid run
-
addPerformanceData
Adds the given performance data to this result object- Parameters:
performanceData- The performance data to add
-
remove
Removes the given data flow result from this result set- Parameters:
result- The result to remove
-
remove
Removes the given data flow result from this result set- Parameters:
sink-source-
-
remove
Removes the given data flow result from this result set- Parameters:
sink-
-
removeAll
Removes the given data flow result from this result set- Parameters:
sinks-
-
toString
-
hashCode
public int hashCode() -
equals
-