debugview s s'启用详细内核输出;做?
我遵循了微软的“写Hello World Windows驱动程序(KMDF)”,不确定如何在WindBG上查看输出。在尝试将调试打印过滤器注册表设置为0xffffffff,重新启动和其他Rain Dance Solutions之后,有效的一件事是启用DebugView的“启用冗长的内核输出”选项。现在,WINDBG显示了调试输出。它太冗长了,但至少在那里。
那么,DebugView修改了WindBG显示更多的详细调试输出?
我正在通过Windows主机连接到VM上的WindBG,并通过桥接连接。
I've followed Microsoft's "Write a Hello World Windows Driver (KMDF)" and wasn't sure how to see the output on WinDbg. After trying to set the Debug Print Filter registry to 0xFFFFFFFF, rebooting and other rain dance solutions, the one thing that worked was enabling DebugView's "Enable Verbose Kernel Output" option. Now, WinDbg shows debug outputs. Its too verbose but at least it's there.
So what did DebugView modify for WinDbg to show more verbose debug output?
I'm running WinDbg attached to a VM from my Windows host with a bridged connection.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
tl; dr :它呼吁驱动程序反复调用
ntsetDebugfilterState
在所有内核组件上,因此他们都可以在调试输出上打印某些东西。程序
让程序本身开始;句子
只有一个出现“启用详细的内核输出”
:上面代码将子菜单插入主菜单中。这里重要的是菜单ID,即
0x9c7c
。此菜单ID仅在此处再次使用:
以上代码调用
Deviceiocontrol
,然后检查菜单项。前者意味着该程序实际上是在与设备驱动程序进行交谈。如果我们删除了一些代码,我们可以看到可以将哪个IOCTL发送到驱动程序:
由于RDX可以是0或1,因此最终以(基本10):
因此:
查看由
dbgview64.exe
打开的手柄,我们可以看到\ device> \ device \ dbgv
当前打开。因此,驱动程序当前是从
c:\ windows \ system32 \ drivers \ dbgv.sys
加载的(或者您可以从.RSRC部分提取它...)。驱动程序
查看驱动程序,在驱动程序条目中,我们发现用于
irp_mj_device_control
的功能:在该函数内部,我们在调用右ioctl:
inside in the call(
sub_1800017e0 ) we have a big switch for the IOCTL, here's the case -2096824260 (case -2096824256 is slightly different):
This function is mostly comprised of two loops:
Both calls are on
DbgQueryDebugFilterState
anddbgsetdebugfilterstate
( reactos源)which is just a minimal wrapper around
NtSetDebugFilterState
(reactos source )。据我们所知,调试过滤器状态已查询,保存,然后为所有内核组件设置(以下是内核中的组件表,其中有很多):
这最终意味着所有内核组件都能够能够将某些内容打印到调试输出。
请注意,另一个ioctl只需将组件掩盖重置为在选中主程序中的菜单之前。
TL;DR: it calls a driver to repeatedly call
NtSetDebugFilterState
on all kernel components, so that they are all able to print something on the debug output.Program
Let start with the program itself; there's only one occurrence of the sentence
"Enable Verbose Kernel Output"
:The above code insert the sub-menu into the main menu. What's important here is the the menu ID, namely
0x9C7C
.This menu ID is used only once more here:
The above code calls
DeviceIoControl
and then checks the menu item. The former means the program is actually talking with a device driver.If we remove a bit of code we can see which IOCTL can be sent to the driver:
Since RDX can be either 0 or 1 we end up with (base 10):
Thus:
Looking at the handles opened by
dbgview64.exe
we can see a\Device\dbgv
is currently opened.So the driver is currently loaded from
C:\WINDOWS\system32\Drivers\Dbgv.sys
(or you can extract it from the .rsrc section...).Driver
Looking at the driver, in the driver entry we spot the function used for
IRP_MJ_DEVICE_CONTROL
:Inside that function we have the usual setup before calling the right IOCTL:
Inside the call (
sub_1800017E0
) we have a big switch for the IOCTL, here's the case -2096824260 (case -2096824256 is slightly different):This function is mostly comprised of two loops:
Both calls are on
DbgQueryDebugFilterState
andDbgSetDebugFilterState
(reactos source)which is just a minimal wrapper around
NtSetDebugFilterState
(reactos source).As far as we can see the debug filter state is queried, saved, and then set for all kernel components (following is the component tables from the kernel, there are a lot of them):
Which finally means that all kernel components are able to print something to the debug output.
Note that the other IOCTL just reset the components masks to what they were before checking the menu in the main program.