[Soot-list] Soot does not produce putput

Marjan Radi marjan.radi at yahoo.com
Fri Jun 19 16:25:17 EDT 2015


Hi,
I want to instrument an APK file using Soot. I have implemented an Analysis class which constructs the application call graph and iterates on this graph to find specific system calls. I also wrote a code to insert a simple code before every specified call which is founded in the call graph. This is my code:

for(String sig : Constants.OPENCONNECTION_SIGNATURE) {final SootMethod openconnectionMethod = Scene.v().getMethod(sig);Iterator<Edge> openconnectionEdges = callGraph.edgesInto(openconnectionMethod);while (openconnectionEdges.hasNext()) {Edge callIntoopenconnection = openconnectionEdges.next();Unit srcUnit = callIntoopenconnection.srcUnit();SootMethod method = callIntoopenconnection.getSrc().method();SelectedCallSite callSites = new SelectedCallSite(method.getDeclaringClass(), method, srcUnit);Body b = method.retrieveActiveBody();Value tmpRef = addTmpRef(b);Value tmpString = addTmpString(b);
      // insert "tmpRef = java.lang.System.out;" b.getUnits().insertBefore(Jimple.v().newAssignStmt( tmpRef, Jimple.v().newStaticFieldRef( Scene.v().getField("<java.lang.System: java.io.PrintStream out>").makeRef())), srcUnit);
    // insert "tmpLong = 'HELLO';" b.getUnits().insertBefore(Jimple.v().newAssignStmt(tmpString,                   StringConstant.v("HELLO")), srcUnit);
    // insert "tmpRef.println(tmpString);" SootMethod toCall = Scene.v().getSootClass("java.io.PrintStream").getMethod("void println(java.lang.String)");                    b.getUnits().insertBefore(Jimple.v().newInvokeStmt(Jimple.v().newVirtualInvokeExpr((soot.Local) tmpRef, toCall.makeRef(), tmpString)), srcUnit);
b.validate();
}
I have also added "PackManager.v().writeOutput();" in the main class of my analysis after perfoming the whole analysis. But when I rum my analysis, there is no soot output. I do not know why I can not get the new version of APK including those instrumentation. Do you know what I'm doing wrong?
I would be appreciated if you could help me.
Best Regards,Marjan 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20150619/d036169e/attachment.html 


More information about the Soot-list mailing list