Added token sample + Debugger.on_setup sample

This commit is contained in:
hakril
2018-12-21 15:27:04 +01:00
parent 79ff18e06f
commit 45ace331cb
2 changed files with 62 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import windows.debug
class MySetupDebugger(windows.debug.Debugger):
def on_setup(self):
super(MySetupDebugger, self).on_setup()
print("Setup called: {0}".format(self.current_process))
def on_exception(self, exc):
print("Exception: {0}".format(exc.ExceptionRecord.ExceptionCode))
def on_exit_process(self, evt):
print("Process exit: {0}".format(self.current_process))
class SimpleDebugger(windows.debug.Debugger):
def on_exception(self, exc):
print("Exception: {0}".format(exc.ExceptionRecord.ExceptionCode))
def on_exit_process(self, evt):
print("Process exit: {0}".format(self.current_process))
print("== With on_setup ==")
dbg = MySetupDebugger.debug(r"c:\windows\system32\whoami.exe")
dbg.loop()
print("\n== Without on_setup ==")
dbg = SimpleDebugger.debug(r"c:\windows\system32\whoami.exe")
dbg.loop()