From f5ab379cd7a7f4fb87e26a3553f24d847afd96f7 Mon Sep 17 00:00:00 2001 From: Sven Meyer Date: Mon, 16 Dec 2024 12:20:39 +0100 Subject: [PATCH] Remove old visualization --- .../java/crypto/analysis/CryptoScanner.java | 7 ---- .../java/crypto/analysis/SeedGenerator.java | 8 ---- .../crypto/typestate/TypestateAnalysis.java | 8 ++-- .../crypto/typestate/TypestateDefinition.java | 5 --- .../iem/scanner/HeadlessJavaScanner.java | 38 ------------------- 5 files changed, 3 insertions(+), 63 deletions(-) diff --git a/CryptoAnalysis/src/main/java/crypto/analysis/CryptoScanner.java b/CryptoAnalysis/src/main/java/crypto/analysis/CryptoScanner.java index 4195b8e40..ac38d2798 100644 --- a/CryptoAnalysis/src/main/java/crypto/analysis/CryptoScanner.java +++ b/CryptoAnalysis/src/main/java/crypto/analysis/CryptoScanner.java @@ -1,7 +1,5 @@ package crypto.analysis; -import boomerang.Query; -import boomerang.debugger.Debugger; import boomerang.scene.CallGraph; import boomerang.scene.DataFlowScope; import boomerang.scene.Method; @@ -28,7 +26,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import typestate.TransitionFunction; public abstract class CryptoScanner { @@ -175,10 +172,6 @@ protected DataFlowScope createDataFlowScope() { return new CryptoAnalysisDataFlowScope(ruleset, Collections.emptySet()); } - public Debugger debugger(Query query) { - return new Debugger<>(); - } - public SparseCFGCache.SparsificationStrategy getSparsificationStrategy() { return SparseCFGCache.SparsificationStrategy.NONE; } diff --git a/CryptoAnalysis/src/main/java/crypto/analysis/SeedGenerator.java b/CryptoAnalysis/src/main/java/crypto/analysis/SeedGenerator.java index e14f4ef1f..669f08066 100644 --- a/CryptoAnalysis/src/main/java/crypto/analysis/SeedGenerator.java +++ b/CryptoAnalysis/src/main/java/crypto/analysis/SeedGenerator.java @@ -1,6 +1,5 @@ package crypto.analysis; -import boomerang.debugger.Debugger; import boomerang.results.ForwardBoomerangResults; import boomerang.scene.CallGraph; import boomerang.scene.DataFlowScope; @@ -10,7 +9,6 @@ import crypto.typestate.TypestateAnalysis; import crypto.typestate.TypestateDefinition; import crysl.rule.CrySLRule; -import ideal.IDEALSeedSolver; import java.util.Collection; import java.util.Collections; import java.util.HashSet; @@ -42,12 +40,6 @@ public DataFlowScope getDataFlowScope() { return scanner.getDataFlowScope(); } - @Override - public Debugger getDebugger( - IDEALSeedSolver idealSeedSolver) { - return scanner.debugger(idealSeedSolver.getSeed()); - } - @Override public int getTimeout() { return scanner.getTimeout(); diff --git a/CryptoAnalysis/src/main/java/crypto/typestate/TypestateAnalysis.java b/CryptoAnalysis/src/main/java/crypto/typestate/TypestateAnalysis.java index bf041a297..b603adee6 100644 --- a/CryptoAnalysis/src/main/java/crypto/typestate/TypestateAnalysis.java +++ b/CryptoAnalysis/src/main/java/crypto/typestate/TypestateAnalysis.java @@ -46,11 +46,10 @@ public void runTypestateAnalysis() { Collection seeds = analysisScope.computeSeeds(); for (Query seed : seeds) { - if (!(seed instanceof ForwardSeedQuery)) { + if (!(seed instanceof ForwardSeedQuery query)) { continue; } - ForwardSeedQuery query = (ForwardSeedQuery) seed; runTypestateAnalysisForSeed(query); } } @@ -90,7 +89,7 @@ public CallGraph callGraph() { @Override public Debugger debugger( IDEALSeedSolver idealSeedSolver) { - return definition.getDebugger(idealSeedSolver); + return new Debugger<>(); } @Override @@ -118,11 +117,10 @@ public Map> getRes WeightedForwardQuery, ForwardBoomerangResults> entry : resultHandler.getResults().entrySet()) { - if (!(entry.getKey() instanceof ForwardSeedQuery)) { + if (!(entry.getKey() instanceof ForwardSeedQuery forwardSeedQuery)) { continue; } - ForwardSeedQuery forwardSeedQuery = (ForwardSeedQuery) entry.getKey(); results.put(forwardSeedQuery, entry.getValue()); } return results; diff --git a/CryptoAnalysis/src/main/java/crypto/typestate/TypestateDefinition.java b/CryptoAnalysis/src/main/java/crypto/typestate/TypestateDefinition.java index ed39b3f1c..5c7a76572 100644 --- a/CryptoAnalysis/src/main/java/crypto/typestate/TypestateDefinition.java +++ b/CryptoAnalysis/src/main/java/crypto/typestate/TypestateDefinition.java @@ -1,12 +1,9 @@ package crypto.typestate; -import boomerang.debugger.Debugger; import boomerang.scene.CallGraph; import boomerang.scene.DataFlowScope; import crysl.rule.CrySLRule; -import ideal.IDEALSeedSolver; import java.util.Collection; -import typestate.TransitionFunction; public interface TypestateDefinition { @@ -16,7 +13,5 @@ public interface TypestateDefinition { DataFlowScope getDataFlowScope(); - Debugger getDebugger(IDEALSeedSolver idealSeedSolver); - int getTimeout(); } diff --git a/HeadlessJavaScanner/src/main/java/de/fraunhofer/iem/scanner/HeadlessJavaScanner.java b/HeadlessJavaScanner/src/main/java/de/fraunhofer/iem/scanner/HeadlessJavaScanner.java index 98bd07208..3b9b038e8 100644 --- a/HeadlessJavaScanner/src/main/java/de/fraunhofer/iem/scanner/HeadlessJavaScanner.java +++ b/HeadlessJavaScanner/src/main/java/de/fraunhofer/iem/scanner/HeadlessJavaScanner.java @@ -1,8 +1,5 @@ package de.fraunhofer.iem.scanner; -import boomerang.Query; -import boomerang.debugger.Debugger; -import boomerang.debugger.IDEVizDebugger; import boomerang.scene.CallGraph; import boomerang.scene.DataFlowScope; import boomerang.scene.sparse.SparseCFGCache; @@ -17,14 +14,12 @@ import de.fraunhofer.iem.framework.SootSetup; import de.fraunhofer.iem.framework.SootUpSetup; import de.fraunhofer.iem.scanner.ScannerSettings.CallGraphAlgorithm; -import java.io.File; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import typestate.TransitionFunction; public class HeadlessJavaScanner extends CryptoScanner { @@ -68,39 +63,6 @@ public DataFlowScope createDataFlowScope() { return new CryptoAnalysisDataFlowScope(super.getRuleset(), getIgnoredSections()); } - @Override - public Debugger debugger(Query query) { - if (settings.isVisualization()) { - - if (settings.getReportDirectory() == null) { - LOGGER.error( - "The visualization requires the --reportPath option. Disabling visualization..."); - return new Debugger<>(); - } - - File vizFile = - new File( - settings.getReportDirectory() - + File.separator - + "viz" - + File.separator - + query.var().getVariableName() - + ".json"); - boolean created = vizFile.getParentFile().mkdirs(); - - if (!created) { - LOGGER.error( - "Could not create directory {}. Disabling visualization...", - vizFile.getAbsolutePath()); - return new Debugger<>(); - } - - return new IDEVizDebugger<>(vizFile); - } - - return new Debugger<>(); - } - @Override public SparseCFGCache.SparsificationStrategy getSparsificationStrategy() { switch (settings.getSparseStrategy()) {