[Soot-list] Using soot within a javaagent

Eric Bodden eric.bodden at ec-spride.de
Thu Dec 29 09:26:31 EST 2011


Hello Prashant.

On 28 December 2011 00:33, Prashant Deva <prashant.deva at gmail.com> wrote:
> All the examples/tutorials I see of soot show it being used as a command
> line tool.
>
> Is it possible to use it as part of a javaagent to analyse classes
> individually as they are loaded?

That's an interesting question. Indeed this would be very helpful.
Soot is not currently set up to do this and it would require some
restructuring to make this work. The problem ist that when Soot loads
a class, transforming it into Jimple, at the same time it tries to
resolve (and therefore load) referenced classes up to a certain
amount. This is somewhat different from the class-loading process as
it happens in the JVM. I am reasonably sure Soot could be restructured
to make this work, and it would indeed be great to see this work, but
I have never tried, nor do I know of anyone else who has.

> In this case the only input available to soot would be the byte array of the
> class being loaded at the moment.
> Not that since the class would not have been loaded at this point, if soot
> tries to use .class methods on the class being analyzed, those will throw an
> exception.

That's not an issue. Soot does not really need anything else but the
byte array. The problem is rather in the resolution of dependencies,
as mentioned above. If you were to give this a try I would be happy to
assist you!

Best wishes,
Eric


More information about the Soot-list mailing list