百度空间 | 百度首页 
               
 
查看文章
 
VistaLKD - 动态开启 vista 系统本机内核调试功能
2008-04-13 22:02
VistaLKD by 小喂

WinDbg 的本机内核调试是个很强大的功能,可以查看修改内核信息。但从 Vista 系统以后,缺省不能使用本机内核调试功能,只能修改启动项打开调试功能重启后才能使用。所以写了个 VistaLKD 小工具,可以动态打开本机内核调试功能,方便使用。


D:\WinDbg>kd -kl

Microsoft (R) Windows Debugger Version 6.8.0004.0 X86
Copyright (c) Microsoft Corporation. All rights reserved.

OSVERSIONINFO(276,6,0,6000,2)
Local kernel debugging is disabled by default in Windows Vista, you must run "bcdedit -debug on" and reboot to enable it
.
Debuggee initialization failed, HRESULT 0x80004001
     "<Unable to get error code text>"

名称:  VistaLKD.png查看次数: 211文件大小:  8.8 KB

D:\WinDbg>kd -kl

Microsoft (R) Windows Debugger Version 6.8.0004.0 X86
Copyright (c) Microsoft Corporation. All rights reserved.

OSVERSIONINFO(276,6,0,6000,2)
Connected to Windows Vista 6000 x86 compatible target, ptr64 FALSE
Symbol search path is: srv*E:\WebSymbols*http://msdl.microsoft.com/download/symbols
Executable search path is:
*******************************************************************************
WARNING: Local kernel debugging requires booting with kernel
debugging support (/debug or bcdedit -debug on) to work optimally.
*******************************************************************************
Windows Vista Kernel Version 6000 MP (2 procs) Free x86 compatible
Product: WinNt, suite: TerminalServer SingleUserTS
Built by: 6000.16584.x86fre.vista_gdr.071023-1545
Kernel base = 0x81c00000 PsLoadedModuleList = 0x81d11e10
Debug session time: Sat Apr   5 07:32:21.600 2008 (GMT+8)
System Uptime: 0 days 0:05:36.475
lkd>
上传的附件
文件类型: zip VistaLKD.zip (2008-04-05 10:21, 110.0 KB, 52 次下载)

类别:调试技术 | 添加到搜藏 | 浏览() | 评论 (7)
 
最近读者:
 
网友评论:
1
2008-05-13 16:04 | 回复
好东西呀,能否共享一下source code呢?
 
2
2008-05-14 09:05 | 回复
实现很简单,就是 ssdt hook 了 NtSystemDebugControl 和 inline hook 了 KdSystemDebugControl 两个函数,驱动没混淆,而且是 chk 方式编译,稍微逆一下就有代码了。:)
 
3
2008-05-21 22:10 | 回复
为什么只hook这两个方法就行了呢? WinDbg的local kernel debugging只需要这两个方法就行了吗?
 
4
2008-05-21 22:12 | 回复
我见过一个工具,好像只需要设置一个内核的一个变量值就可以通过COM口进行debug,不用更改启动项重启vista.
 
5
2008-05-22 09:01 | 回复
WinDbg 就是通过一个自带的驱动,通过这个驱动调用 KdSystemDebugControl 函数来读写内核空间,从而实现本机内核调试的。只不过在 Vista 上 KdSystemDebugControl 函数做了一些判断,Hook 一下跳过这个判断就行了。 有这样的工具吗?叫啥名字?没有启动项,Windows 应该不会初始化内核调试结构的啊!
 
6
2008-05-26 18:56 | 回复
可以给我发个邮件,我把工具发给你看看.
 
7
2008-05-26 18:58 | 回复
前面地址写错了...
 
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu