[Soot-list] Soot does not produce putput

Steven Arzt Steven.Arzt at cased.de
Mon Jun 22 05:19:29 EDT 2015


Hi Marjan,

 

Unless you explicitly specify a different output directory, Soot will always write its outputs to the “sootOutput” folder inside your current directory from which your program that uses Soot is run. Are you sure that you have specified a valid output format (i.e., not “none”)?

 

Best regards,

  Steven

 

Von: soot-list-bounces at CS.McGill.CA [mailto:soot-list-bounces at CS.McGill.CA] Im Auftrag von Marjan Radi
Gesendet: Freitag, 19. Juni 2015 22:25
An: soot-list at cs.mcgill.ca
Betreff: [Soot-list] Soot does not produce putput

 

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/20150622/7df9ae54/attachment.html 


More information about the Soot-list mailing list