[Soot-list] Method calls and parameter values

Dr. Yury Zhauniarovich yzhauniarovich at hbku.edu.qa
Sun Mar 26 15:37:08 EDT 2017


Dear Soot community,

I've faced with a problem which I do not know how to tackle with. I would like to ask your help and suggestions how to deal with this issue.
MVE is the following. Let's assume that we have the following program:

class ClazzA {
  public static void methodA(String param1) {}
}

class ClazzB {
  public void methodB() {
    ClazzA.methodA("string_param1");
  }
}

abstract class ClazzC {
  public static void methodC(String param2) {
    //...maybe some code
    ClazzA.methodA(param2);
  }
}

class ClazzD extends ClazzC {
  public void methodD () {
    //some code
    methodC("string_param2")
  }
}

To make the story short, I need to identify all possible calls that results in calling of the method ClazzA.methodA(String param1) and identify all values of param1 in these calls.
For instance, in the case of the MVE, I need to find that in methodB there is a call of methodA with the parameter value equal to "string_param1", and that in methodD there is indirect call of methodA with the parameter value equal to "string_param2".

In general, there can be different cases, I just exemplified the one that I faced with.

So far, what I've done. I build a method call graph using spark (Scene.v().getCallGraph()), and in this graph I search for soot representation of methodA (SootMethod sMtd = Scene.v().grabMethod(mthSig)). Then, I search for all edges coming into methodA (cg.edgesInto(sMth)). Then I iterate over all the edges and print information about source statement (mtdEdge.srcStmt().toString()). I see that methodA is called from methodB with param1 ==  "string_param1".

However, I have several questions:
1. I see the call of methodA from methodC, but I do not know how to identify other indirect calls of the methodA, i.e., methodD (through methodC to methodA) and how to find the value of the param1 in this case.
2. How to iterate over such a call graph and when to stop?

Thank you in advance!


--
Best Regards,
Yury Zhauniarovich

--
Best Regards,
Yury Zhauniarovich

CONFIDENTIALITY  NOTICE:
This email and any attachments transmitted with it are confidential and intended for the use of individual or entity to which it is addressed. If you have received this email in error, please delete it immediately and inform the sender. Unless you are the intended recipient, you may not use, disclose, copy or distribute this email or any attachments included. The contents of this email, including any attachments, may be subjected to copyright law. In such cases, the contents may not be copied, adapted, distributed or transmitted without the consent of the copyright owner.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20170326/fbc064f4/attachment.html>


More information about the Soot-list mailing list