pykd试用

时间:2022-04-07 17:56:14

啥是pykd?

一个windbg插件,能在windbg里面运行python指令

试用步骤

下载from https://pykd.codeplex.com/releases/view/615625

解压后有这样几个文件

dbgeng.dll
dbghelp.dll
msdia120.dll
pykd.pyd
srcsrv.dll
symsrv.dll

运行windbg,attach一个进程

敲入命令

.load C:\Users\cutepig\Downloads\pykd-0.3.0.26-py27-win32\pykd\pykd.pyd

0:019> !py
Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> ls
Traceback (most recent call last):
  File "<console>", line 1, in <module>
NameError: name 'ls' is not defined
>>> print 'xx'
xx

从原代码编译 (未做)
https://pykd.codeplex.com/wikipage?title=PYKD%200.2.%20Documentation&referringTitle=Documentation#introduction-buildingfromsource

安装:Python. boost
设置环境变量:$(DIA_SDK_ROOT) $(DBG_SDK_ROOT) $(BOOST_ROOT) $(PYTHON_ROOT)
编译boost:
编译pykd:

执行自带的单元测试
F:\_codes\pykd-84103\branch\0.3.x\test\scripts>_run_p
ykdtest.cmd C:\Users\cutepig\Downloads\pykd-0.3.0.26-py27-win32\pykd\pykd.pyd