Re: 怎么写windbg的扩展命令?

WinDbg

怎么写windbg的扩展命令?


文竹 2008-10-10, 10:40 上午
怎么写windbg的扩展命令,最好能举个例子~

Re: 怎么写windbg的扩展命令?


格蠹老雷 2008-10-10, 12:40 下午
如果你有《软件调试》,那么5.2.3节给出了一个完整的实例。如果没有,那么看WinDBG的SDK。

Re: 怎么写windbg的扩展命令?


文竹 2008-10-10, 13:29 下午
谢谢 Raymond ~我有这本书;
现在好好研究下

Re: 怎么写windbg的扩展命令?


文竹 2008-10-10, 14:04 下午
Raymond ~书看了下程序有点复杂~;
可不可以给我举个简单一点的例子;谢谢~


Re: 怎么写windbg的扩展命令?


格蠹老雷 2008-10-10, 22:46 下午
这个例子输出了两个命令,一个是lbr,一个是help,后者非常简单,只有下面几句话:
DECLARE_API ( help )
{
Version();
dprintf(
" lbr - Reads and dumps LBR registers\n"
" help - Shows this help\n"
);
}
事实上,每个扩展命令就是这个DLL输出的一个函数。

Re: 怎么写windbg的扩展命令?


nightxie 2008-10-10, 23:33 下午
Raymond 前辈好耐心哦~~~>_<

Re: 怎么写windbg的扩展命令?


王宇 2008-10-11, 00:25 上午
Raymond 老师技术、为人都堪称楷模! ^_^

Re: 怎么写windbg的扩展命令?


文竹 2008-10-12, 17:01 下午
Raymond ,你好~
经过我两天对代码的研究;我还是没有明白写windbg的扩展命令的基本方法和要领~
现在极度困惑中;望您能给详细指导下!感激不尽~~~

Re: 怎么写windbg的扩展命令?


格蠹老雷 2008-10-13, 13:30 下午
文竹,
你是不能理解扩展命令的原理,还是具体操作时遇到困难?你尝试编译过LBR例子么?建议你把遇到的问题具体描述一下。

Re: 怎么写windbg的扩展命令?


文竹 2008-10-13, 16:14 下午
Raymond ,你好!我是还没弄明白理解扩展命令的原理
我尝试编译过lbr的例子,例子是完好的,是我还没清楚程序的主要框架和要注意的问题;
由于工作需要我必须尽快写出需要的windbg扩展命令的Dll文件,我现在找到了这篇文章正在学习中http://www.codeproject.com/KB/debug/cdbntsd4.aspx


望能得到您的指点,感激不尽~~~

Re: 怎么写windbg的扩展命令?


格蠹老雷 2008-10-13, 23:14 下午
你的问题还是够庞大的。抽出些时间,写了一篇关于扩展命令原理的文章http://advdbg.org/blogs/advdbg_system/articles/1268.aspx,希望对你能有帮助。

Re: 怎么写windbg的扩展命令?


Coding 2008-10-13, 23:16 下午
看Windbg的help文件和他的sample例子吧,挺好理解的。

Re: 怎么写windbg的扩展命令?


文竹 2008-10-14, 10:57 上午
再次深深的感谢 Raymond ! 你的技术令我很敬畏,你对提问者不断耐心的解释也很令人很折服!谢谢你对我所提问题的不断指导,同时很感激你专门写得windbg扩展原理的这篇文章~~使我受益匪浅~

Re: 怎么写windbg的扩展命令?


文竹 2008-10-14, 17:44 下午
Raymond !你好,我在编译lbr例子时,总会出现这种情况怎么回事?
是不是由于我用的是vc++6.0的原因:
-------------------Configuration: LBR - Win32 Debug--------------------
Compiling...
exts.cpp
c:\documents and settings\administrator\桌面\sdk\samples\exts\exts.cpp(363) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.
Creating browse info file...
BSCMAKE: error BK1506 : cannot open file '\Documents and Settings\Administrator\temp\Debug\exts.sbr': No such file or directory
Error executing bscmake.exe.

LBR.dll - 2 error(s), 0 warning(s)
还有编写sdk/samples/extcpp也有以下错误;
-------------------Configuration: extcpp - Win32 Debug--------------------
Compiling...
extcpp.cpp
c:\program files\debugging tools for windows (x86)\sdk\samples\extcpp\extcpp.cpp(11) : fatal error C1083: Cannot open include file: 'engextcpp.hpp': No such file or directory
Error executing cl.exe.

extcpp.obj - 1 error(s), 0 warning(s);
困惑中。。。。。。。

Re: 怎么写windbg的扩展命令?


文竹 2008-10-14, 19:23 下午

我自己把lbr的问题找出来了,可是sdk里面的例子都编不过~大多有如下错误:

------------------Configuration: engextcpp - Win32 Debug--------------------
Compiling...
engextcpp.cpp
c:\documents and settings\administrator\桌面\sdk\inc\engextcpp.cpp(9) : fatal error C1083: Cannot open include file: 'engextcpp.hpp': No such file or directory
Error executing cl.exe.

engextcpp.exe - 1 error(s), 0 warning(s)

 总页数 1 第 3 页 [共有 42 条记录] 1 2 3 >

Powered by Community Server Powered by CnForums.Net