当前位置: 首页>>代码示例>>Java>>正文


Java PathBuilder类代码示例

本文整理汇总了Java中soot.jimple.infoflow.data.pathBuilders.DefaultPathBuilderFactory.PathBuilder的典型用法代码示例。如果您正苦于以下问题:Java PathBuilder类的具体用法?Java PathBuilder怎么用?Java PathBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PathBuilder类属于soot.jimple.infoflow.data.pathBuilders.DefaultPathBuilderFactory包,在下文中一共展示了PathBuilder类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: runAnalysis

import soot.jimple.infoflow.data.pathBuilders.DefaultPathBuilderFactory.PathBuilder; //导入依赖的package包/类
private void runAnalysis(final Set<Unit> targetUnits) {
		try {
			Scene.v().getOrMakeFastHierarchy();
			
			InplaceInfoflow infoflow = new InplaceInfoflow();
//			InfoflowConfiguration.setAccessPathLength(2);
			infoflow.setPathBuilderFactory(new DefaultPathBuilderFactory(
					PathBuilder.ContextSensitive, true));
			infoflow.setTaintWrapper(new EasyTaintWrapper(TAINT_WRAPPER_PATH));
			infoflow.getConfig().setEnableExceptionTracking(false);
			infoflow.getConfig().setEnableArraySizeTainting(false);
//			infoflow.getConfig().setCallgraphAlgorithm(CallgraphAlgorithm.CHA);
			
			System.out.println("Running data flow analysis...");
			PermissionMethodParser pmp = PermissionMethodParser.fromFile(SOURCES_SINKS_FILE);
			AccessPathBasedSourceSinkManager srcSinkManager =
					new AccessPathBasedSourceSinkManager(pmp.getSources(), pmp.getSinks());
			
			infoflow.addResultsAvailableHandler(new FuzzerResultsAvailableHandler(pmp.getSources(),
					targetUnits));
			infoflow.runAnalysis(srcSinkManager);
		}
		catch (IOException ex) {
			throw new RuntimeException("Could not read source/sink file", ex);
		}
	}
 
开发者ID:srasthofer,项目名称:FuzzDroid,代码行数:27,代码来源:SmartConstantDataExtractorFuzzyAnalysis.java

示例2: runDataflowAnalysis

import soot.jimple.infoflow.data.pathBuilders.DefaultPathBuilderFactory.PathBuilder; //导入依赖的package包/类
private void runDataflowAnalysis() {
		try{
			Scene.v().getOrMakeFastHierarchy();
			
			InplaceInfoflow infoflow = new InplaceInfoflow();	
			infoflow.setPathBuilderFactory(new DefaultPathBuilderFactory(
					PathBuilder.ContextSensitive, true));
			infoflow.setTaintWrapper(new EasyTaintWrapper(TAINT_WRAPPER_PATH));
			infoflow.getConfig().setEnableExceptionTracking(false);
			infoflow.getConfig().setEnableArraySizeTainting(false);
//			infoflow.getConfig().setCallgraphAlgorithm(CallgraphAlgorithm.CHA);
			
			System.out.println("Running data flow analysis...");
			PermissionMethodParser pmp = PermissionMethodParser.fromFile(SOURCES_SINKS_FILE);
			AccessPathBasedSourceSinkManager srcSinkManager =
					new AccessPathBasedSourceSinkManager(pmp.getSources(), pmp.getSinks());
						
			infoflow.addResultsAvailableHandler(new StringToPrimitiveTypeExtractorDataflowHandler(valuesToFuzz));
			infoflow.runAnalysis(srcSinkManager);
		}catch(Exception ex) {
			ex.printStackTrace();
		}
	}
 
开发者ID:srasthofer,项目名称:FuzzDroid,代码行数:24,代码来源:StringToPrimitiveTypeFuzzer.java

示例3: runDataflowAnalysis

import soot.jimple.infoflow.data.pathBuilders.DefaultPathBuilderFactory.PathBuilder; //导入依赖的package包/类
private void runDataflowAnalysis() {
		try{
			Scene.v().getOrMakeFastHierarchy();
			
			InplaceInfoflow infoflow = new InplaceInfoflow();
//			InfoflowConfiguration.setAccessPathLength(2);
			infoflow.setPathBuilderFactory(new DefaultPathBuilderFactory(
					PathBuilder.ContextSensitive, true));
			infoflow.setTaintWrapper(new EasyTaintWrapper(TAINT_WRAPPER_PATH));
			infoflow.getConfig().setEnableExceptionTracking(false);
			infoflow.getConfig().setEnableArraySizeTainting(false);
//			infoflow.getConfig().setCallgraphAlgorithm(CallgraphAlgorithm.CHA);
			
			System.out.println("Running data flow analysis...");
			PermissionMethodParser pmp = PermissionMethodParser.fromFile(SOURCES_SINKS_FILE);
			AccessPathBasedSourceSinkManager srcSinkManager =
					new AccessPathBasedSourceSinkManager(pmp.getSources(), pmp.getSinks());
			
			infoflow.addResultsAvailableHandler(new FileFuzzerResultsAvailableHandler(fileFormatsFromDataflow));
			infoflow.runAnalysis(srcSinkManager);
		}catch(Exception ex) {
			ex.printStackTrace();
		}
	}
 
开发者ID:srasthofer,项目名称:FuzzDroid,代码行数:25,代码来源:FileFuzzer.java

示例4: multiSinkTest2

import soot.jimple.infoflow.data.pathBuilders.DefaultPathBuilderFactory.PathBuilder; //导入依赖的package包/类
@Test(timeout=300000)
public void multiSinkTest2() {
   	boolean oldPathAgnosticResults = Infoflow.getPathAgnosticResults();
   	try {
    	Infoflow infoflow = initInfoflow();
    	List<String> epoints = new ArrayList<String>();
    	epoints.add("<soot.jimple.infoflow.test.OtherTestCode: void multiSinkTest2()>");
    	Infoflow.setPathAgnosticResults(false);
    	infoflow.setPathBuilderFactory(new DefaultPathBuilderFactory(PathBuilder.ContextSensitive,
    			true));
		infoflow.computeInfoflow(appPath, libPath, epoints, sources, sinks);
		checkInfoflow(infoflow, 1);
		Assert.assertTrue(infoflow.getResults().isPathBetweenMethods(sink, sourceDeviceId));
		Assert.assertEquals(2, infoflow.getResults().numConnections());
   	}
   	finally {
   		Infoflow.setPathAgnosticResults(oldPathAgnosticResults);
   	}
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:20,代码来源:OtherTests.java

示例5: pathAlgorithmToString

import soot.jimple.infoflow.data.pathBuilders.DefaultPathBuilderFactory.PathBuilder; //导入依赖的package包/类
private static String pathAlgorithmToString(PathBuilder pathBuilder) {
	switch (pathBuilder) {
		case ContextSensitive:
			return "CONTEXTSENSITIVE";
		case ContextInsensitive :
			return "CONTEXTINSENSITIVE";
		case ContextInsensitiveSourceFinder :
			return "SOURCESONLY";
		default :
			return "UNKNOWN";
	}
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:13,代码来源:Test.java

示例6: setPathBuilder

import soot.jimple.infoflow.data.pathBuilders.DefaultPathBuilderFactory.PathBuilder; //导入依赖的package包/类
/**
 * Sets the algorithm to be used for reconstructing the paths between sources and sinks
 * 
 * @param builder
 *            The path reconstruction algorithm to be used
 */
public void setPathBuilder(PathBuilder builder) {
	this.pathBuilder = builder;
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:10,代码来源:SetupApplication.java


注:本文中的soot.jimple.infoflow.data.pathBuilders.DefaultPathBuilderFactory.PathBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。