5

我看到了一些关于 WinDBG commnads 的参考资料和教程。他们中的一些人喜欢这个lm、这个.echo、这个!running和这个nt!_PDB

这些类别之间有什么区别

  • xxx
  • .xxx
  • !xxx
  • xxx!yyy

?

他们看起来很困惑。

4

2 回答 2

11

有内置命令、元命令(点命令)和扩展命令(爆炸命令)。

我个人的看法是,你不必太在意内置命令与元命令相比的区别,因为有足够多的例子表明这些定义不正确匹配。知道它们总是在那里并且不需要加载扩展就足够了。

内置命令的好例子,主要是关于控制和从调试目标获取信息:

g - go
k - call stack
~ - list threads

恕我直言,此定义并不真正匹配的示例:

version    - show version of the debugger
vercommand - show command line that was used to start the debugger
n          - set number base

元命令的好例子,它们被认为只影响调试器而不影响目标:

.cls        - clear screen
.chain      - display loaded extensions
.effmach    - change behavior of the debugger regarding the architecture
.prefer_dml - change output format

恕我直言,此定义并不真正匹配的示例:

.lastevent  - show last exception or event that occurred (in the target)
.ttime      - display thread times (of the target)
.call       - call a function (in the target)
.dvalloc    - allocate memory (in the target)

但是,最好了解扩展命令是不同的,特别是因为相同的命令可能会导致不同的输出,这取决于加载的扩展名或出现在扩展名列表中的第一个扩展名,并且您可以影响顺序(例如,按.load, .unload, .setdll) . 除了简单的形式!command,请注意还有!extension.command明确指定扩展名的语法。我将在下面的示例中使用它。(甚至还有!c:\path\to\extension.command

扩展命令冲突的示例来自内核调试会话,其中一个!heap不提供任何输出,而另一个显然需要一个参数才能工作。

0: kd> !ext.heap
0: kd> !exts.heap
Invalid type information

您的问题()中提到的最后一种格式xxx!yyy不是命令,而是方法或类型信息,其中 xxx 表示模块(DLL),yyy 表示方法或类型名称。通常,这也可以通过方法内部位置的额外字节偏移量 ( xxx!yyy+0xhhh)

于 2016-05-25T19:13:43.370 回答
2

请参阅以下内容:

xxx - these are built in commands
.xxx - these are meta commands
!xxx - these are extension commands, so they call a command from an extension dll
xxx!yyy - this looks the syntax to reference an exported function from a dll:

<dll_name>!<method_name>

您可能会发现以下有用:http ://windbg.info/doc/1-common-cmds.html

于 2016-05-25T15:31:18.587 回答