Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Method that attaches debugger of choice #25

Open
strictlymike opened this issue Sep 27, 2021 · 0 comments
Open

Method that attaches debugger of choice #25

strictlymike opened this issue Sep 27, 2021 · 0 comments

Comments

@strictlymike
Copy link
Contributor

strictlymike commented Sep 27, 2021

It would be nice to have a single method that would suspend, detach, and then launch a debugger to attach for interactive control.

Here is an example breakpoint callable written to do this with WinDbg:

def attach_windbg(p, q, **kwargs):
    q.suspend()
    pid = q.detach()

    print('Attaching WinDbg to PID %d...' % (pid))
    windbg = r'C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\windbg.exe'
    os.system('"%s" -p %d' % (windbg, pid))

Pseudo-code of what method signatures could look like for configuring and triggering this:

class Debuggers(Enum):
    OLLYDBG = 1
    X32DBG = 2
    X64DBG = 3
    WINDBG = 4

class Qdb(...):
    def configureInteractiveDebugger(debugger_type=Debuggers.WINDBG, path="windbg.exe"):
        self._interactive_debugger = debugger_type
        self._interactive_debugger_path = path

    def attachInteractiveDebugger(suspend_detach_first=True, blocking=True):
        ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant