[Soot-list] Soot as a library

Eric Bodden eric.bodden at uni-paderborn.de
Tue Oct 22 04:18:09 EDT 2019


Hi Faridah,

I think this actually could be done, but you would have to…

1.) Make sure that the source code for the methods is self-contained because Soot will want to load any types referenced within those methods.

2.) Extend Soot’s source-code frontend to load from your in-memory representation instead from a file. This should be possible by providing another ClassSource. Have a look at Soot’s SourceLocator for this.

A Jimple body is then easy to access: simply obtain the appropriate class from the Scene, then call getMethod(..) on it and then getActiveBody() on that SootMethod.

Best wishes
Eric

> On 21. Oct 2019, at 19:28, Faridath Akinotcho <faridath.akinotcho at yahoo.fr> wrote:
> 
> Good morning,
> 
> I am currently working on a personal project that involves extracting common blocks from two versions of the same method. For that I need a tool that is capable to work embedded in my code. I mean, for example a function that I could call on a string representation of a program, that would generate a control flow graph associated to it, that I could work on. I have not being able to figure it if it is possible with soot, which seems to operate on files and classes, not single methods. Even if it is not possible, what would be the proper way for me to have access to the Jimple body associated with my method, which is the cfg I need. 
> I would really appreciate any guidance I could receive.
> 
> Best regards,
> Faridah Akinotcho
> 
> Sent from Yahoo Mail on Android
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list



More information about the Soot-list mailing list