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

Pierre Wilke pierre.wilke at centralesupelec.fr
Tue Jun 30 09:15:00 EDT 2020


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20200630/5e0a3c7d/attachment.html>


More information about the Soot-list mailing list