Skip to main content

Python wrappers for DbgEng from Windbg

Project description

Pybag

Python bindings for Microsoft DbgEng

Pybag provides helper functions on top of Python bindings for Microsoft Debug Engine to facilitate Windows native debugging.

Build Master

Installation

Install the Debugging Tools

pip install pybag

Usage example

Use Python's repl as a command shell if desired. Ctrl-c will break-in to the debugger if you are in a wait() call.

Local user debugging

from pybag import *

def handler(bp, dbg):
    print("*********** BREAK")
    return DbgEng.DEBUG_STATUS_GO

dbg = UserDbg()
dbg.create("notepad.exe")
dbg.bp("Kernel32!WriteFile", handler)
dbg.go()

Remote user debugging

from pybag import *

def handler(bp, dbg):
    print("*********** BREAK")
    return DbgEng.DEBUG_STATUS_GO

dbg = UserDbg()
d.connect("tcp:server=192.168.1.10,port=5555")
dbg.create("notepad.exe")
dbg.bp("Kernel32!WriteFile", handler)
dbg.go()

Remote kernel debugging

from pybag import *

k = KernelDbg()
k.attach("net:port=50000,key=1.2.3.4")

Release History

  • 2.2.16
    • Bugfix for comtypes change
  • 2.2.15
    • Implementation of exception related calls
  • 2.2.14
    • Bug fix for breakpoints
    • Switched to py-win32more for thread CONTEXT
  • 2.2.13
    • Improved discovery of Windbg installation detection. Works with App store installations now.
  • 2.2.12
    • Fix #22 - comtypes issue
  • 2.2.11
    • Fix #18 - Fix SetImplicitProcessDataOffset
    • Fix #19 - Implement CreateProcess2
  • 2.2.10
    • Better search for Windbg DLLs using registry and allowing user override
  • 2.2.9
    • Add implementations of GetCurrentThreadSystemId and GetProcessIdsByIndex
  • 2.2.8
    • Fixed missing files install issue
  • 2.2.7
    • Fixed access violation when using oneshot breakpoints
    • Added 'count' option to breakpoints
  • 2.2.6
    • Added support for more dbgeng calls
      • Symbol handling
      • Set / get thread contexts
    • Fixed ds command
  • 2.2.5
    • Fixed be command
    • Better search for Windbg install (and DLLs)
  • 2.2.4
    • Fixed lint issues
  • 2.2.3
    • Bug fix in WriteVirtual
  • 2.2.2
    • Python bindings rewritten to use comtypes
    • Moved to Python 3
    • Support multiple debugging uses
      • Local user debugging
      • Remote kernel debugging
      • Remote user debugging using dbgsrv

Meta

Distributed under the MIT license. See LICENSE for more information.

https://github.com/dshikashio

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybag-2.2.16.tar.gz (152.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybag-2.2.16-py3-none-any.whl (158.9 kB view details)

Uploaded Python 3

File details

Details for the file pybag-2.2.16.tar.gz.

File metadata

  • Download URL: pybag-2.2.16.tar.gz
  • Upload date:
  • Size: 152.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pybag-2.2.16.tar.gz
Algorithm Hash digest
SHA256 64066f4e5c6581fa9cf778d8e6cf5ce33d3f431961557365c465905ca79b2966
MD5 66715e2d4830516b55c8becbcd926b10
BLAKE2b-256 e1841053510186c0f9a37daad1287194c1b57167590fb065f33ed2d481db58e3

See more details on using hashes here.

File details

Details for the file pybag-2.2.16-py3-none-any.whl.

File metadata

  • Download URL: pybag-2.2.16-py3-none-any.whl
  • Upload date:
  • Size: 158.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pybag-2.2.16-py3-none-any.whl
Algorithm Hash digest
SHA256 cef631e87d0bb12163c8cb11ca756ddfa8924a6eacdbd746683ed58948a2bfdf
MD5 2432b810ec0cbd9d1a4a3485d93731e6
BLAKE2b-256 5ea252084698c0a3c7e7a94ddfff26f83df09a50781b8436f6f203f5de0a457c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page