[Soot-list] Save and restore soot state between transformations

Manuel Benz manuel.benz at uni-paderborn.de
Tue Jun 30 10:00:12 EDT 2020


Hi.

Unfortunately not. We are working on a new Soot variant that supports such snapshots of the Scene.

However, I’ve implemented a serialisation feature sometime ago which you could use to serialize your Scene state to a binary file and re-apply it before each new analysis run. This should save a lot of time since the state will already contain the completely parsed and transformed Jimple code for the read-in classes.
The feature is not yet merged into the official Soot repository. I still might be able to give you access, if there is interest.

Best,
Manuel

Am 30.06.2020 um 15:15 schrieb Pierre Wilke <pierre.wilke at centralesupelec.fr<mailto:pierre.wilke at centralesupelec.fr>>:

Hello,

Thanks for building and maintaining soot!

I'd like to know whether it's possible to save Soot's state at some point during its execution and from this point run several distinct instrumentations. Something along the lines of :


init_stuff();
Scene.v().loadNecessaryClasses();
...
// perhaps run a first pack P1
PackManager.v().runPacks()
// now save state
HypotheticalSootSavedState s = G.save_state();
// apply first instrumentation
PackManager.v().runPacks()
PackManager.v().writeOutput()
// restore saved state
G.restore_state(s)
// apply second instrumentation
PackManager.v().runPacks()
PackManager.v().writeOutput()

So, is there some way to implement this hypothetical G.save_state() method?
I could of course launch Soot twice, but I would end up parsing and performing my first pack P1 twice, when I only need to do it once.

Said otherwise, instead of doing that :


app --parse---> initial soot Scene ---P1---> scene s ----instrument1--> app1

app --parse---> initial soot Scene ---P1---> scene s ----instrument2--> app2

I'd like to do that :


                                                     ,---instrument1--> app1
app --parse---> initial soot Scene ---P1---> scene s |
                                                     `---instrument2--> app2


I suspect this old message ( https://mailman.cs.mcgill.ca/pipermail/soot-list/2014-December/007612.html ) might be related, but I'm unfortunately not familiar enough with soot or Clojure to be able to translate this solution into the Java equivalent.

Best,
Pierre
_______________________________________________
Soot-list mailing list
Soot-list at CS.McGill.CA<mailto:Soot-list at CS.McGill.CA>
https://mailman.CS.McGill.CA/mailman/listinfo/soot-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20200630/2b2b6aa5/attachment-0001.html>


More information about the Soot-list mailing list