Skip to content

Instantly share code, notes, and snippets.

@RobinDavid
Created April 10, 2020 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobinDavid/f5a90846dd39e8366a7282408269d097 to your computer and use it in GitHub Desktop.
Save RobinDavid/f5a90846dd39e8366a7282408269d097 to your computer and use it in GitHub Desktop.
IDA Pro iteratively restore all snapshots
import ida_kernwin
import ida_loader
ss = ida_loader.snapshot_t()
ida_loader.build_snapshot_tree(ss)
ccs = list(ss.children)
def callback(param1, param2):
if param2 is not None:
print("Restoration done for:", param2)
if ccs: # there is still snapshot to iter
c = ccs.pop(0)
print("Start restoration of: ", c.id)
ida_kernwin.restore_database_snapshot(c, callback, c.id)
callback(None, None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment