VMWare +WinDbg 调试驱动

来源:互联网 发布:高可用mysql 第2版 pdf 编辑:程序博客网 时间:2024/06/04 18:29

 

VMWare +WinDbg 调试驱动

由于SoftIce现在已经停止推出新版本了,而且不支持vista;所以我们只有选择WinDbg来调试驱动程序了,WinDbg一般是用双机来调试,如果要使用单机来实现的话就要搭配虚拟机了,我们这里用的是VMWare.

1.      安装配置VMWare

1.1安装VMWare tools,VMWare安装好之后再安装VMWare tools,这个工具包含了一些驱动。

1.2 添加com口,如图:

1.3 增加usb设置的支持

add the following line to the .vmx file of the affected virtual machine:

     usb.generic.allowHID = "TRUE"
   1.4 修改boot.ini文件
     multi(0)disk(0)rdisk(0)partition(1)/WINDOWS="Microsoft Windows XP Professional - debug" /fastdetect /debug 
/debugport=com1 /baudrate=115200

 

2.      安装WinDbg

2.1 创建一个windbgshortcut,设置速率为速率为115200

"C:/Program Files/Debugging Tools for Windows/windbg.exe" -y C:/Windows/Symbols/ -b -k com:port=//./pipe/com_1,baud=115200,pipe,resets=0

2.2 设置WinDgb

在调试前设置Symbol Search Path,如:

D:/YourCodesSymbols; C:/WINDOWS/Symbols;SRV*D:/LocalSymbols*http://msdl.microsoft.com/download/symbols

 

还有Source File PathImage File Path都要设.

 

调试内核驱动的时候,这样设置:

 

Symbol File Path:

D:/ SourceCode/objchk_wnet_x86/i386

Source File Path:

D:/ SourceCode

Image File Path:

D:/ SourceCode /objchk_wnet_x86/i386

 

3. 以调试模式启动虚拟机

在虚拟机等待连接的时候,在WinDbg中选择Kernel Debug,并确定 ,run .reload. 加载符号。

WinDbg显示与虚拟机连接上之后,选择Break

打开源程序文件,插入断点,选择Go

当驱动程序加载并执行到断点处就会停下来

 

 

原创粉丝点击