[Soot-list] Displaying all StringContstants used in method invocation ?
Alan Kash
crudbug at gmail.com
Wed Sep 24 20:01:49 EDT 2014
Hi All,
First of all, kudos to Soot community for creating this wonderful piece of
software. I am new to Soot, and program analysis in general. I am
instrumenting an Android application by following "*Instrumenting Android *and
*Java Applications *as *Easy *as *abc*
<http://link.springer.com/chapter/10.1007/978-3-642-40787-1_26>", which has
lot of useful information. But, I want to display all the strings that are
used in the method invocation, how can I display this ? I have some
preliminary code that checks *StringConstant *usage below:
for (Value va : iv.getInvokeExpr().getArgs()) {
System.out.println("[ARGS : TYPE] " + va.getType() + " with ");
if (va instanceof StringConstant) {
System.out.print(va + " ");
} else if (va instanceof JimpleLocal) {
JimpleLocal jl = (JimpleLocal) va;
if (jl.getType() instanceof RefType) {
RefType rt = (RefType) jl.getType();
SootClass cls = rt.getSootClass();
String clsName = cls.getName();
// recursion possible - backward analysis ?
if(clsName.equals("java.lang.String")){
System.out.print("GOT STRING CLASS - HOW TO GET
THE VALUE ?");
}
}
}
}
Any pointers will be of great help.
Thanks,Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20140924/8cf4490b/attachment-0001.html
More information about the Soot-list
mailing list