[Soot-list] Basic usage of Paddle with Soot
Steven Arzt
Steven.Arzt at cased.de
Fri Aug 14 03:30:38 EDT 2015
Hi Ben,
You are using a fairly outdated version of Soot. The plugin is not really regularly updated with the current version of Soot. Thus, if you are just interested in obtaining Soot, I would either take the source code from Github and compile it or take our nightly builds: https://ssebuild.cased.de/nightly/soot/lib/soot-trunk.jar. This build should directly include Paddle and should at least not throw any funny errors due to mismatching method signatures.
Best regards,
Steven
M.Sc. M.Sc. Steven Arzt
Secure Software Engineering Group (SSE)
European Center for Security and Privacy by Design (EC SPRIDE)
Rheinstraße 75
D-64293 Darmstadt
Phone: +49 61 51 869-336
Fax: +49 61 51 16-72118
eMail: <mailto:steven.arzt at ec-spride.de> steven.arzt at ec-spride.de
Web: http://sse.ec-spride.de <http://sse.ec-spride.de/>
Von: soot-list-bounces at CS.McGill.CA [mailto:soot-list-bounces at CS.McGill.CA] Im Auftrag von Ben Holland
Gesendet: Freitag, 14. August 2015 00:17
An: soot-list at cs.mcgill.ca
Betreff: [Soot-list] Basic usage of Paddle with Soot
Hi,
I've been trying to run Paddle with Soot, but I'm having some issues. I just want to get access to the PointsTo results and the callgraph. My question is does Paddle actually work with Soot or is it out of synch with the current Soot? It looks like work on Paddle more or less stopped in 2008.
I've read up on my literature for Soot and several of the Lhotak papers/thesis. I've also read the Soot Survivors guide in it's entirety.
I'm using the nightly build of Paddle from http://plg.uwaterloo.ca/~olhotak/build/, and I'm using the version of Soot available through the Eclipse update site at https://github.com/Sable/soot/wiki/Running-Soot-as-Eclipse-Plugin.
Running the following program gives me some errors. Occasionally the error is different breaking on a Field instead of an array first.
java.lang.NoSuchMethodError: soot.Scene.getFieldNumberer()Lsoot/util/ArrayNumberer;
at soot.jimple.paddle.ArrayElement.<init>(ArrayElement.java:28)
at soot.PaddleSingletons.soot_jimple_paddle_ArrayElement(PaddleSingletons.java:33)
at soot.jimple.paddle.ArrayElement.v(ArrayElement.java:30)
at soot.jimple.paddle.NodeFactory.caseArgv(NodeFactory.java:127)
at soot.jimple.paddle.MethodNodeFactory.addMiscEdges(MethodNodeFactory.java:228)
at soot.jimple.paddle.TradMethodPAGBuilder.build(TradMethodPAGBuilder.java:63)
at soot.jimple.paddle.TradMethodPAGBuilder.update(TradMethodPAGBuilder.java:48)
at soot.jimple.paddle.DependencyManager.update(DependencyManager.java:76)
at soot.jimple.paddle.OFCGScene.solve(OFCGScene.java:168)
at soot.jimple.paddle.OFCGConfig.solve(OFCGConfig.java:35)
at soot.jimple.paddle.PaddleScene.solve(PaddleScene.java:1390)
at soot.jimple.paddle.PaddleTransformer.solve(PaddleTransformer.java:99)
at soot.jimple.paddle.PaddleTransformer.internalTransform(PaddleTransformer.java:46)
at soot.SceneTransformer.transform(SceneTransformer.java:39)
at soot.jimple.paddle.PaddleHook.internalTransform(PaddleHook.java:43)
at soot.SceneTransformer.transform(SceneTransformer.java:39)
at soot.Transform.apply(Transform.java:90)
at soot.RadioScenePack.internalApply(RadioScenePack.java:57)
at soot.jimple.toolkits.callgraph.CallGraphPack.internalApply(CallGraphPack.java:49)
at soot.Pack.apply(Pack.java:116)
at soot.PackManager.runWholeProgramPacks(PackManager.java:564)
at soot.PackManager.runPacksNormally(PackManager.java:457)
at soot.PackManager.runPacks(PackManager.java:392)
at soot.Main.run(Main.java:271)
at soot.Main.main(Main.java:147)
at PaddleTest.main(PaddleTest.java:43)
public class PaddleTest {
public final static String projectDir = "<my workspace path>/TestProject/bin";
public static void main(String[] args) {
// reset soot
Scene.v().releaseActiveHierarchy();
Scene.v().releaseCallGraph();
Scene.v().releaseFastHierarchy();
Scene.v().releasePointsToAnalysis();
Scene.v().releaseReachableMethods();
Scene.v().releaseSideEffectAnalysis();
G.reset();
// setup soot args
List<String> sootArgs = new LinkedList<String>();
// analyze entire directory
sootArgs.add("-process-dir");
sootArgs.add(projectDir);
sootArgs.add("-w"); // enable whole program mode
// setup spark options
sootArgs.add("-p");
sootArgs.add("cg.paddle");
sootArgs.add("enabled:true,verbose:true");
// run soot
try {
String[] argsArray = sootArgs.toArray(new String[0]);
soot.Main.main(argsArray);
// iterate over call graph results
CallGraph callGraph = Scene.v().getCallGraph();
System.out.println("Number of edges in callgraph: " + callGraph.size());
// PointsToAnalysis p = Scene.v().getPointsToAnalysis();
} catch (Throwable t){
System.out.println("Soot class path " + Scene.v().getSootClassPath());
t.printStackTrace();
}
}
}
The Soot Survivors Guide shows a slightly example, but I have had difficulty setting the classpath and standard soot options using that method. Do you have a simple example of running Paddle somewhere you could share?
PaddleTransformer pt = new PaddleTransformer();
PaddleOptions paddle_opt = new PaddleOptions(myPaddleOptions);
pt.setup(paddle_opt);
pt.solve(paddle_opt);
soot.jimple.paddle.Results.v().makeStandardSootResults();
~Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20150814/4a6de77d/attachment-0001.html
More information about the Soot-list
mailing list