本文整理汇总了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()
示例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()
示例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