public class MethodSourceSinkDefinition extends AbstractSourceSinkDefinition implements IAccessPathBasedSourceSinkDefinition
| 限定符和类型 | 类和说明 |
|---|---|
static class |
MethodSourceSinkDefinition.CallType
Enumeration containing the different types of method invocations that can be
defined as sources or sinks
|
| 限定符和类型 | 字段和说明 |
|---|---|
protected Set<AccessPathTuple> |
baseObjects |
protected MethodSourceSinkDefinition.CallType |
callType |
protected SootMethodAndClass |
method |
protected Set<AccessPathTuple>[] |
parameters |
protected Set<AccessPathTuple> |
returnValues |
category| 限定符和类型 | 方法和说明 |
|---|---|
void |
addParameterDefinition(int paramIdx,
Set<AccessPathTuple> paramDefs)
Adds the given access path tuples to this source/sink definition for the
given parameter index
|
protected MethodSourceSinkDefinition |
buildNewDefinition(Set<AccessPathTuple> baseAPTs,
Set<AccessPathTuple>[] paramAPTs,
Set<AccessPathTuple> returnAPTs)
Factory method for creating a new method-based source/sink definition based
on the current one.
|
protected MethodSourceSinkDefinition |
buildNewDefinition(SootMethodAndClass methodAndclass,
Set<AccessPathTuple> filteredBaseObjects,
Set<AccessPathTuple>[] filteredParameters,
Set<AccessPathTuple> filteredReturnValues,
MethodSourceSinkDefinition.CallType callType) |
static MethodSourceSinkDefinition |
createParameterSource(int index,
MethodSourceSinkDefinition.CallType callType)
Creates a source definition that considers a parameter as tainted
|
static MethodSourceSinkDefinition |
createReturnSource(MethodSourceSinkDefinition.CallType callType)
Creates a source definition that considers the return value as tainted
|
boolean |
equals(Object obj) |
MethodSourceSinkDefinition |
filter(Collection<AccessPathTuple> accessPaths)
Filters the source/sink definition to only reference the given access paths
|
Set<AccessPathTuple> |
getAllAccessPaths()
Gets all access paths referenced in this source or sink definition,
regardless of their respective semantics
|
int |
getBaseObjectCount()
Gets the number of access paths defined as sources or sinks on base objects
|
Set<AccessPathTuple> |
getBaseObjects()
Gets the source and sink definitions for the base object on which a method of
this class is invoked
|
MethodSourceSinkDefinition |
getBaseObjectSink()
Gets the shared sink definition that is not associated with any method and
taints the base object
|
MethodSourceSinkDefinition |
getBaseObjectSource()
Gets the shared source definition that is not associated with any method and
taints the base object
|
MethodSourceSinkDefinition.CallType |
getCallType()
Gets the type of method invocations that are denoted by this source or sink
|
SootMethodAndClass |
getMethod()
Gets the method for which this object defines sources and sinks
|
int |
getParameterCount()
Gets the number of access paths defined as sources or sinks on parameters
|
Set<AccessPathTuple>[] |
getParameters()
Gets the source and sink definitions for parameters of the current method
|
int |
getReturnValueCount()
Gets the number of access paths defined as sources or sinks on return values
|
Set<AccessPathTuple> |
getReturnValues()
Gets the source definitions for the return value of the current method
|
MethodSourceSinkDefinition |
getSinkOnlyDefinition()
Creates a definition which is a subset of this definition that only contains
the sinks
|
MethodSourceSinkDefinition |
getSourceOnlyDefinition()
Creates a definition which is a subset of this definition that only contains
the sources
|
int |
hashCode() |
boolean |
isEmpty()
Checks whether this source/sink definition is empty, i.e., has no concrete
access paths
|
void |
merge(ISourceSinkDefinition other)
Merges the source and sink definitions of the given definition object into
this definition object
|
MethodSourceSinkDefinition |
simplify()
Checks whether this definition is equivalent to one of the simple predefined
ones.
|
String |
toString() |
getCategory, setCategorygetCategory, setCategoryprotected final SootMethodAndClass method
protected final MethodSourceSinkDefinition.CallType callType
protected Set<AccessPathTuple> baseObjects
protected Set<AccessPathTuple>[] parameters
protected Set<AccessPathTuple> returnValues
public MethodSourceSinkDefinition(Set<AccessPathTuple> baseObjects, Set<AccessPathTuple>[] parameters, Set<AccessPathTuple> returnValues, MethodSourceSinkDefinition.CallType callType)
MethodSourceSinkDefinition class
without a method. This constructor is intended to be used for sources that
arise from UI elements or other programming constructs that are not directly
associated with a single method being called.public MethodSourceSinkDefinition(SootMethodAndClass am)
MethodSourceSinkDefinition classam - The method for which this object defines sources and sinkspublic MethodSourceSinkDefinition(SootMethodAndClass am, MethodSourceSinkDefinition.CallType callType)
MethodSourceSinkDefinition classam - The method for which this object defines sources and sinkscallType - The type of calls to define as sources or sinkspublic MethodSourceSinkDefinition(SootMethodAndClass am, Set<AccessPathTuple> baseObjects, Set<AccessPathTuple>[] parameters, Set<AccessPathTuple> returnValues, MethodSourceSinkDefinition.CallType callType)
am - The method for which this object defines sources and
sinksbaseObjects - The source and sink definitions for the base object on
which a method of this class is invokedparameters - The source and sink definitions for parameters of the
current methodcallType - The type of calls to define as sources or sinksreturnValues - The source definitions for the return value of the
current methodpublic MethodSourceSinkDefinition(SootMethodAndClass am, Set<AccessPathTuple> baseObjects, Set<AccessPathTuple>[] parameters, Set<AccessPathTuple> returnValues, MethodSourceSinkDefinition.CallType callType, ISourceSinkCategory category)
am - The method for which this object defines sources and
sinksbaseObjects - The source and sink definitions for the base object on
which a method of this class is invokedparameters - The source and sink definitions for parameters of the
current methodreturnValues - The source definitions for the return value of the
current methodcallType - The type of calls to define as sources or sinkscategory - The category to which this source or sink belongspublic SootMethodAndClass getMethod()
public MethodSourceSinkDefinition.CallType getCallType()
public Set<AccessPathTuple> getBaseObjects()
public int getBaseObjectCount()
public Set<AccessPathTuple>[] getParameters()
public int getParameterCount()
public Set<AccessPathTuple> getReturnValues()
public int getReturnValueCount()
public boolean isEmpty()
IAccessPathBasedSourceSinkDefinitionisEmpty 在接口中 IAccessPathBasedSourceSinkDefinitionisEmpty 在接口中 ISourceSinkDefinitionpublic MethodSourceSinkDefinition getSourceOnlyDefinition()
IAccessPathBasedSourceSinkDefinitiongetSourceOnlyDefinition 在接口中 IAccessPathBasedSourceSinkDefinitiongetSourceOnlyDefinition 在接口中 ISourceSinkDefinitionpublic MethodSourceSinkDefinition getSinkOnlyDefinition()
IAccessPathBasedSourceSinkDefinitiongetSinkOnlyDefinition 在接口中 IAccessPathBasedSourceSinkDefinitiongetSinkOnlyDefinition 在接口中 ISourceSinkDefinitionprotected MethodSourceSinkDefinition buildNewDefinition(Set<AccessPathTuple> baseAPTs, Set<AccessPathTuple>[] paramAPTs, Set<AccessPathTuple> returnAPTs)
baseAPTs - The access paths rooted in the base objectparamAPTs - The access paths rooted in the method's parametersreturnAPTs - The access paths rooted in the return valueprotected MethodSourceSinkDefinition buildNewDefinition(SootMethodAndClass methodAndclass, Set<AccessPathTuple> filteredBaseObjects, Set<AccessPathTuple>[] filteredParameters, Set<AccessPathTuple> filteredReturnValues, MethodSourceSinkDefinition.CallType callType)
public void merge(ISourceSinkDefinition other)
ISourceSinkDefinitionmerge 在接口中 ISourceSinkDefinitionother - The definition object to mergepublic void addParameterDefinition(int paramIdx,
Set<AccessPathTuple> paramDefs)
paramIdx - The parameter indexparamDefs - The access path tuplespublic MethodSourceSinkDefinition getBaseObjectSource()
public MethodSourceSinkDefinition getBaseObjectSink()
public int hashCode()
hashCode 在类中 AbstractSourceSinkDefinitionpublic boolean equals(Object obj)
equals 在类中 AbstractSourceSinkDefinitionpublic static MethodSourceSinkDefinition createParameterSource(int index, MethodSourceSinkDefinition.CallType callType)
index - The index of the parameter to consider as taintedcallType - The type of callpublic static MethodSourceSinkDefinition createReturnSource(MethodSourceSinkDefinition.CallType callType)
callType - The type of callpublic MethodSourceSinkDefinition simplify()
public Set<AccessPathTuple> getAllAccessPaths()
IAccessPathBasedSourceSinkDefinitiongetAllAccessPaths 在接口中 IAccessPathBasedSourceSinkDefinitionpublic MethodSourceSinkDefinition filter(Collection<AccessPathTuple> accessPaths)
IAccessPathBasedSourceSinkDefinitionfilter 在接口中 IAccessPathBasedSourceSinkDefinitionaccessPaths - The access path to which to limit the scope of this
source/sink definitionCopyright © 2022 Fraunhofer SIT. All rights reserved.