[Soot-list] Scripting with soot

Mihir Mehta mihir.cs.iitd at gmail.com
Tue Nov 25 13:58:48 EST 2014


Thanks Steven, the SceneTransformer suggestion makes a lot of sense. If 
I understand your suggestion correctly, I should try subclassing 
SceneTransformer (instead of BodyTransformer as I am now doing), and in 
the body of its internalTransform, I should get the scene using the 
method Scene.v(), and then call Scene.getMethod on it with the fully 
qualified name of each interesting method in turn. I think this should work.

Re FlowDroid, taint analysis is quite different from what I'm doing - 
I'm trying to generate certain verification conditions which I can 
verify at the end of the backward data flow analysis with Microsoft 
Research's Z3. Thanks for the suggestion, all the same.

Best regards,
Mihir.

On 11/25/14 12:40, Steven Arzt wrote:
> Hi,
>
>  From what I understood from your descriptions, it looks as if a
> SceneTransfomer is something worth looking at. As an alternative, Soot does
> not clean up its objects after returning from its main() method. The caller
> of main() can thus still operate on the Scene and retrieve classes and
> methods (Scene.v().getMethod etc.)
>
> Concerning the data flow analysis: There is already a quite sophisticated
> static taint tracker called FlowDroid that was implemented on top of Soot:
> http://sseblog.ec-spride.de/tools/flowdroid/ It's all open source, so you
> can use it, re-use parts of it, extend it, and learn from how things are
> implemented there.
>
> Best regards,
>    Steven
>
> -----Ursprüngliche Nachricht-----
> Von: soot-list-bounces at CS.McGill.CA [mailto:soot-list-bounces at CS.McGill.CA]
> Im Auftrag von Mihir Mehta
> Gesendet: Dienstag, 25. November 2014 19:35
> An: Soot-list at CS.McGill.CA
> Betreff: Re: [Soot-list] Scripting with soot
>
> There is no way for me to iterate through the method Bodys. I need to call
> soot.Main.main at the end of my class, which I believe is the standard. Once
> I do that, soot takes over and eventually calls internalTransform on each of
> the Bodys. I have a work-around in mind, but it's somewhat kludgy: I store
> all the relevant method names and the relevant assertions in a static data
> structure, and in the internalTransform method, I check the current Body
> against this static data structure and check assertions if any. You can see
> how storing assertions in a data structure is messy in a language such as
> java, which doesn't allow me to simply store functions as first-class
> values.
> This is why I'm wondering if there's a way for me to iterate through the
> method Bodys, which feels like a cleaner solution.
>
> Mihir.
>
> On 11/25/14 12:22, Patrick Lam wrote:
>> Hi Mihir,
>>
>> It would be great to have an assertion-based test infrastructure for
>> Soot and sharing that with the community would be awesome.
>>
>> I'm not sure why you can't do the obvious thing. Can you not just run
>> the BodyTransformer on all Bodys and filter out the ones that aren't
>> relevant?
>>
>> pat
>>
>> On 25/11/14 12:56 PM, Mihir Mehta wrote:
>>> Hi,
>>>
>>> I'm working on a data flow analysis using soot, following these
>>> steps(http://www.bodden.de/2008/09/22/soot-intra/). I'd like to set
>>> up a regression test suite, which would look something like a number
>>> of source code files (classes, in .java files) and some assertions on
>>> the result of the flow analysis on some methods in each of these classes.
>>> However, because of the way soot seems to be structured, I'm not able
>>> to figure out how to make a harness that runs my analysis on each of
>>> these classes in turn and checks the assertions - because I can only
>>> see the Body corresponding to a method in the internalTransform
>>> method of my BodyTransformer instance, which means I cannot do the
>>> obvious thing, i.e. search for all the relevant methods in all the
>>> different class files, run the analysis on each method's Body, and
>>> print whether the assertion passed.
>>>
>>> Can anyone suggest a work-around?
>>>
>>> Thanks,
>>> Mihir Mehta,
>>> Doctoral student,
>>> UT Austin.
>>> _______________________________________________
>>> Soot-list mailing list
>>> Soot-list at CS.McGill.CA
>>> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
>>>
> _______________________________________________
> 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