[prev in list] [next in list] [prev in thread] [next in thread]
List: soot-list
Subject: Re: [Soot-list] Soot Instrumentation
From: "Steven Arzt" <Steven.Arzt () cased ! de>
Date: 2016-01-27 16:44:43
Message-ID: 008701d15922$064a5570$12df0050$ () 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 desperate student,
All the classes that start with J are implementations of the respective interfaces. A \
Soot user should never reference them explicitly, only the interfaces, e.g., use \
InvokeExpr instead of JInvokeExpr. To construct instances of these types use \
Jimple.v().newXXX(). The Jimple singleton class contains factory methods for all the \
different Jimple language constructs.
Now let's move on to method references. You first need to get hold of the method you \
want to reference. The SootMethod class has a method called makeRef() to then create \
a reference. To get a method, use Scene.v().getMethod(). You can also take a \
SootClass and get the method from there, that's equivalent.
A Value is essentially the base class of everything that can be used as an expression \
in Soot. It can be some constant, an invoke expression, or a "this" reference. Get a \
"this" reference, once again grab the SootMethod and then call \
method.getActiveBody().getThisLocal() on it.
Best regards,
Steven
Von: soot-list-bounces@CS.McGill.CA [mailto:soot-list-bounces@CS.McGill.CA] Im \
Auftrag von Doenerspiesser Doenerspiesser
Gesendet: Mittwoch, 27. Januar 2016 17:04
An: soot-list@CS.McGill.CA
Betreff: [Soot-list] Soot Instrumentation
Dear Sir or Madam,
i have to use the manual instrumentation function of Soot via java code. There are \
two problems, which i can īt solve: the constructor of "JStaticInvokeExpr" needs 2 \
parameter:
-a "SootMethodRef": where can i get this from? its just a interface and there is no \
class called "soot.SootMethodRefImpl" (i backtracked my jimple code and one \
"JStaticInvokeExpr" instance had a parameter with this class)
-a List of Values: first should be in my case a this reference- how can i access a \
this reference dynamically?? "soot.jimple.This.Ref" constructor needs "RefType" as \
input and "RefType" constructor needs "Singletons.Global" as input. Something like \
"ThisRef thiss=new ThisRef(new RefType(Singletons.Global));" doesn īt work.
Yours sincerely,
a desperated student
[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;}
@font-face
{font-family:Verdana;
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-MailFormatvorlage18
{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 \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi \
desperate student,<o:p></o:p></span></p><p class=MsoNormal><span \
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'>All the \
classes that start with J are implementations of the respective interfaces. A Soot \
user should never reference them explicitly, only the interfaces, e.g., use \
InvokeExpr instead of JInvokeExpr. To construct instances of these types use \
Jimple.v().newXXX(). The Jimple singleton class contains factory methods for all the \
different Jimple language constructs.<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'>Now let's \
move on to method references. You first need to get hold of the method you want to \
reference. The SootMethod class has a method called makeRef() to then create a \
reference. To get a method, use Scene.v().getMethod(). You can also take a SootClass \
and get the method from there, that's equivalent.<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'>A Value is \
essentially the base class of everything that can be used as an expression in Soot. \
It can be some constant, an invoke expression, or a "this" reference. Get a "this" \
reference, once again grab the SootMethod and then call \
method.getActiveBody().getThisLocal() on it.<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>Doenerspiesser Doenerspiesser<br><b>Gesendet:</b> Mittwoch, 27. Januar 2016 \
17:04<br><b>An:</b> soot-list@CS.McGill.CA<br><b>Betreff:</b> [Soot-list] Soot \
Instrumentation<o:p></o:p></span></p></div></div><p \
class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal><span \
style='font-size:9.0pt;font-family:"Verdana","sans-serif"'>Dear Sir or \
Madam,<o:p></o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:9.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p></div><div><p \
class=MsoNormal><span style='font-size:9.0pt;font-family:"Verdana","sans-serif"'>i \
have to use the manual instrumentation function of Soot via java code. There are two \
problems, which i can īt solve: the constructor of "JStaticInvokeExpr" \
needs 2 parameter:<o:p></o:p></span></p></div><div><p class=MsoNormal><strong><span \
style='font-size:9.0pt;font-family:"Verdana","sans-serif"'>-a \
"SootMethodRef": where can i get this from? </span></strong><span \
style='font-size:9.0pt;font-family:"Verdana","sans-serif"'>its just a interface and \
there is no class called "soot.SootMethodRefImpl" (i backtracked my jimple \
code and one "JStaticInvokeExpr" instance had a parameter with this \
class)<o:p></o:p></span></p></div><div><p class=MsoNormal><strong><span \
style='font-size:9.0pt;font-family:"Verdana","sans-serif"'>-a List of Values: first \
should be in my case a this reference- how can i access a this reference \
dynamically?? </span></strong><span \
style='font-size:9.0pt;font-family:"Verdana","sans-serif"'>"soot.jimple.This.Ref" \
constructor needs "RefType" as input and "RefType" constructor \
needs "Singletons.Global" as input. Something like "ThisRef thiss=new \
ThisRef(new RefType(Singletons.Global));" doesn īt \
work.<o:p></o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:9.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p></div><div><p \
class=MsoNormal><span \
style='font-size:9.0pt;font-family:"Verdana","sans-serif"'>Yours \
sincerely,<o:p></o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:9.0pt;font-family:"Verdana","sans-serif"'> <o:p></o:p></span></p></div><div><p \
class=MsoNormal><span style='font-size:9.0pt;font-family:"Verdana","sans-serif"'>a \
desperated student<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