Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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")
Ejemplo n.º 3
0
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")
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
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)