當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。