Public repository for windbglib, a wrapper around pykd.pyd (for Windbg), used by mona.py
To get mona.py up and running under WinDBG, please follow these steps:
-
Download pykd.zip from https://github.com/corelan/windbglib/raw/master/pykd/pykd.zip and save it to a temporary location on your computer
-
Check the properties of the file and "Unblock" the file if necessary.
-
Extract the archive. You should get 2 files: pykd.pyd and vcredist_x86.exe
-
Run vcredist_x86.exe with administrator privileges and accept the default values.
-
Copy pykd.pyd to
C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x86\winext
orC:\Program Files (x86)\Windows Kits\10\Debuggers\x86\winext
-
Open a command prompt with administrator privileges and run the following commands:
c: cd "C:\Program Files (x86)\Common Files\Microsoft Shared\VC" regsvr32 msdia90.dll (You should get a messagebox indicating that the dll was registered successfully)
-
Download windbglib.py from https://github.com/corelan/windbglib/raw/master/windbglib.py
-
Save the file under
C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x86
orC:\Program Files (x86)\Windows Kits\10\Debuggers\x86
("Unblock" the file if necessary) -
Download mona.py from https://github.com/corelan/mona/raw/master/mona.py
-
Save mona.py under
C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x86
orC:\Program Files (x86)\Windows Kits\10\Debuggers\x86
("Unblock" the file if necessary)
Python 2.7
- Install a recent 64bit version of Python 2.7.x (2.7.14 or higher) in the default installation folder (
c:\Python27
) and verify that it is going to be the default python version. (Adjust system path if needed). (This procedure has been tested with installerpython-2.7.18.amd64.msi
) - Add
c:\Python27\Scripts
to the PATH System environment variable. Close the command prompt and open a new administrator command prompt. - Upgrade pip
python -m pip install --upgrade pip
Python 3.9.0?
- windbglib/mona are currently not ready yet to be used with python3.
Latest version:
Run pip install pykd
- Download the latest version from https://githomelab.ru/pykd/pykd-ext/-/wikis/Downloads and extract the file
- From the x64 folder, copy pykd.dll into the WinDBG winext folder
C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64\winext
orC:\Program Files (x86)\Windows Kits\10\Debuggers\x64\winext
- Download windbglib.py from https://github.com/corelan/windbglib/raw/master/windbglib.py
- Save the file under
C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64
orC:\Program Files (x86)\Windows Kits\10\Debuggers\x64
("Unblock" the file if necessary) - Download mona.py from https://github.com/corelan/mona/raw/master/mona.py
- Save mona.py under
C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64
orC:\Program Files (x86)\Windows Kits\10\Debuggers\x64
("Unblock" the file if necessary) - Run windbg.exe from
C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64
orC:\Program Files (x86)\Windows Kits\10\Debuggers\x64
-
Download pykd.zip from https://github.com/corelan/windbglib/raw/master/pykd/pykd.zip and save it to a temporary location on your computer
-
Check the properties of the file and "Unblock" the file if necessary.
-
Extract the archive. You should get 2 files: pykd.pyd and vcredist_x86.exe
-
Run vcredist_x86.exe with administrator privileges and accept the default values.
-
Copy pykd.pyd to
C:\Program Files\Debugging Tools for Windows (x86)\winext
-
Open a command prompt with administrator privileges and run the following commands:
c: cd "C:\Program Files\Common Files\Microsoft Shared\VC" regsvr32 msdia90.dll (You should get a messagebox indicating that the dll was registered successfully)
-
Download windbglib.py from https://github.com/corelan/windbglib/raw/master/windbglib.py
-
Save the file under
C:\Program Files\Debugging Tools for Windows (x86)
("Unblock" the file if necessary) -
Download mona.py from https://github.com/corelan/mona/raw/master/mona.py
-
Save the file under
C:\Program Files\Debugging Tools for Windows (x86)
("Unblock" the file if necessary)
32bit:
Open Windbg and execute the following command: .load pykd.pyd
64bit (using PyKD_ext bootstrapper):
Open Windbg and execute the following command: .load pykd
mona commands can the be accessed by running !py mona
For more info on using mona.py, consider taking a Corelan Training: https://www.corelan-training.com
- Make sure your symbol path is set up correctly (if you don't know how to do ths, mona.py will do this for you the first time you run the script)
- Make sure (at least) the symbols for ntdll.dll are downloaded/available on your system. If your machine is connected to the internet, windbg will do this automatically the first time you run mona.py When the files are downloaded, you could disconnect the system from the internet if you would like to.