??xml version="1.0" encoding="utf-8" standalone="yes"?>久久只有这精品99,久久国产精品免费一区二区三区,久久九九免费高清视频http://www.shnenglu.com/tiany/archive/2013/03/26/198824.htmlTianyTianyMon, 25 Mar 2013 16:20:00 GMThttp://www.shnenglu.com/tiany/archive/2013/03/26/198824.htmlhttp://www.shnenglu.com/tiany/comments/198824.htmlhttp://www.shnenglu.com/tiany/archive/2013/03/26/198824.html#Feedback0http://www.shnenglu.com/tiany/comments/commentRss/198824.htmlhttp://www.shnenglu.com/tiany/services/trackbacks/198824.html#pragma once  #define __malloc(_s)    VirtualAl...  阅读全文

Tiany 2013-03-26 00:20 发表评论
]]>
WinDBG命o概览(? - 元命?/title><link>http://www.shnenglu.com/tiany/archive/2013/03/24/198772.html</link><dc:creator>Tiany</dc:creator><author>Tiany</author><pubDate>Sun, 24 Mar 2013 08:10:00 GMT</pubDate><guid>http://www.shnenglu.com/tiany/archive/2013/03/24/198772.html</guid><wfw:comment>http://www.shnenglu.com/tiany/comments/198772.html</wfw:comment><comments>http://www.shnenglu.com/tiany/archive/2013/03/24/198772.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/tiany/comments/commentRss/198772.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/tiany/services/trackbacks/198772.html</trackback:ping><description><![CDATA[<p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px auto; font: 14px/25px Verdana, Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">元命?Meta-Command)用来提供标准命o没有提供的常用调试功? 与标准命令一? 元命令也是内建在调试器引擎或者WinDBGE序文g中的. 所有元命o都已一个点(.)开? 所以元命o也被UCؓ点命?Dot Command).</p> <p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px auto; font: 14px/25px Verdana, Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"> </p> <p style="widows: 2; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px auto; font: 14px/25px Verdana, Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">按照功能, 可以把元命o分成如下几类.</p> <ul style="widows: 2; text-transform: none; background-color: rgb(255,255,255); list-style-type: disc; text-indent: 0px; font: 14px/25px Verdana, Arial, Helvetica, sans-serif; white-space: normal; orphans: 2; letter-spacing: normal; color: rgb(0,0,0); margin-left: 45px; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><li>昄和设|调试会话和调试器选项.</li> <ul style="list-style-type: disc; margin-left: 45px"><li>用于W号选项?strong>.symopt</strong>- Set Symbol Options</li><li>用于W号路径?<strong>sympath</strong>- Set Symbol Path, ?strong>.symfix</strong>- Set Symbol Store Path.</li><li>用于E序源文件的<strong>.srcpath</strong>- Set Source Path,<span id="kwwmkic" class="Apple-converted-space"> </span><strong>.srcnoisy</strong>- Noisy Source Loading,<span id="kk88iyu" class="Apple-converted-space"> </span><strong>.srcfix</strong>- Use Source Server</li><li>用于扩展命o模块路径?strong>.extpath</strong>- Set Extension Path</li><li>用于匚w扩展命o?strong>.extmatch</strong>- Display All Matching Extensions</li><li>用于可执行文件的<strong>.exepath</strong>- Set Executable Path</li><li>讄反汇~选项?strong>.asm</strong>- Change Disassembly Options</li><li>控制表达式评估器?strong>.expr</strong>- Choose Expression Evaluator</li></ul></li><li>控制调试会话或者调试目?</li> <ul style="list-style-type: disc; margin-left: 45px"><li>重新开始调试会话的<strong>.restart</strong>- Restart Kernel Connection(Kernel Mode) ?Restart Target Application(User Mode)</li><li>攑ּ用户态调试目?q程)?strong>.abandon</strong>- Abandon Process</li><li>创徏新进E的<strong>.create</strong>- Create Process</li><li>附加到存在进E的<strong>.attach</strong>- Attach to Process</li><li>打开转储文g?strong>.opendump</strong>- Open Dump File</li><li>分离调试目标?strong>.detach</strong>- Detach from Process</li><li>用于杀掉进E的<strong>.kill</strong>- Kill Process</li></ul></li><li>理扩展命o模块</li> <ul style="list-style-type: disc; margin-left: 45px"><li>加蝲模块?strong>.load</strong>- Load Extension DLL</li><li>卸蝲模块<strong>.unload</strong>- Unload Extension DLL?strong>.unloadall</strong>- Unload All Extension DLLs</li><li>昄已加载模块的<strong>.chain</strong>- List Debugger Extensions</li></ul></li><li>理调试器日志文?/li> <ul style="list-style-type: disc; margin-left: 45px"><li>昄信息<span id="mw4cymc" class="Apple-converted-space"> </span><strong>.logfile</strong>- Display Log File Status</li><li>打开<span id="asa2oks" class="Apple-converted-space"> </span><strong>.logopen</strong>- Open Log File</li><li>q加<span id="8seecgo" class="Apple-converted-space"> </span><strong>.logappend</strong>- Append Log File</li><li>关闭<span id="issygme" class="Apple-converted-space"> </span><strong>.logclose</strong>- Close Log File</li></ul></li><li>q程调试</li> <ul style="list-style-type: disc; margin-left: 45px"><li>用于启动remote.exe服务?strong>.remote</strong>- Create Remote.exe Server</li><li>用于启动调试引擎服务器的<strong>.server</strong>- Create Debugging Server</li><li>列出可用服务器的<strong>.servers</strong>- List Debugging Servers</li><li>用于向远E服务器发送文件的<strong>.send_file</strong>- Send File</li><li>用于l束q程q程服务器的<strong>.endpsrv</strong>- End Process Server</li><li>用于l束引擎服务器的<strong>.endsrv</strong>- End Debugging Server</li></ul></li><li>控制调试?/li> <ul style="list-style-type: disc; margin-left: 45px"><li>让调试器睡眠一D|间的<strong>.sleep</strong>- Pause Debugger</li><li>唤醒处于睡眠状态的调试器的<strong>.wake</strong>- Wake Debugger</li><li>启动另一个调试器来调试当前调试器?strong>.dbgdbg</strong>- Debug Current Debugger</li></ul></li><li>~写命oE序</li> <ul style="list-style-type: disc; margin-left: 45px"><li>包括一pdcMC语言关键字的命o, ?/li> <ul style="list-style-type: disc; margin-left: 45px"><li>.if, .else, .elsif, .foreach, .do, .while. .continue, .catch, .break, .continue, .leave, .printf, .block. ?lt;软g调试>一书第30章的W?8节有介绍命oE序的编写方?</li></ul></ul></li><li>昄或者{储调试目标数?/li> <ul style="list-style-type: disc; margin-left: 45px"><li>产生转储文g?strong>.dump</strong>- Create Dump File</li><li>原始内存数据写到文件的<strong>.writemem</strong>- Write Memory to File</li><li>昄调试会话旉?strong>.time</strong>- Display System Time</li><li>昄U程旉?strong>.ttime</strong>- Display Thread Times</li><li>昄d列表?strong>.tlist</strong>- List Process IDs</li><li>以不同格式显C数字的<strong>.formats</strong>- Show Number Formats</li><li>可以列出所有元命o和每个命令的单说明的<strong>.help</strong>- Meta-Command Help</li></ul></ul><img src ="http://www.shnenglu.com/tiany/aggbug/198772.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/tiany/" target="_blank">Tiany</a> 2013-03-24 16:10 <a href="http://www.shnenglu.com/tiany/archive/2013/03/24/198772.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>WinDBG命o概览(? - 标准命ohttp://www.shnenglu.com/tiany/archive/2013/03/24/198770.htmlTianyTianySun, 24 Mar 2013 08:01:00 GMThttp://www.shnenglu.com/tiany/archive/2013/03/24/198770.htmlhttp://www.shnenglu.com/tiany/comments/198770.htmlhttp://www.shnenglu.com/tiany/archive/2013/03/24/198770.html#Feedback0http://www.shnenglu.com/tiany/comments/commentRss/198770.htmlhttp://www.shnenglu.com/tiany/services/trackbacks/198770.html阅读全文

Tiany 2013-03-24 16:01 发表评论
]]>
VS2008~译驱动环境配置http://www.shnenglu.com/tiany/archive/2013/03/23/198753.htmlTianyTianySat, 23 Mar 2013 12:20:00 GMThttp://www.shnenglu.com/tiany/archive/2013/03/23/198753.htmlhttp://www.shnenglu.com/tiany/comments/198753.htmlhttp://www.shnenglu.com/tiany/archive/2013/03/23/198753.html#Feedback0http://www.shnenglu.com/tiany/comments/commentRss/198753.htmlhttp://www.shnenglu.com/tiany/services/trackbacks/198753.html新徏一个空?/span>win32控制台程?/span>

 1、选(文g→新徏→目→Visual C++目→win32win32控制台项目)创徏一?/span>

 

填写上名U?/span>event然后按确?/span>
在弹出的win32应用E序向导?/span> 选应用程序设|?/span> →附加选项 N空目→完成?/span>

 

?/span> ?nbsp; 选项目菜?#8594;d现有?#8594;d所有驱动相关的*.h,*.c,*.cpp,*.rc之类的文件?/span>

选工?/span>(T)→选项(O)....→目→VC++目录→

  1、在可执行文?/span>目录中添加:

    D:/WINDDK/3790.1830/BIN/X86   //VS2003(没测),VS2005(没测),VS2008内不需?/span>

 

  2、在包含文g目录d如下路径

    D:/WINDDK/3790.1830/inc/wxp
    D:/WINDDK/3790.1830/inc/crt    (
可?/span>)
    D:/WINDDK/3790.1830/inc/ddk/wxp
    D:/WINDDK/3790.1830/inc/ddk/wdm/wxp

 

  3、在库文?/span>目录中添加:

    D:/WINDDK/3790.1830/LIB/WXP/I386

 

event属性设|?/span> 

新徏目配置check //必?/span>

()C/C++属性设|?/span>

   常规选项?/span>

1调试信息格式(C7兼容(/Z7) //可?/span>

2警告{    Q?/span>2U?/span>(/W2)  //可?/span>

3警告视为错?/span>(?/span>(/wx)  //可?/span>

   优化选项?/span>

1优化(/Od)          //可?/span>

  预处理器

    预处理器定义Q?/span>WIN32=100;_X86_=1;WINVER=0x501;DBG=1   //必?/span>

  代码生成

    启用最重新生成:?/span>   //可?/span>

    基本q行时检查:默认?/span>//可?/span>

    q行时库Q多U程调试(/MTd) ?/span> 多线E?/span>(/MT)  //?/span>

    ~冲区安全检查:?/span>   //可?/span>

 (可避免出?/span>LINK : error LNK2001: 无法解析外部W号__security_cookie)

  

 调用U定__stdcall(/Gz)   //必?/span>

链接?/span>

 常规Q?/span>

 输出文gQ?/span>$(OutDir)/$(ProjectName).sys //必?/span>

 启用增量链接Q否(/INCREMENTAL:NO) //选上

 

忽略导入库:?/span>//可?/span>讄为此值时Q必d附加库目录中加:D:/WINDDK/3790.1830/lib/wxp/i386 Q这样项目就不会依赖IDE环境的设|?/span>)   ?/span>讄为此值时Q将依赖IDE 的环境的相关讄)

 输入Q?/span>

附加依赖?/span>ntoskrnl.lib Hal.lib wdm.lib wdmsec.lib wmilib.lib ndis.lib MSVCRT.LIB LIBCMT.LIB //必选其12

//NT式驱?/span>ntoskrnl.lib  WDM式驱?/span>  wdm.lib
 ( HalXXX
函数?/span>Hal.libQ?/span>WmiXXX函数?/span>wmilib.lib Q?/span>NdisXXX函数?/span>ndis.lib )
 
必要旉要增加微软的标准?/span>MSVCRT.LIB MSVCRTD.LIB(调试?/span>) LIBCMT.LIBIBCMTD.LIB(调试?/span>) )
 
如果源码中有source 文gQ那么该文g?/span>TARGETLIBS 字段会列目需要的?/span>)

    忽略所有默认库Q是(/NODEFAULTLIB)

 清单文gQ?/span>

   启用用户账户控制Q?/span>UACQ?/span> ?/span>//必?/span> 不然会出?/span> >LINK : fatal error LNK1295: “/MANIFESTUAC”?/span>“/DRIVER”规范不兼容;链接时不使用“/MANIFESTUAC” 

 调试Q?/span>

    生成调试信息 ?/span>(/DEBUG) //可?/span>

    生成映像文gQ是(/MAP)  //可?/span>

    映像文g名:$(TargetDir)$(TargetName).map //可?/span>

  (System)Q?/span>

    子系l?/span>:控制?/span>(/SUBSYSTEM:CONSOLE) //必?/span>

    堆栈保留大小Q?/span>4194304 //可?/span>

    堆栈提交大小Q?/span>4096    //可?/span>

    驱动E序:   驱动E序(/DRIVER) //必?/span> 

    高Q?/span>

入口点:DriverEntry   //必?/span>

随机基址:默认?/span>    //必?/span> 不然会出?/span> 1>G:/event2008/check/event2008.exe : fatal error LNK1295: “/DYNAMICBASE”?/span>“/DRIVER”规范不兼容;链接时不使用“/DYNAMICBASE”

数据执行保护(DEP): 默认?/span>//必?/span> 不然会出?/span>G:/event2008/check/event2008.sys : fatal error LNK1295: “/NXCOMPAT:NO”?/span>“/DRIVER”规范不兼容;链接时不使用“/NXCOMPAT:NO”

 

讄效应和:?/span>(/RELEASE) //可?/span>

基址Q?/span>0x10000          //选上

  命o?/span>”->附加选项Q?/span>

    d开养I/SECTION:INIT,D /IGNORE:4078 //填上

      可以避免以下错误提示
      LINK : warning LNK4078: 
扑ֈ多个“INIT”节,它们h不同的属?/span>(E2000020)
      LINK : error LNK2001: 
无法解析的外部符?/span>__load_config_used

五.~译Q链接?/span>

一些要修改DDK例子源码方能成功的问题,目前不知道什么选项可以不改Q?/span>
    
源码中的关键?/span>try 要改?/span>__try , except 要改?/span>__except .



Tiany 2013-03-23 20:20 发表评论
]]>
VMware + WinDbg 配置内核调试 http://www.shnenglu.com/tiany/archive/2012/03/03/167024.htmlTianyTianyFri, 02 Mar 2012 16:47:00 GMThttp://www.shnenglu.com/tiany/archive/2012/03/03/167024.htmlhttp://www.shnenglu.com/tiany/comments/167024.htmlhttp://www.shnenglu.com/tiany/archive/2012/03/03/167024.html#Feedback0http://www.shnenglu.com/tiany/comments/commentRss/167024.htmlhttp://www.shnenglu.com/tiany/services/trackbacks/167024.html借助VMware实现单机使用WinDbgq行调试的方法?

安裝VMware Workstation 6.0, WinDbg?br />
具体步骤如下Q?br />
1 讄 VMware 的虚拟com

1.1 q行 VMware Q点?"Edit virtual machine settings"

1.2 点击 "Add..." 来运?VMware ?Hardware Wizard


1.3 选择 "Serial Port"Q点 "下一?


1.4 选择 "Output to named pipe",?"下一?


1.5 W一框里保持默认?\\.\pipe\com_1 <==== 此可ZQ何名
W二框里?This end is the server."
W三框里?The other end is an application."
选中 "Connect at power on"
然后点击 "Advanced>>"


1.6 选中 "Yield CPU on poll"QVMware Support 中提Cq一点)Q然后点完成?br />


1.7 q样完成了虚拟com的设|?br />


1.8 重新启动 VM?br />
2 讄 VMware 虚拟出来?guest os

现在 power on 虚拟出来?guest os

2.1 讄boot.ini

在c:\下,可以扑ֈboot.iniQ可以用C本打开它。我们需要在 guest os 的启动项上加些参敎ͼ才能够用WinDbg调试它。我们可以在现有的行后面直接加参敎ͼ不过强烈推荐复制一个新行,在新行的后面加参数。这样在调试启动有问题的时候,我们可以方便的换回原来的启动方式。下面就是我改好的boot.ini?br />其中 " multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows XP Professional" /fastdetect "
是原来的行?br />" multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows XP Professional - debug" /fastdetect /noguiboot /debug /debugport=com1 /baudrate=115200 " 新加為用?WinDbg 调试的行?br />
------------------------------------------------------------------------------------------

[boot loader]
timeout=10
default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows XP Professional" /fastdetect
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows XP Professional - debug" /fastdetect /debug /debugport=com1 /baudrate=115200

-------------------------------------------------------------------------------------------

q里q要注意的是,timeout不要?Q否则直接启动默认的V新行后面加上了参数 /debug /debugport=com1 /baudrate=115200 Q可以看?debugport=com1 Qbaudrate=115200 。参数的具体作用Q可以参?WinDbg 的帮助文件?br />


2.2 讄com1端口的速度
?guest os 的设备管理器中把com1端口的速度也就?每秒位数",设ؓ和上面一L(fng)115200?/span>


3 讄 WinDbg

我们需要告诉WinDbg通过pipeq行q接和连接的速度。可以在命o提示W(cmd.exeQ下加参?br />-b -k com:port=\\.\pipe\com_1,baud=11520,pipe q行W(xu)inDbgQVMware Support 中没有提?baud=11520 q个参数Q其实这是个比较重要的参敎ͼ。更方便的方法是在桌面徏立一个WinDbg的快h式,在该快捷方式的属性,"目标"框中Q加上参?-k com:port=\\.\pipe\com_1,baud=11520,pipe 。这栯行这个快h式启动的WinDbg完成了讄。参数的具体作用Q可以参?WinDbg 的帮助文件?br />

4 推荐的操作顺?/strong>

4.1 首先q行 VMware Q启?Guest OS Q到pȝ启动选择Q选择 "Microsoft Windows XP Professional - debug" ,先不要按回R?br />
4.2 通过刚才讄好的快捷方式q行W(xu)inDbg?br />
4.3 ?Guest OS 中选择 "Microsoft Windows XP Professional - debug" ,按回车?br />
4.4 E等片刻Q就q接上了。如果很长时间没有连接上的话Q可以按 WinDbg 菜单中的 "Debug"->"Kernel Connection"->"Resynchronize"?
<=== 如有用命令選?此應不會發生


4.5 最后按 WinDbg 菜单中的 "Debug"->"Break" Q你可以向 WinDbg 下命令了?br />


? 其他
?.1 VMware Support 中还提到了可以通过修改虚拟机的配置文g来改变虚拟串口的速度Q有兴趣的话可以参?VMware Support 中的Ҏ(gu)?br />?.2 WinDbg 的菜单项 "View"->"Show Version" 可以看到一些相关信息?br />
参?
Driver Debugging with WinDbg and VMWare
http://silverstr.ufies.org/lotr0/windbg-vmware.html
VMware Support 相关部分 http://www.vmware.com/support/ws3/doc/ws32_devices3.html


One of the first useful things you will want to do when in the bowels of ring 0 is attack the thing from a debugger point of view. In my case I like using Windows Debugger [windbg] (hey its free, fully functional and does remote debugging really well), and found it neccessary to find a way to have it work with VMWare.

The trick to get it to work in VMWare is to get the host OS to believe it is able to connect to a serial port. Through VMWare, to accomplish this, you need to create a named pipe. The following steps will guide you to configuring VMWare (in my case v3.2):

  1. Open up the Configuration Editor (Settings->Configuration Editor)

     

  2. Click Add to run the Hardware Wizard

     

  3. Select Serial Port, and then click the Next button

     

  4. Select the Use named pipe radio button

     

  5. Use the default pipe name. It SHOULD be \\.\pipe\com_1. If it is not, change it to that.

     

  6. Select This end is the Server.

     

  7. Select The other end is an application.

     

  8. Click the Advanced Button.

     

  9. Select the Yield CPU on poll checkbox

    This is an important step as the Kernel in the target virtual machine uses the port in polled mode, not interrupt mode.

     

  10. Click the Finish button, and then click Ok to close the Configuration Editor.

    Once you have configured your VMWare session, you need to power it on. You will be able to confirm that the new virtual serial port is added by clicking on the Devices->serial0 menu item. You should note it is saying "Connecting". This means its now ready for a remote connection.

    Once the actual virtual machine is configured, you need to configure the target operating system installed in the virtual machine to support remote debugging. This is accomplished by editing the boot.ini found in the root of the C:\ drive. To do this, you need to add a /debugport=some_com_port /baudrate=some_baud_rate to the end of an [operating systems] line. I would not recommend doing it to the one that is there. It would be better to copy the line and paste it with the ammendments, and then use the OS's menu selection to determine which mode you would like to boot into. This is what my boot.ini looks like for XP Pro as the operating system in the virtual machine:

     

    [boot loader]
    timeout=30
    default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
    [operating systems]
    multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
    multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional - Debug" /fastdetect /debugport=com1 /baudrate=115200

    You will notice that the second option sets the debugport to com1, and sets the baudrate to 115200. I am told you can tweak this out to get even more speed out. But it seems fine for me at this speed, so I haven't mucked with it at all. If you do try this, drop me an email and let me know how it works out.

    If you set up your boot.ini fine, save it and reboot. You should be prompted with something that looks like this:


    At this point you have completed setting up the VMWare side of things. Now you need to set up the host to connect to it. This is actually rather easy. You just need to tell windbg at the command like to connect to the pipe, like this:

    windbg -k com:port=\\.\pipe\com_1,pipe
    If you are using WinDbg 6.x or newer, a better alternative is to use:
    windbg -b -k com:pipe,port=\\.\pipe\com_1,resets=0

    Thanks needs to go to Randhir Dugal for pointing out the new format for the latest Windbg version.

    I am a rather anal type guy when it comes to security, so I actually made a shortcut on my desktop to WinDbg and added these command line arguments to the Target line. Originally this was so I could run WinDbg with differnet credentials as I do not run with administrator privileges on a day to day basis. I found that with XP's normal security settings for com ports, you can still work in a least privileged environment while doing the development WITHOUT having to use 'runas'. (You are logged into W2K/XP as a least priviledged environment aren't you? If not, you really should read my article on how, and why this is important to do so.)

    At this point fire up the debugger. With any luck you should see something that looks like this:


    If you are using a WinDbg version earlier than 6.x, you will find one issue with this approach. If you cannot seem to connect right away, close Windbg and restart it... it will then work. Seems flaky to me. But it works. And thats a Good Thing™. With the latest versions of WIndbg (6.x and newer) a new resets flag prevents this sort of hanging.

    That is all there is to it. At this point, you can now go nuts with remote debugging. To make sure it works for ya just add some DbgPrint() messages to your ring 0 driver and watch them echo to the screen. Past that, I will leave it to your imagination how to use the debugger :)

    Good luck!



Tiany 2012-03-03 00:47 发表评论
]]>
VS2008+WDK+DDKWzard 搭徏驱动开发环?/title><link>http://www.shnenglu.com/tiany/archive/2012/03/01/166901.html</link><dc:creator>Tiany</dc:creator><author>Tiany</author><pubDate>Thu, 01 Mar 2012 10:25:00 GMT</pubDate><guid>http://www.shnenglu.com/tiany/archive/2012/03/01/166901.html</guid><wfw:comment>http://www.shnenglu.com/tiany/comments/166901.html</wfw:comment><comments>http://www.shnenglu.com/tiany/archive/2012/03/01/166901.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/tiany/comments/commentRss/166901.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/tiany/services/trackbacks/166901.html</trackback:ping><description><![CDATA[<div id="seeoouk" class="post-content"> <p><strong>一、WDK的介l、下载、安装及配制</strong></p> <p>1、关于WDK</p> <p>Windows Driver Kit(<strong>驱动E序工具?/strong>): 是一U完全集成的驱动E序开发系l,它包?Windows Driver Device Kit (DDK)Q用于测?Windows 驱动E序的可靠性和E_性,包括Q?/p> <ul><li><strong>Windows Driver Foundation (WDF)</strong> 化了 Windows 驱动E序的开发和支持?/li><li><strong>头文仉?/strong> QWindows Vista 和更高版本)通过提供更简单的目录l构、避免声明冲H以及对所有支持的 Windows 版本使用单一头文仉Q降低头文g的复杂性?/li><li><strong>Installable File Systems (IFS) Kit</strong>头、库、示例以及文档作?WDK 的一部分分发?/li><li><strong>验证E序和静态分析工?/strong>, Q如 PRE<em>f</em>ast ?nbsp;静态驱动程序验证程序)帮助(zhn)在~译时查?bug?/li></ul> <p>2、下载WDK</p> <p>曄下蝲WDK好像q必dhttp://connect.microsoft.com/注册后才能下载,而且下蝲后还有一句提C:</p> <p>“提醒Q?zhn)必须接受附带的许可条ƾ才能用此软g。不得分发下载Y件包?#8221;</p> <p><span id="more-39"></span></p> <p>所以当时下载的时候还要走一些不得不走的路。不q,今天好像发现WDK能直接下载了</p> <p>下蝲地址Qhttp://download.microsoft.com/download/4/A/2/4A25C7D5-EFBE-4182-B6A9-AE6850409A78/GRMWDK_EN_7600_1.ISO</p> <p>如果不能正常下蝲Q具体操作请见如何下载WDK</p> <p>3、安装WDK</p> <ol><li>用虚拟光驱加载下载好?ISO镜像文gQ双击运行,出现下面亲切的画?nbsp;<br /><img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb.png" width="244" height="174" /> </li><li>接触Q出C下画面,在左侧的?wi)Ş复选框中选择要安装的lg及工P全部安装Q选择好后点击“OK”~~后面的就单了~ <br /><img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb_3.png" width="566" height="400" /> </li><li>?dng)后Q一路确定默认即?img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb_4.png" width="366" height="137" /></li></ol> <p> </p> <p><strong>二、DDKWzard的介l、下载、安装及配制</strong></p> <p>在VS2008IDE中没有提供驱动开发的目选项Q当然可以用普通工E,然后手动在)Q中配制相应的编辑连接以及调试选项Q但是如此只来,每次都要重复些复杂的步骤。在http://ddkwizard.assarbad.net/|站上发C一个很好用的辅助工具DDKWizardQ能够方便地对开发环境进行配|,真是适合xq样懒h啊,工具的作者也自称是因为懒惰才开发此工具Q看?#8220;懒惰是推动科技发展的动?#8221;一点不??/p> <ul><li>DDKwzard安装需要三个文ӞDDKWzardȝ序:安装VS2008的项目模板ddkwizard_setup.exe</li><li>DDKBUILD.CMDQ应该是用VS2008调用WDK~辑~译器的一pd脚本dkbuild_cmd.zip</li><li>DDKBUILD.BAT Q估计也是是用VS2008调用WDK~辑~译器的一pd脚本ddkbuild_bat.zip</li></ul> <ol><li>安装ddkwizard_setupQ默认安装,一路Next点过卛_Q将DDKBUILD.CMD与DDKBUILD.BAT考到WDK的安装目录,或者其它目录也行,只要在后l的讄p。如Q我其攑֜wdk的目录下Q如?nbsp;<br /><img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb_5.png" width="405" height="210" />    <br /> </li><li>讄环境变量 <br />d相应的环境变量,如要开发XPpȝ下的驱动则添加WXPBASEQ变量gؓWDK的根目录Q如?nbsp;<br /><img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb_6.png" width="306" height="337" />如果为其它系l开发驱动则填写相应的环境变?nbsp;<br />NT 4.0 ———–NT4BASE <p> </p> <p>windows2000—-W2KBASE</p> <p>windowsXP——-WXPBASE</p> <p>windows2003—-WNETBASE</p> <p>win7/2008 R2—-W7BASE</p></li><li>打开VS 2008Q菜?#8220;工具”->“选项”->左侧“目和解x?#8221;->“VC++目录”->右侧“可执行文?#8221;下拉列表->d一D:/WINDDK(Ҏ(gu)你的实际情况Q就是第1步中DDKBUILD.CMD与DDKBUILD.BAT所在的路径)?nbsp;<br /><img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb_7.png" width="408" height="225" /> <br /> </li><li>然后可以在我们的VS2008中新建项目了Q如下图Q在Visual C++选项卡中多了DDK Project的项目类型,选择相应的模板添加我们的目Q点ȝ?nbsp;<br /><img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb_8.png" width="541" height="362" /></li><li>定后出现DDKWzard的项目创建页面,?#8220;Choose the DDKBUILD you want to use”中选择“ddkbuild.cmd”或?#8220;ddkbuild.bat”Q在其下面选择我们要ؓWhoQ?000Qxp……Q开发的驱动?nbsp;<br />最后finish <br /><img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb_9.png" width="542" height="435" /></li><li>在解x案中便是由DDKWzard为我们自动生成的一个简单的驱动E序框架?nbsp;<br /> <img title="image" border="0" alt="image" src="http://202.206.196.103/2010/rsy/spltx/img/VS2008WDKDDKWzard_9F4E/image_thumb_10.png" width="239" height="328" /> </li><li>最后点击F6生成解决Ҏ(gu)Q成功生成后在项目的objchk_win7_x86/i386文g夹下会生成几个文?nbsp;<br />driver1.obj —~译生成?q制文g <br />driver1.pdb—用于调试时用的W号文g <br />vc90.pdb—–用于调试时用的W号文g <br /><strong>driver1.sys—是我们拭目以待的驱动程序文?nbsp;<br /></strong></li></ol></div> <img src ="http://www.shnenglu.com/tiany/aggbug/166901.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/tiany/" target="_blank">Tiany</a> 2012-03-01 18:25 <a href="http://www.shnenglu.com/tiany/archive/2012/03/01/166901.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>лǵվܻԴȤ</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.fpzhan.cn" target="_blank">99þþƷѹۿ</a>| <a href="http://www.ofjf.cn" target="_blank">ĻƷѾþþ</a>| <a href="http://www.dashi1.cn" target="_blank">ݺۺϾþAVһ</a>| <a href="http://www.kntcom.cn" target="_blank">ۺ˾þôý</a>| <a href="http://www.softplat.cn" target="_blank">ŷۺҹҹþ</a>| <a href="http://www.hbqw.net.cn" target="_blank">AV˾þԭ</a>| <a href="http://www.024cg.cn" target="_blank">ŮHҳþþ</a>| <a href="http://www.xwiw.cn" target="_blank">þɬۺ</a>| <a href="http://www.uuu9com.cn" target="_blank">þþƷëƬѹۿ</a>| <a href="http://www.zgktjj.cn" target="_blank">ľƷ99þù</a>| <a href="http://www.bulaozhen.cn" target="_blank">97Ʒ91þþþþ</a>| <a href="http://www.oushiliansuowa.cn" target="_blank">޹뾫ƷŮ˾þþò</a>| <a href="http://www.zhouyimen.cn" target="_blank">˾þþƷavһ</a>| <a href="http://www.qeckf.cn" target="_blank">޳˾þ</a>| <a href="http://www.wfmo.cn" target="_blank">91þþƷһ</a>| <a href="http://www.jhitezpt.cn" target="_blank">˾þþƷ鶹</a>| <a href="http://www.mir716.cn" target="_blank">þþþþùƷŮ</a>| <a href="http://www.zqbd.com.cn" target="_blank">þ99Ʒþþ </a>| <a href="http://www.k5158.cn" target="_blank"> þۺϾɫۺϾ99 </a>| <a href="http://www.hpd4.cn" target="_blank">Ʒþþþþù</a>| <a href="http://www.e510.com.cn" target="_blank">þþþþëƬѲ</a>| <a href="http://www.qhcl233.cn" target="_blank">ɫۺϾžþ</a>| <a href="http://www.paypaal.cn" target="_blank">Ʒþþþû</a>| <a href="http://www.51hitjj.cn" target="_blank">ݺɫۺþö</a>| <a href="http://www.hjj9588.cn" target="_blank">츾þþ</a>| <a href="http://www.lingxiu98.com.cn" target="_blank">ҹƷþþþþ˳ </a>| <a href="http://www.henpu.cn" target="_blank">ɫۺϾþ</a>| <a href="http://www.dpww.net.cn" target="_blank">þ99þëƬһ</a>| <a href="http://www.td265.cn" target="_blank">ƷŮþþþ </a>| <a href="http://www.pf925.cn" target="_blank">ŷ˾þô߽ۺ</a>| <a href="http://www.ccka.cn" target="_blank">һƷþð͹</a>| <a href="http://www.hongneiku.cn" target="_blank">99þѹƷ</a>| <a href="http://www.3743.com.cn" target="_blank">պƷþþþþþõӰ</a>| <a href="http://www.510dpw.cn" target="_blank">þþþþþòҰ¸߳</a>| <a href="http://www.yunea.cn" target="_blank">һɫþ88ۺպƷ</a>| <a href="http://www.hz-yarnexpo.com.cn" target="_blank">ݺɫۺϾþȥ</a>| <a href="http://www.beauty-queen.cn" target="_blank">˾þۺ</a>| <a href="http://www.wooblog.cn" target="_blank">91Ըߺþþþ</a>| <a href="http://www.dqjjk.cn" target="_blank">þþþùɫAVѹۿ</a>| <a href="http://www.zqbd.com.cn" target="_blank">þɫ</a>| <a href="http://www.longfee.cn" target="_blank">ձWVһһþ㽶</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>