当前位置: 首页>>代码示例>>Python>>正文


Python winappdbg.Debug方法代码示例

本文整理汇总了Python中winappdbg.Debug方法的典型用法代码示例。如果您正苦于以下问题:Python winappdbg.Debug方法的具体用法?Python winappdbg.Debug怎么用?Python winappdbg.Debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在winappdbg的用法示例。


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

示例1: monitor

# 需要导入模块: import winappdbg [as 别名]
# 或者: from winappdbg import Debug [as 别名]
def monitor( procname, pid ):      
    if dev:
        if turkish:
            print procname + ":" + str(pid)
        else:
            print procname + ":" + str(pid)

    # Instance a Debug object.
    if pid > 0:
        # debug = Debug( MyEventHandler() )
        try:
                debug.stop(True)
                # Attach to a running process.
                debug.attach( pid )

                # Wait for the debugee to finish.
                debug.loop()

        # Stop the debugger.
        finally:
                debug.stop() 
开发者ID:mertsarica,项目名称:hack4career,代码行数:23,代码来源:cryptokiller.py

示例2: each_with_type

# 需要导入模块: import winappdbg [as 别名]
# 或者: from winappdbg import Debug [as 别名]
def each_with_type(self, target, file_type):
        self.paths = {
            'word': "{}\\{}".format(self.office_path, "WINWORD.EXE"),
            'rtf': "{}\\{}".format(self.office_path, "WINWORD.EXE"),
            'html': "{}\\{}".format(self.office_path, "WINWORD.EXE"),
            'excel': "{}\\{}".format(self.office_path, "EXCEL.EXE"),
            'powerpoint': "{}\\{}".format(self.office_path, "POWERPOINT.EXE"),
            'javascript': 'C:\\Windows\\system32\\wscript.exe',
            'vbscript': 'C:\\Windows\\system32\\wscript.exe'
        }

        self.files = set()
        self.results = {
            "actions": []
        }

        monkey = ClickThread()
        monkey.click_on("Microsoft Excel", "Yes", "is in a different format than specified by the file extension")
        monkey.click_on("Microsoft Word", "OK", "command cannot be performed because a dialog box is open")
        monkey.click_on("Microsoft Word", "No", "start Word in safe mode")
        monkey.click_on("Microsoft Word", "Yes", "caused a serious error")
        monkey.click_on("File In Use", "OK", "locked for editing")
        monkey.click_on("Microsoft Word", "Yes", "that may refer to other files")
        monkey.click_on("Microsoft Excel", "Yes", "that may refer to other files")
        monkey.click_on("Microsoft Word", "Yes", "Do you want to start")
        monkey.click_on("Microsoft Excel", "Yes", "Do you want to start")
        monkey.close("Activation Wizard")
        monkey.start()

        target = self.set_extension(target, file_type)
        args = [self.paths[file_type], target]

        pids = []
        maxtime = time() + self.timeout

        with Debug(self, bKillOnExit=False) as debug:
            debug.execv(args)

            pids = debug.get_debugee_pids()

            while debug and time() < maxtime:
                try:
                    debug.wait(1000)
                except WindowsError, e:
                    if e.winerror in (win32.ERROR_SEM_TIMEOUT,
                                      win32.WAIT_TIMEOUT):
                        continue
                    raise

                try:
                    debug.dispatch()
                finally:
                    debug.cont() 
开发者ID:certsocietegenerale,项目名称:fame_modules,代码行数:55,代码来源:cutthecrap.py

示例3: run

# 需要导入模块: import winappdbg [as 别名]
# 或者: from winappdbg import Debug [as 别名]
def run(self, target_file, save_path=None):
        """
        Run the executable with the provided file, optionally saving all OLEv1
        parts that are encountered.
        """

        # TODO: Ensure target_file is readable

        opts = [self.executable, target_file]
        handler = CustomEventHandler(self._log)
        handler.save_path = save_path

        with Debug(handler, bKillOnExit=True) as debug:

            # Ensure the target application dies if the debugger is killed
            System.set_kill_on_exit_mode(True)
            max_time = time() + self.timeout

            try:
                debug.execv(opts)
            except WindowsError:
                self._log.error("Could not run Office application, check it is 32-bit")

            try:
                while debug.get_debugee_count() > 0 and time() < max_time:
                    try:
                        # Get the next debug event.
                        debug.wait(1000)

                    except WindowsError, exc:
                        if exc.winerror in (win32.ERROR_SEM_TIMEOUT,
                                            win32.WAIT_TIMEOUT):
                            continue
                        raise

                    # Dispatch the event and continue execution.
                    try:
                        debug.dispatch()
                    finally:
                        debug.cont()
            finally:
                debug.stop()

        return handler.objects 
开发者ID:edeca,项目名称:rtfraptor,代码行数:46,代码来源:engine.py


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