[Soot-list] Using soot as a library

Eric Bodden eric.bodden at ec-spride.de
Fri Jul 6 07:51:53 EDT 2012


Hi David.

An easier way to set options is to use the "Options" class. You can
use Options.v().setXYZ(..) to set options.

Then you typically call Soot's main method or do something more
elaborate if needed.

Eric

On 6 July 2012 13:24, David Given <dg at cowlark.com> wrote:
> Hello,
>
> I would like to use Soot in a tool I'm working on: basically, what I
> want to do is to process a set of class files into jimple and then walk
> the jimple AST. Eventually I'll want to do whole-program optimisation,
> but that's for later.
>
> I've done some playing with using Soot as a library from my own Java
> application, and am a little confused: classes like Scene and
> PackManager appear to have deep hooks into the CLI parsing in Options;
> currently I'm faking up a command line and calling Options.v().parse()
> with it. Is this the right way of doing things?
>
> Above all, does anyone have an example of doing this that I can look at
> and steal, er, use for reference?
>
> (Alternatively, if I'd be better off just using the standard Soot driver
> and somehow adding a custom phase, does anyone have an example of doing
> *that*?)
>
> --
> ┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
> │ "Parents let children ride bicycles on the street. But parents do not
> │ allow children to hear vulgar words. Therefore we can deduce that
> │ cursing is more dangerous than being hit by a car." --- Scott Adams
>
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>



-- 
Eric Bodden, Ph.D., http://bodden.de/
Head of Secure Software Engineering Group at EC SPRIDE
Principal Investigator in Secure Services at CASED
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt


More information about the Soot-list mailing list