Search code examples
pythonwindbgpykd

How to load an external file in a WinDbg session


I'm trying to load pykd.pyd in order to be able to use Python during Windbg crash dump analysis. This does not work, as you can see here:

0:006> .load C:\Python27\Lib\site-packages\pykd.pyd
The call to LoadLibrary(C:\Python27\Lib\site-packages\pykd.pyd) failed,
Win32 error 0n126
    "The specified module could not be found."
Please check your debugger configuration and/or network access.

For your information, I have started, opening Windbg (version x86) and opening a crash dump file, and I can confirm that the mentioned pykd.pyd file is present.

If I put the filename between double quotes, I get another error message, as you can see here:

0:006> .load "C:\Python27\Lib\site-packages\pykd.pyd"
The call to LoadLibrary(C:Python27Libsite-packagespykd.pyd) failed, 
Win32 error 0n2
    "The system cannot find the file specified."
Please check your debugger configuration and/or network access.

(It might be important to mention that both Win32 errors are different!)

Does anybody know what might cause this issue?

Thanks in advance


Solution

  • Don't load python package directly ( C:\Python27\Lib\site-packages\pykd.pyd ). It is a legacy unsupported way.

    You need the special python bootstrapper for windbg: https://githomelab.ru/pykd/pykd-ext