# 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](https://github.com/dshikashio/Pybag/actions/workflows/python-package.yml/badge.svg?branch=master)](https://github.com/dshikashio/Pybag/actions/workflows/python-package.yml)
## Installation
Windows:
```sh
python setup.py install
```
## 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
```python
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
```python
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
```python
from pybag import *
k = KernelDbg()
k.attach("net:port=50000,key=1.2.3.4")
```
## Release History
* 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](https://github.com/dshikashio/)
Raw data
{
"_id": null,
"home_page": "https://github.com/dshikashio/Pybag",
"name": "Pybag",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6.0",
"maintainer_email": "",
"keywords": "windows,debugging,dbgeng,windbg,reverseengineering",
"author": "Doug S",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/80/55/9424ff12682d212e1705730c66388d6a58d897f8334fded40ad22acc310d/Pybag-2.2.10.tar.gz",
"platform": null,
"description": "# Pybag\r\n> Python bindings for Microsoft DbgEng\r\n\r\nPybag provides helper functions on top of Python bindings for Microsoft Debug Engine to facilitate Windows native debugging.\r\n\r\n[![Build Master](https://github.com/dshikashio/Pybag/actions/workflows/python-package.yml/badge.svg?branch=master)](https://github.com/dshikashio/Pybag/actions/workflows/python-package.yml)\r\n\r\n## Installation\r\n\r\nWindows:\r\n\r\n```sh\r\npython setup.py install\r\n```\r\n\r\n## Usage example\r\n\r\nUse Python's repl as a command shell if desired. Ctrl-c will break-in to the debugger if you are in a wait() call.\r\n\r\n### Local user debugging\r\n```python\r\nfrom pybag import *\r\n\r\ndef handler(bp, dbg):\r\n print(\"*********** BREAK\")\r\n return DbgEng.DEBUG_STATUS_GO\r\n\r\ndbg = UserDbg()\r\ndbg.create(\"notepad.exe\")\r\ndbg.bp(\"Kernel32!WriteFile\", handler)\r\ndbg.go()\r\n```\r\n### Remote user debugging\r\n```python\r\nfrom pybag import *\r\n\r\ndef handler(bp, dbg):\r\n print(\"*********** BREAK\")\r\n return DbgEng.DEBUG_STATUS_GO\r\n\r\ndbg = UserDbg()\r\nd.connect(\"tcp:server=192.168.1.10,port=5555\")\r\ndbg.create(\"notepad.exe\")\r\ndbg.bp(\"Kernel32!WriteFile\", handler)\r\ndbg.go()\r\n```\r\n\r\n### Remote kernel debugging\r\n```python\r\nfrom pybag import *\r\n\r\nk = KernelDbg()\r\nk.attach(\"net:port=50000,key=1.2.3.4\")\r\n```\r\n\r\n\r\n## Release History\r\n* 2.2.10\r\n * Better search for Windbg DLLs using registry and allowing user override\r\n* 2.2.9\r\n * Add implementations of GetCurrentThreadSystemId and GetProcessIdsByIndex\r\n* 2.2.8\r\n * Fixed missing files install issue\r\n* 2.2.7\r\n * Fixed access violation when using oneshot breakpoints\r\n * Added 'count' option to breakpoints\r\n* 2.2.6\r\n * Added support for more dbgeng calls\r\n * Symbol handling\r\n * Set / get thread contexts\r\n * Fixed ds command\r\n* 2.2.5\r\n * Fixed be command\r\n * Better search for Windbg install (and DLLs)\r\n* 2.2.4\r\n * Fixed lint issues\r\n* 2.2.3 \r\n * Bug fix in WriteVirtual \r\n* 2.2.2\r\n * Python bindings rewritten to use comtypes\r\n * Moved to Python 3\r\n * Support multiple debugging uses\r\n * Local user debugging\r\n * Remote kernel debugging\r\n * Remote user debugging using dbgsrv\r\n\r\n\r\n## Meta\r\n\r\nDistributed under the MIT license. See ``LICENSE`` for more information.\r\n\r\n[https://github.com/dshikashio](https://github.com/dshikashio/)\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python wrappers for DbgEng from Windbg",
"version": "2.2.10",
"project_urls": {
"Homepage": "https://github.com/dshikashio/Pybag"
},
"split_keywords": [
"windows",
"debugging",
"dbgeng",
"windbg",
"reverseengineering"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2de0f877c91e036fcaed2a827f80d6cbdf1d26cffc3333c9ebda31c55c45f050",
"md5": "eed7dcbc9c82860116ff6051ccadc9a2",
"sha256": "81cf1e33dd667dd217dc56a123326796e6799b8569f2c6efb78c16375caf9b2b"
},
"downloads": -1,
"filename": "Pybag-2.2.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "eed7dcbc9c82860116ff6051ccadc9a2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6.0",
"size": 297877,
"upload_time": "2024-02-29T01:39:34",
"upload_time_iso_8601": "2024-02-29T01:39:34.879811Z",
"url": "https://files.pythonhosted.org/packages/2d/e0/f877c91e036fcaed2a827f80d6cbdf1d26cffc3333c9ebda31c55c45f050/Pybag-2.2.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "80559424ff12682d212e1705730c66388d6a58d897f8334fded40ad22acc310d",
"md5": "90d4085be93b03e1998ff1374eede0d1",
"sha256": "3c632d7bcd518f4f3f4772cd3559a5d9c7f5744dd23466c9fb274966b1dd06fe"
},
"downloads": -1,
"filename": "Pybag-2.2.10.tar.gz",
"has_sig": false,
"md5_digest": "90d4085be93b03e1998ff1374eede0d1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6.0",
"size": 275693,
"upload_time": "2024-02-29T01:39:36",
"upload_time_iso_8601": "2024-02-29T01:39:36.177390Z",
"url": "https://files.pythonhosted.org/packages/80/55/9424ff12682d212e1705730c66388d6a58d897f8334fded40ad22acc310d/Pybag-2.2.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-29 01:39:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dshikashio",
"github_project": "Pybag",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "pybag"
}