All Downloads are FREE. Search and download functionalities are using the official Maven repository.

soot.jimple.infoflow.taintWrappers.RecordingTaintWrapper Maven / Gradle / Ivy

There is a newer version: 2.9.0
Show newest version
package soot.jimple.infoflow.taintWrappers;

import java.util.HashSet;
import java.util.Set;

import soot.SootMethod;
import soot.jimple.Stmt;
import soot.jimple.infoflow.data.Abstraction;
import soot.jimple.infoflow.data.AccessPath;

/**
 * Taint wrapper that does not actually provide a library model, but that counts
 * various statistics and evaluation data. It is not exclusive for any method
 * and never returns any taints.
 * 
 * @author Steven Arzt
 *
 */
public class RecordingTaintWrapper extends AbstractTaintWrapper {

	private final Set targetMethods = new HashSet<>();

	@Override
	public Set getAliasesForMethod(Stmt stmt, Abstraction d1, Abstraction taintedPath) {
		return null;
	}

	@Override
	public boolean supportsCallee(SootMethod method) {
		return false;
	}

	@Override
	public boolean supportsCallee(Stmt callSite) {
		return false;
	}

	@Override
	protected boolean isExclusiveInternal(Stmt stmt, AccessPath taintedPath) {
		return false;
	}

	@Override
	public Set getTaintsForMethodInternal(Stmt stmt, AccessPath taintedPath) {
		if (stmt.containsInvokeExpr())
			targetMethods.add(stmt.getInvokeExpr().getMethod());
		return null;
	}

	/**
	 * Gets the set with all methods for which this taint wrapper was queried
	 * 
	 * @return A set containing all methods for which this taint wrapper was queried
	 */
	public Set getCallees() {
		return this.targetMethods;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy