[Soot-list] Display Strings Used in method invocation
Alan Kash
crudbug at gmail.com
Wed Sep 24 20:11:41 EDT 2014
Hi All,
First of all, kudos to the whole community of Soot 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" by S. Arzt et. al., *which
has lot of useful information. I want to display all the string values that
are passed in method invocation, how can I do this? I have some preliminary
code that checks the 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 are of great help.
Thanks,
Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20140924/f46cda92/attachment-0001.html
More information about the Soot-list
mailing list