Skip to content

Commit

Permalink
Remove old visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
smeyer198 committed Dec 16, 2024
1 parent 8fdae82 commit f5ab379
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 63 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -28,7 +26,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import typestate.TransitionFunction;

public abstract class CryptoScanner {

Expand Down Expand Up @@ -175,10 +172,6 @@ protected DataFlowScope createDataFlowScope() {
return new CryptoAnalysisDataFlowScope(ruleset, Collections.emptySet());
}

public Debugger<TransitionFunction> debugger(Query query) {
return new Debugger<>();
}

public SparseCFGCache.SparsificationStrategy getSparsificationStrategy() {
return SparseCFGCache.SparsificationStrategy.NONE;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package crypto.analysis;

import boomerang.debugger.Debugger;
import boomerang.results.ForwardBoomerangResults;
import boomerang.scene.CallGraph;
import boomerang.scene.DataFlowScope;
Expand All @@ -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;
Expand Down Expand Up @@ -42,12 +40,6 @@ public DataFlowScope getDataFlowScope() {
return scanner.getDataFlowScope();
}

@Override
public Debugger<TransitionFunction> getDebugger(
IDEALSeedSolver<TransitionFunction> idealSeedSolver) {
return scanner.debugger(idealSeedSolver.getSeed());
}

@Override
public int getTimeout() {
return scanner.getTimeout();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@ public void runTypestateAnalysis() {
Collection<Query> seeds = analysisScope.computeSeeds();

for (Query seed : seeds) {
if (!(seed instanceof ForwardSeedQuery)) {
if (!(seed instanceof ForwardSeedQuery query)) {
continue;
}

ForwardSeedQuery query = (ForwardSeedQuery) seed;
runTypestateAnalysisForSeed(query);
}
}
Expand Down Expand Up @@ -90,7 +89,7 @@ public CallGraph callGraph() {
@Override
public Debugger<TransitionFunction> debugger(
IDEALSeedSolver<TransitionFunction> idealSeedSolver) {
return definition.getDebugger(idealSeedSolver);
return new Debugger<>();
}

@Override
Expand Down Expand Up @@ -118,11 +117,10 @@ public Map<ForwardSeedQuery, ForwardBoomerangResults<TransitionFunction>> getRes
WeightedForwardQuery<TransitionFunction>,
ForwardBoomerangResults<TransitionFunction>>
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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {

Expand All @@ -16,7 +13,5 @@ public interface TypestateDefinition {

DataFlowScope getDataFlowScope();

Debugger<TransitionFunction> getDebugger(IDEALSeedSolver<TransitionFunction> idealSeedSolver);

int getTimeout();
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {

Expand Down Expand Up @@ -68,39 +63,6 @@ public DataFlowScope createDataFlowScope() {
return new CryptoAnalysisDataFlowScope(super.getRuleset(), getIgnoredSections());
}

@Override
public Debugger<TransitionFunction> 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()) {
Expand Down

0 comments on commit f5ab379

Please sign in to comment.