[prev in list] [next in list] [prev in thread] [next in thread]
List: soot-list
Subject: Re: [Soot-list] Soot does not produce putput
From: "Steven Arzt" <Steven.Arzt () cased ! de>
Date: 2015-06-22 9:19:29
Message-ID: 008001d0accc$8a9a53a0$9fcefae0$ () cased ! de
[Download RAW message or body]
This is a multipart message in MIME format.
[Attachment #2 (multipart/alternative)]
This is a multipart message in MIME format.
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@CS.McGill.CA [mailto:soot-list-bounces@CS.McGill.CA] Im \
Auftrag von Marjan Radi
Gesendet: Freitag, 19. Juni 2015 22:25
An: soot-list@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
[Attachment #5 (text/html)]
<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type \
content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 \
(filtered medium)"><style><!-- /* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div \
class=WordSection1><p class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi \
Marjan,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>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")?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best \
regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> \
Steven<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div \
style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p \
class=MsoNormal><b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> \
soot-list-bounces@CS.McGill.CA [mailto:soot-list-bounces@CS.McGill.CA] <b>Im Auftrag \
von </b>Marjan Radi<br><b>Gesendet:</b> Freitag, 19. Juni 2015 22:25<br><b>An:</b> \
soot-list@cs.mcgill.ca<br><b>Betreff:</b> [Soot-list] Soot does not produce \
putput<o:p></o:p></span></p></div></div><p \
class=MsoNormal><o:p> </o:p></p><div><div \
id="yui_3_16_0_1_1434745589928_2775"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>Hi,<o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2775"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'><o:p> </o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2775"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>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:<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1434745589928_2865"><p \
class=MsoNormal style='background:white'><span \
style='font-size:10.0pt;font-family:"Courier \
New";color:black'><o:p> </o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2866"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'><o:p> </o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2879"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>for(String sig : Constants.OPENCONNECTION_SIGNATURE) \
{<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1434745589928_2881"><p \
class=MsoNormal style='background:white'><span \
style='font-size:10.0pt;font-family:"Courier \
New";color:black'>final SootMethod openconnectionMethod = \
Scene.v().getMethod(sig);<o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2891"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>Iterator<Edge> openconnectionEdges = callGraph.edgesInto(openconnectionMethod);<o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2806"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>while (openconnectionEdges.hasNext()) \
{<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1434745589928_2884"><p \
class=MsoNormal style='background:white'><span \
style='font-size:10.0pt;font-family:"Courier \
New";color:black'>Edge callIntoopenconnection = openconnectionEdges.next();<o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2777"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>Unit srcUnit = callIntoopenconnection.srcUnit();<o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2893"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>SootMethod method = callIntoopenconnection.getSrc().method();<o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2927"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>SelectedCallSite callSites = new SelectedCallSit \
e(method.getDeclaringClass(), method, srcUnit);<o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2805"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>Body b = method.retrieveActiveBody();<o:p></o:p></span></p></div><div><p \
class=MsoNormal style='background:white'><span \
style='font-size:10.0pt;font-family:"Courier \
New";color:black'>Value tmpRef = \
addTmpRef(b);<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1434745589928_2896"><p \
class=MsoNormal style='background:white'><span \
style='font-size:10.0pt;font-family:"Courier \
New";color:black'>Value tmpString = \
addTmpString(b);<o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2778"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'><o:p> </o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2898"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'> // insert "tmpRef = \
java.lang.System.out;" <o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2900"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>b.getUnits().insertBefore(Jimple.v().newAssignStmt( tmpRef, \
Jimple.v().newStaticFieldRef( Scene.v().getField("<java.lang.System: \
java.io.PrintStream out>").makeRef())), srcUnit);<o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2804"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'><o:p> </o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2779"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'> // insert "tmpLong = \
'HELLO';" <o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2903"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>b.getUnits().insertBefore(Jimple.v().newAssignStmt(tmpString, <o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2905"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'> \
StringConstant.v("HELLO")), srcUnit);<o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2906"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'><o:p> </o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2908"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'> // insert \
"tmpRef.println(tmpString);" <o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2781"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>SootMethod toCall = \
Scene.v().getSootClass("java.io.PrintStream").getMethod("void \
println(java.lang.String)"); \
<o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2925"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>b.getUnits().insertBefore(Jimple.v().newInvokeStmt(Jimple.v().newVir \
tualInvokeExpr((soot.Local) tmpRef, toCall.makeRef(), tmpString)), srcUnit);<o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2803"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'><o:p> </o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2782"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>b.validate();<o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2783"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'><o:p> </o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2796"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>}<o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2784"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'><o:p> </o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2786"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>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?<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1434745589928_2787"><p \
class=MsoNormal style='background:white'><span \
style='font-size:10.0pt;font-family:"Courier \
New";color:black'><o:p> </o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2794"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>I would be appreciated if you could help \
me.<o:p></o:p></span></p></div><div id="yui_3_16_0_1_1434745589928_2792"><p \
class=MsoNormal style='background:white'><span \
style='font-size:10.0pt;font-family:"Courier \
New";color:black'><o:p> </o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2791"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>Best Regards,<o:p></o:p></span></p></div><div \
id="yui_3_16_0_1_1434745589928_2789"><p class=MsoNormal \
style='background:white'><span style='font-size:10.0pt;font-family:"Courier \
New";color:black'>Marjan <o:p></o:p></span></p></div></div></div></body></html>
_______________________________________________
Soot-list mailing list
Soot-list@CS.McGill.CA
https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic