當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。