[Soot-list] Soot class loading

Marc-André Laverdière marc-andre.laverdiere-papineau at polymtl.ca
Wed Aug 14 09:32:29 EDT 2013


Hi Norbert,

Generating classes is possible. Bernhard and I have written some code
for JEE that does that. We do it in the wjpp phase, and the trick is to
use Scene.v().forceResolve.

Flowdroid also generates some stubs, and they do it before running
analyses (they don't use soot main, so I don't know in which 'phase'
that would fit in)

When it comes to classloaders, I have observed a need along those lines.
Soot has all the classes in a single scope in Scene. This is a problem
for JEE applications because of the hierarchical classloading scheme.

Implementing this is going to be a lot of work. And it is critical to
preserve backwards-compatibility, which makes things even trickier. That
is probably why nobody did it yet :)

As for when the loading happens...
There is going to be a first loading phase at the start. Then if any
transformer request a class that isn't there using forceResolve. Then in
Spark. That should be it.

-- 
Marc-André Laverdière-Papineau
Doctorant - PhD Candidate

On 08/14/2013 04:39 AM, Norbert Sándor wrote:
> Hello,
> 
> I try to use Soot for constructing call graphs.
> It works as expected when I use it on statically compiled programs, when 
> the processed classes are on the "analyzer" program's classpath.
> 
> My problem is the following: I would like to include dynamically 
> generated classes in the call graph, that are available only via special 
> ClassLoaders.
> (I use Javassist to generate classes dynamically: 
> http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/tutorial/tutorial.html#load 
> )
> 
> My question:
> - Can I set a custom ClassLoader for Soot to load the analyzed classes?
> - Is there any documentation about how Soot finds and loads classes? Or, 
> can you show me the key points/classes in the Soot code base where the 
> loading happens?
> 
> Another alternative would be to use the Java Compiler API to compile the 
> classes, but it would require much more complicated code to do it 
> (because the generated classes are very simple, just a few lines of code 
> using Javassist).
> 
> Thanks for your help in advance!
> Best regards:
> Norbert Sándor
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
> 



More information about the Soot-list mailing list