8
8
import boomerang .scene .jimple .JimpleStatement ;
9
9
import de .fraunhofer .iem .secucheck .analysis .configuration .SecucheckAnalysisConfiguration ;
10
10
import de .fraunhofer .iem .secucheck .analysis .datastructures .SameTypedPair ;
11
+ import de .fraunhofer .iem .secucheck .analysis .datastructures .TaintFlowPath ;
11
12
import de .fraunhofer .iem .secucheck .analysis .implementation .SingleFlowTaintAnalysis .BoomerangSolver .Utility ;
12
13
import de .fraunhofer .iem .secucheck .analysis .datastructures .DifferentTypedPair ;
13
14
import de .fraunhofer .iem .secucheck .analysis .implementation .SingleFlowTaintAnalysis .datastructure .BoomerangTaintFlowPath ;
@@ -36,6 +37,19 @@ public SecucheckBoomerangDemandDrivenAnalysis(SecucheckAnalysisConfiguration sec
36
37
this .secucheckAnalysisConfiguration = secucheckAnalysisConfiguration ;
37
38
}
38
39
40
+ public void printPath (BoomerangTaintFlowPath node ) {
41
+ if (node == null )
42
+ return ;
43
+
44
+ if (node .getNodeValue () == null )
45
+ System .out .println ("--> null" );
46
+ else
47
+ System .out .println ("--> " + (Query ) node .getNodeValue ());
48
+
49
+ for (TaintFlowPath child : node .getChildrenNodes ())
50
+ printPath ((BoomerangTaintFlowPath ) child );
51
+ }
52
+
39
53
/**
40
54
* Runs the DemandDrivenAnalysis
41
55
*
@@ -61,12 +75,6 @@ public List<DifferentTypedPair<TaintFlowImpl, SingleTaintFlowAnalysisResult>> ru
61
75
62
76
QueryGraph <Weight .NoWeight > queryGraph = demandDrivenGuidedAnalysis .run (source );
63
77
64
- if (secucheckAnalysisConfiguration .isPostProcessResult ()) {
65
- for (Query query : queryGraph .getNodes ()) {
66
- System .out .println ("---> " + query .cfgEdge ());
67
- }
68
- }
69
-
70
78
for (DifferentTypedPair <BackwardQuery , BoomerangTaintFlowPath > sinkNode : boomerangGPHandler .getFoundSinks ()) {
71
79
BackwardQuery sink = sinkNode .getFirst ();
72
80
@@ -76,6 +84,12 @@ public List<DifferentTypedPair<TaintFlowImpl, SingleTaintFlowAnalysisResult>> ru
76
84
secucheckAnalysisConfiguration .isPostProcessResult ()
77
85
);
78
86
reachMap .add (new DifferentTypedPair <>(singleFlow , res ));
87
+
88
+ if (secucheckAnalysisConfiguration .isPostProcessResult ()) {
89
+ System .out .println ("***** TaintFlow *****" );
90
+ printPath ((BoomerangTaintFlowPath ) res .getPath ());
91
+ System .out .println ("*********************" );
92
+ }
79
93
}
80
94
}
81
95
0 commit comments