def main(argv): opts = setup().parse_args(argv) t = vtrace.getTrace() t.attach(opts.pid) symaddr = t.parseExpression(opts.expr) t.addBreakpoint(vtrace.Breakpoint(symaddr)) while t.getProgramCounter() != symaddr: t.run() snap = v_snapshot.takeSnapshot(t) if opts.save: # You may open this file in vdb to follow along snap.saveToFile(opts.save) emu = emuFromTrace(snap) lockStepEmulator(emu, t)
def load_binary(filepath, base=None): # Get the current trace object from vtrace trace = vtrace.getTrace() # If attempting to attach to a 64 bit process # 64 bit python is required. trace.execute(filepath) ############################################################### # Call a function to set BP on OEP oep = v_api.getOEP(trace, filepath) # Set breakpoint at address bp = vtrace.Breakpoint(oep) trace.addBreakpoint(bp) # Start executing the program until you hit a breakpoint or it ends trace.run() ################################################################# # takes a snapshot of memory snap = vs_snap.takeSnapshot(trace) # saves it to a file snap.saveToFile("zTest.snap")
def getSnapshot(trace): # Snapshot still broken when new features are enabled (Stalker) # might have something to do with the deep copy of the meta tags return vs_snap.takeSnapshot(trace)