<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:12px"><div id="yui_3_16_0_1_1443599575312_2776" dir="ltr">Given invkExpr of type InvokeExprBox is the invocation expression of the special invocation statement,<br></div><div id="yui_3_16_0_1_1443599575312_2703" dir="ltr">we can obtain the list of use boxes within the expression in the following way:</div><div id="yui_3_16_0_1_1443599575312_3079" dir="ltr"><br></div><div id="yui_3_16_0_1_1443599575312_2704" dir="ltr">List&lt;ValueBox&gt; boxesList = invkExpr.getValue().getUseBoxes();</div><div id="yui_3_16_0_1_1443599575312_2879" dir="ltr"><br></div><div id="yui_3_16_0_1_1443599575312_2880" dir="ltr">One of the boxes in boxesList should be the local that you want.</div><div id="yui_3_16_0_1_1443599575312_2881" dir="ltr"><br></div><div id="yui_3_16_0_1_1443599575312_2884" dir="ltr">Best,<br></div><div id="yui_3_16_0_1_1443599575312_2883" dir="ltr">Andrew<br></div><div id="yui_3_16_0_1_1443599575312_2636"><span></span></div>  <br><div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 12px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 16px;"> <div dir="ltr"> <font face="Arial" size="2"> On Wednesday, 30 September 2015, 10:38, Jason Ott &lt;jott002@ucr.edu&gt; wrote:<br> </font> </div>  <br><br> <div class="y_msg_container"><div id="yiv8952452852"><div dir="ltr">I have the following Jimple:<div><div><br></div><div>&nbsp;public boolean getFlashlightEnabled()</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; com.android.server.lights.LightsService$1 r0;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; int i0;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; java.io.FileInputStream $r1, r3; // I'm interested in this</div><div>&nbsp; &nbsp; &nbsp; &nbsp; java.lang.Exception $r2;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; boolean $z0;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; r0 := @this: com.android.server.lights.LightsService$1;</div><div>&nbsp; &nbsp; &nbsp;label1:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; $r1 = new java.io.FileInputStream;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; specialinvoke $r1.&lt;java.io.FileInputStream: void &lt;init&gt;(java.lang.String)&gt;("/sys/class/leds/spotlight/brightness"); &nbsp;// But my interest in $r1 and r3 are predicated upon this</div><div>&nbsp; &nbsp; &nbsp; &nbsp; r3 = $r1;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; i0 = virtualinvoke r3.&lt;java.io.FileInputStream: int read()&gt;();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; virtualinvoke r3.&lt;java.io.FileInputStream: void close()&gt;();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if i0 == 48 goto label2;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; $z0 = 1;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; goto label3;</div><div>&nbsp; &nbsp; &nbsp;label2:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; $z0 = 0;</div><div>&nbsp; &nbsp; &nbsp;label3:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return $z0;</div><div>&nbsp; &nbsp; &nbsp;label4:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; $r2 := @caughtexception;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return 0;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; catch java.lang.Exception from label1 to label3 with label4;</div><div>&nbsp; &nbsp; }</div></div><div><br></div><div>You can see that I am interested in the variable that, in some way or another, uses the "/sys/class/leds/spotlight/brightness" string.&nbsp; Thus, I am interested in the variable $r1.&nbsp; But I don't know that I'm interested in $r1 until I see that $r1 is using the string that I am interested.</div><div><br></div><div>Now I know that $r1 is a local, more specifically a LinkedRValueBox.&nbsp; I know that the string, "/sys/class/..." is an ImmediateBox, which is leveraged in an InvokeExprBox (specialinvoke $r1...).&nbsp; What I cannot seem to manage to figure out is how to derive the Local $r1 variable from either the InvokeExprBox or the ImmediateBox.&nbsp; Neither of them have any formal link to $r1 (a Local) other than by parsing the string representation of them and then going through the Locals looking for what you want.</div><div><br></div><div>So my question is: Is there a way to get the Local from the InvokeExprBox or the ImmediateBox in this case, or the general case?&nbsp; I can only get ValueBoxes from anything which is of ValueBox, as defined by the ValueBox interface.</div><div><br></div><div>Thanks.</div></div></div><br>_______________________________________________<br>Soot-list mailing list<br><a ymailto="mailto:Soot-list@CS.McGill.CA" href="mailto:Soot-list@CS.McGill.CA">Soot-list@CS.McGill.CA</a><br><a href="https://mailman.cs.mcgill.ca/mailman/listinfo/soot-list" target="_blank">https://mailman.CS.McGill.CA/mailman/listinfo/soot-list</a><br><br><br></div>  </div> </div>  </div></div></body></html>