• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python vtrace.getTrace函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中vtrace.getTrace函数的典型用法代码示例。如果您正苦于以下问题:Python getTrace函数的具体用法?Python getTrace怎么用?Python getTrace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getTrace函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: run

		def run(self):
			
			self.trace = vtrace.getTrace()
			self.trace.registerNotifier(vtrace.NOTIFY_SIGNAL, PeachNotifier())
			self.trace.execute(self._command + " " + self._params)
			UnixDebugger.started.set()
			self.trace.run()
开发者ID:flaub,项目名称:HotFuzz,代码行数:7,代码来源:debugger.py


示例2: load_binary

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)
    ###############################################################
    # The notifier class we want to register
    notif = CustomNotifier()
    # The list of events we want the notifier to handle
    eve = vtrace.NOTIFY_ALL
    # Tell our vtrace object that we want to capture all events with CustomNotifier
    trace.registerNotifier(eve, notif)
    ###############################################################
    # 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()
    #################################################################

    # Step 5 times into the program
    for i in range(5):
        trace.stepi()

    # Deregister our notifier
    trace.deregisterNotifier(eve, notif)
开发者ID:suto,项目名称:vtrace_scripts,代码行数:32,代码来源:simpleNotifier.py


示例3: getTrace

 def getTrace(self):
     trace = vtrace.getTrace()
     host,port = cobra.getLocalInfo()
     unique = md5.md5(os.urandom(20)).hexdigest()
     vtrace.cobra_daemon.shareObject(trace, unique)
     trace.proxy = cobra.CobraProxy("cobra://%s:%d/%s" % (host,port,unique))
     return unique
开发者ID:Fitblip,项目名称:vdb-fork,代码行数:7,代码来源:rmi.py


示例4: run_with_vivisect

def run_with_vivisect(binary, args, ttl):
    trace = vtrace.getTrace()

    logger.debug("Building Thread [{}]".format(load_binary))
    t = Thread(target=load_binary, args=(trace, binary, args))
    t.start()
    logger.debug("Sleeping for {} seconds.".format(ttl))
    sleep(ttl)

    if trace.isRunning():
        trace.sendBreak()
        # print_info(trace)

        logger.info("Death to the process {}".format(trace.getPid()))
        logger.debug("  (\  /)")
        logger.debug(" ( .  .)")
        logger.debug('C(") ("), done and no crash. Bunny is sad..')
        trace.kill()
        trace.detach()
        return NO_CRASH_RETURN
    else:
        # TODO: Seems that isRunning isn't working that well.
        logger.info("{} crashed!".format(binary))
        logger.info("Arguments: {}".format(", ".join(args)))
        print_info(trace)
        return CRASH_RETURN
开发者ID:Stolas,项目名称:Fizzled,代码行数:26,代码来源:autopsy.py


示例5: __init__

    def __init__(self, trace=None):
        v_notif.Notifier.__init__(self)
        v_util.TraceManager.__init__(self)

        if trace == None:
            trace = vtrace.getTrace()

        arch = trace.getMeta("Architecture")
        self.arch = envi.getArchModule(arch)
        self.difftracks = {}

        self.setMode("NonBlocking", True)

        self.manageTrace(trace)
        self.registerNotifier(vtrace.NOTIFY_ALL, self)

        # FIXME if config verbose
        #self.registerNotifier(vtrace.NOTIFY_ALL, vtrace.VerboseNotifier())

        self.vdbhome = e_config.gethomedir(".vdb")

        self.loadConfig()

        self.setupSignalLookups()

        # Ok... from here down we're handing everybody the crazy
        # on-demand-resolved trace object.
        trace = vdb.VdbTrace(self)
        e_cli.EnviMutableCli.__init__(self, trace, self.config, symobj=trace)

        self.prompt = "vdb > "
        self.banner = "Welcome To VDB!\n"

        self.loadDefaultRenderers(trace)
        self.loadExtensions(trace)
开发者ID:gdisneyleugers,项目名称:vdebug,代码行数:35,代码来源:__init__.py


示例6: load_binary

def load_binary(filepath, base=None):
    opList = {}
    trace = vtrace.getTrace()

    trace.execute(filepath)
#######################################################################
# Enable the notifier.  Used later to catch the page execute exception.
    notif = CustomNotifier()
    eve = vtrace.NOTIFY_ALL
    trace.registerNotifier(eve, notif)
#######################################################################
# Set a breakpoint on CreateProcessA and run until it is hit
    pattern = "CreateProcessA()"
    v_api.setBpOnPattern(trace, pattern)
    v_api.printBp(trace)
    trace.run()

#######################################################################
# Functions sets child process to start suspended and attaches to it
# as soon as it returns to userland by setting the Entry Point page
# as non executable and catching the exception that is thrown.
    print "followCreateProcessA"
    v_api.followCreateProcessA(trace)
    
    addr = v_api.getOEP(trace, "pwnables100")
    v_api.nxMemPerm(trace, addr)
#####################################################################
# Beyond this point the debugger is attached to the child process
# 
    print ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
    print "HOLY BREAKPOINT BATMAN!"
    print "EIP: ", v_api.printableEIP(trace)
开发者ID:hoangcuongflp,项目名称:vtrace_scripts,代码行数:32,代码来源:simpleFollowChild.py


示例7: load_binary

def load_binary(filepath, base=None):
    # Get the current vtrace object
    trace = vtrace.getTrace()

    # If attempting to attach to a 64 bit process
    # 64 bit python is required.
    trace.execute(filepath)

    # Start the program executing
    trace.run()
开发者ID:hoangcuongflp,项目名称:vtrace_scripts,代码行数:10,代码来源:simpleRun.py


示例8: main

def main():
    if len(sys.argv) < 3:
        print("dreifuzz -- a effortlessly uncomplicated fuzzer\n"
                "usage: ./dreifuzz.py [executable] [file]")
        return

    exepath = sys.argv[1]
    filepath = sys.argv[2]

    trace = vtrace.getTrace()

    load_binary(trace, exepath, filepath)
开发者ID:dtouch3d,项目名称:dreifuzz,代码行数:12,代码来源:dreifuzz.py


示例9: __init__

    def __init__(self, trace=None, parent=None):
        vq_tree.VQTreeView.__init__(self, parent=parent)
        if trace == None:
            trace = vtrace.getTrace()
        self.trace = trace

        model = VQProcessListModel(parent=self)
        self.setModel(model)
        self.setAlternatingRowColors(True)

        for pid,name in self.trace.ps():
            model.append((pid,name))
开发者ID:Fitblip,项目名称:SocketSniff,代码行数:12,代码来源:qt.py


示例10: load_binary

def load_binary(filePID, base=None):
    
    # Ask for the current trace object so we can play with it
    trace = vtrace.getTrace()

    # If attempting to attach to a 64 bit process
    # 64 bit python is required.
    if pid != None:
        trace.attach(filePID)

    # Start executing the program.  
    # Will not stop until it finishes or is killed    
    trace.run()
开发者ID:hoangcuongflp,项目名称:vtrace_scripts,代码行数:13,代码来源:simpleAttach.py


示例11: main

def main():
    import vtrace
    sym = sys.argv[1]
    pid = int(sys.argv[2])
    t = vtrace.getTrace()
    t.attach(pid)
    symaddr = t.parseExpression(sym)
    t.addBreakpoint(vtrace.Breakpoint(symaddr))
    while t.getProgramCounter() != symaddr:
        t.run()
    snap = t.takeSnapshot()
    #snap.saveToFile("woot.snap") # You may open in vdb to follow along
    emu = emulatorFromTraceSnapshot(snap)
    lockStepEmulator(emu, t)
开发者ID:albertz,项目名称:pydbattach,代码行数:14,代码来源:envitools.py


示例12: main

def main(binary, breakpoint, arg_number):
   trace = vtrace.getTrace()
   try:
      trace.execute(binary)
   except:
      print "[EE] No such file"
   try:
      trace.addBreakByAddr(breakpoint)
   except:
      print "[EE] Invalide addr %s" %(hex(breakpoint))
      return 
   trace.run()
   print_stack(trace, arg_number)
   return (0)
开发者ID:Debug-Orz,项目名称:stuffz,代码行数:14,代码来源:vtrace-show_args_function.py


示例13: main

def main(binary, breakpoint, memory, size):
   trace = vtrace.getTrace()
   try:
      trace.execute(binary)
   except:
      print "[EE] No such file"
   try:
      trace.addBreakByAddr(breakpoint)
   except:
      print "[EE] Invalide addr %s" %(hex(breakpoint))
      return 
   trace.run()
   dump_memory(trace, memory, size)
   return (0)
开发者ID:Debug-Orz,项目名称:stuffz,代码行数:14,代码来源:vtrace-dump_memory.py


示例14: newTrace

    def newTrace(self):
        """
        Generate a new trace for this vdb instance.  This fixes many of
        the new attach/exec data munging issues because tracer re-use is
        *very* sketchy...
        """
        oldtrace = self.getTrace()
        if oldtrace.isRunning():
            oldtrace.sendBreak()
        if oldtrace.isAttached():
            oldtrace.detach()

        self.trace = vtrace.getTrace()
        self.manageTrace(self.trace)
        return self.trace
开发者ID:gdisneyleugers,项目名称:vdebug,代码行数:15,代码来源:__init__.py


示例15: main

def main(argv):
    global trace

    trace = vtrace.getTrace()
    if len(argv) != 2:
        print "Usage: %s <KeePass.exe>" % sys.argv[0]
        sys.exit(1)

    pid = find_pid_by_name(sys.argv[1])
    if pid:
        print "Found PID: %i" % pid
    else:
        print "Program not running"
        trace.release()
        sys.exit(1)
    attach(pid)
开发者ID:jkadijk,项目名称:reversing-scripts,代码行数:16,代码来源:hookpass.py


示例16: run_trace

def run_trace(binary, args):
    trace = vtrace.getTrace()
    trace.setMode("FastStep", True)

    execute_path = " ".join([binary] + args)
    trace.execute(execute_path)
    while trace.isRunning():
        pass
        # print(trace.getRegister(REG_EIP))
        # run till call

    # Now the program has quit.
    # make a fuzzy hash.
    fuzzy_hash = None

    return fuzzy_hash
开发者ID:Stolas,项目名称:Fizzled,代码行数:16,代码来源:stalker.py


示例17: load_binary

def load_binary(shellcode, fileLoc, base=None):
    trace = vtrace.getTrace()

    if shellcode is not None:
        v_api.disasm(trace, binascii.unhexlify(shellcode))
    
    else:
        print "FILE LOCATION: %s" % fileLoc
        f = open(fileLoc, 'rb')
        tmp = f.read()
        f.close()
        
        shell = binascii.unhexlify(tmp)
        v_api.disasm(trace, shell)
    
    trace.release()
开发者ID:hoangcuongflp,项目名称:vtrace_scripts,代码行数:16,代码来源:simpleDisasm.py


示例18: run

    def run(self):
        trace = vtrace.getTrace()
        trace.execute("c:\\nc.exe -l -p 4040")
        trace.setMode("RunForever", True)
        notif = libnotify()
        trace.registerNotifier(vtrace.NOTIFY_LOAD_LIBRARY, notif)
        stalker.addStalkerEntry(trace, 0x00403047)
        while trace.isAttached():
            trace.run()

        hits = stalker.getStalkerHits(trace)

        for hit in hits:
            print "+ hit: %08x" % hit

        data = pickle.dumps(hits)
        self.sendResults(data)
开发者ID:corelanc0d3r,项目名称:toolbag,代码行数:17,代码来源:ncTrackRecv.py


示例19: load_binary

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)

    # Print out all the current breakpoints as well as if they are enabled.
    for bp in trace.getBreakpoints():
        print("%s enabled: %s" % (bp, bp.isEnabled()))

    # Start executing the program until you hit a breakpoint or it ends
    trace.run()
##############################################################
# At this point you are at OEP of the program

    # We know that there is a call 5 instructions in
    # There are ways to programmatically find a call
    for i in range(5):
        trace.stepi()

    # Print the value of EIP as a long and as hex
    print "\n"
    print "EIP: ", trace.getRegister(REG_EIP)
    print "HEX EIP: ", hex(trace.getRegister(REG_EIP))

    # Once you are in the function you can read the value of ESP
    # ESP points to the value of the return address
    print "\n"
    esp = trace.getRegister(REG_ESP)
    retaddr = trace.readMemory(esp, 4)

    # Returns the exact memory locations
    # Just in the WRONG order 
    print "RET: ", retaddr.encode('hex')

    # This returns the address correctly formatted
    print "RET: ", hex(struct.unpack("I",retaddr)[0])
开发者ID:hoangcuongflp,项目名称:vtrace_scripts,代码行数:46,代码来源:simpleRet.py


示例20: main

def main(argv):
    global exepath

    if len(argv) != 2:
        print "Usage: %s <test files>" % sys.argv[0]
        sys.exit(1)

    # verify that the path to test files is valid
    filepath = sys.argv[1]
    if os.path.isdir(filepath) == False:
        sys.exit("Invalid Input Directory")

    # Get the current vtrace object
    trace = vtrace.getTrace()

    threads = []
    crashes = []
    count = 1
    print ("[*] Starting fuzz process")

    # call load_binary on the filenames stored in the directory
    for fname in os.listdir(filepath):
        #print fname
        cmdline = filepath + "\\" + fname
        
        t = threading.Thread(target = load_binary, args = (trace, cmdline,))
        threads.append(t)
        t.start()
        time.sleep(10)
        if trace.isRunning():
            trace.sendBreak()
            printInfo(trace)

            print ("[*] Death to the process %d") % (trace.getPid())
            trace.kill()
        else:
            print ("[*] %s crashed") % (fname)
        time.sleep(1)
        count += 1

    print ("")
    print ("[*] Death to all %d of %d processes") % ( (count-len(crashes)), count )
    print ("[*] %d files caused crashes") % (len(crashes))
    for i in crashes:
        print ("\t filename: %s") % (i)
开发者ID:hoangcuongflp,项目名称:vtrace_scripts,代码行数:45,代码来源:simpleFuzz.py



注:本文中的vtrace.getTrace函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python posix.ptrace函数代码示例发布时间:2022-05-26
下一篇:
Python vtn_vbr.validate_vtn_at_controller函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap