<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Mfartura's blog : Tip</title><link>http://blogs.technet.com/marcelofartura/archive/tags/Tip/default.aspx</link><description>Tags: Tip</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Tip: Kernel Debugging a VPC Server</title><link>http://blogs.technet.com/marcelofartura/archive/2007/06/20/tip-kernel-debugging-a-vpc-server.aspx</link><pubDate>Wed, 20 Jun 2007 10:16:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:1300796</guid><dc:creator>Marcelo Fartura</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/marcelofartura/comments/1300796.aspx</comments><wfw:commentRss>http://blogs.technet.com/marcelofartura/commentrss.aspx?PostID=1300796</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Here is little tip for you that want to practice kernel mode debugging but either don’t have 2 machine machines to play the TARGET and HOST roles or simply don’t want to play with (for any reason) with the old null modem serial cable used to connect the HOST to the TARGET:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It’s possible to use a &lt;A class="" href="http://www.microsoft.com/windows/products/winfamily/virtualpc/default.mspx" target=_blank mce_href="http://www.microsoft.com/windows/products/winfamily/virtualpc/default.mspx"&gt;&lt;FONT color=#800080&gt;Virtual PC&lt;/FONT&gt;&lt;/A&gt; machine to play the TARGET role, so all you would need is the &lt;A class="" href="http://www.microsoft.com/windows/products/winfamily/virtualpc/default.mspx" target=_blank mce_href="http://www.microsoft.com/windows/products/winfamily/virtualpc/default.mspx"&gt;&lt;FONT color=#800080&gt;Virtual PC&lt;/FONT&gt;&lt;/A&gt; image correctly configured to boot up in DEBUG mode (through the regular boot.ini options - /DEBUG /DEBUGPORT=COM# /BAUDRATE=115200) and map its serial COM port to a named pipe.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;How to do so:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Supposing you already have a &lt;A class="" href="http://www.microsoft.com/windows/products/winfamily/virtualpc/default.mspx" target=_blank mce_href="http://www.microsoft.com/windows/products/winfamily/virtualpc/default.mspx"&gt;&lt;FONT color=#800080&gt;Virtual PC&lt;/FONT&gt;&lt;/A&gt; image set up (it can be an image of Windows 2000, Windows XP or Windows 2003), you just need to follow the step by step list below:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;1. Login as admin in the VPC image and edit the c:\boot.ini file to include a new boot up OS option as following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;A default boot.ini file will likely have the following content:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;TABLE class=MsoNormalTable style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BACKGROUND: #e6e6e6; MARGIN: auto auto auto 1.1pt; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellSpacing=0 cellPadding=0 border=1 class="MsoNormalTable"&gt;
&lt;TBODY&gt;
&lt;TR style="HEIGHT: 93.2pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 745.5pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 93.2pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" vAlign=top width=994&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana"&gt;[boot loader]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana"&gt;timeout=3&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana"&gt;default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana"&gt;[operating systems]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana"&gt;multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Edit the boot.ini and add the highlighted line below:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;TABLE class=MsoNormalTable style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BACKGROUND: #e6e6e6; MARGIN: auto auto auto 1.1pt; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellSpacing=0 cellPadding=0 border=1 class="MsoNormalTable"&gt;
&lt;TBODY&gt;
&lt;TR style="HEIGHT: 93.2pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 880.5pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 93.2pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" vAlign=top width=1174&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana"&gt;[boot loader]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana"&gt;timeout=3&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana"&gt;default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana"&gt;[operating systems]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana"&gt;multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; BACKGROUND: yellow; COLOR: blue; FONT-FAMILY: Verdana; mso-highlight: yellow"&gt;multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional – DEBUG" /fastdetect &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;/ DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200&lt;/SPAN&gt;&lt;/B&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;2. Before rebooting the VPC image, go the VPC console, select the option “Settings” under the menu “Edit”. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;Find the configuration item for the COM1 port, select the radio button “Named Pipe” and type the string \\.\pipe\COM1 as the picture below illustrates.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;IMG title="VPC Settings" style="WIDTH: 425px; HEIGHT: 309px" height=309 alt="VPC Settings" src="http://blogs.technet.com/photos/mfartura/images/1300798/425x309.aspx" width=425 mce_src="http://blogs.technet.com/photos/mfartura/images/1300798/425x309.aspx"&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /&gt;&lt;v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"&gt;&lt;v:stroke joinstyle="miter"&gt;&lt;/v:stroke&gt;&lt;v:formulas&gt;&lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 1 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum 0 0 @1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @2 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @3 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @0 0 1"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @6 1 2"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelWidth"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @8 21600 0"&gt;&lt;/v:f&gt;&lt;v:f eqn="prod @7 21600 pixelHeight"&gt;&lt;/v:f&gt;&lt;v:f eqn="sum @10 21600 0"&gt;&lt;/v:f&gt;&lt;/v:formulas&gt;&lt;v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"&gt;&lt;/v:path&gt;&lt;o:lock aspectratio="t" v:ext="edit"&gt;&lt;/o:lock&gt;&lt;/v:shapetype&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;This VPC image (the virtual machine) will be the TARGET system, or the machine whose the kernel will be debugged.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Your real machine (the one hosting the VPC image) will be the HOST machine or the one which will run the debugger that will be attached to the TARGET’s system kernel.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;3. Start a Windbg (from the &lt;a href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx"&gt;Debugging Tools For Windows&lt;/a&gt;) instance with the following command line options:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;TABLE class=MsoNormalTable style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BACKGROUND: #e6e6e6; MARGIN: auto auto auto 1.1pt; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellSpacing=0 cellPadding=0 border=1 class="MsoNormalTable"&gt;
&lt;TBODY&gt;
&lt;TR style="HEIGHT: 24.1pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 328.8pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 24.1pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" vAlign=top width=438&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Verdana"&gt;windbg -k com:pipe,port=\\.\pipe\COM1,resets=0,reconnect&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;The Windbg will open up it’s command window and will wait to connect through the named pipe mapped port as soon as VPC OS starts up. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;The picture below illustrates how the Windbg will start up with these command line parameters:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&lt;IMG title="Windbg KD" style="WIDTH: 653px; HEIGHT: 472px" height=308 alt="Windbg KD" src="http://blogs.technet.com/photos/mfartura/images/1300799/425x308.aspx" width=425 mce_src="http://blogs.technet.com/photos/mfartura/images/1300799/425x308.aspx"&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;4. Now reboot the VPC image and select the new option you’ve included in the boot.ini in the step 1 of this procedure. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;During the boot process, as soon as the kernel gets loaded the Windbg will attach to it. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;All you need to do now if break the debugger at the point you want to start debugging and have fun &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Wingdings; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;SPAN style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;J&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=1300796" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/marcelofartura/archive/tags/Tip/default.aspx">Tip</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/Null+Modem/default.aspx">Null Modem</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/Debug/default.aspx">Debug</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/Windbg/default.aspx">Windbg</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/Virtual+PC/default.aspx">Virtual PC</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/VPC/default.aspx">VPC</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/Kernel/default.aspx">Kernel</category></item><item><title>A Virus Infection: Contolling the Outbreak (tip)</title><link>http://blogs.technet.com/marcelofartura/archive/2006/10/24/a-virus-infection-contolling-the-outbreak-tip.aspx</link><pubDate>Tue, 24 Oct 2006 08:48:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:477732</guid><dc:creator>Marcelo Fartura</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.technet.com/marcelofartura/comments/477732.aspx</comments><wfw:commentRss>http://blogs.technet.com/marcelofartura/commentrss.aspx?PostID=477732</wfw:commentRss><description>&lt;P&gt;This weekend I had the opportunity to work along our security specialists (from PSSSec group) in what we can call&amp;nbsp;the hottest situation&amp;nbsp;involving hundreds of production servers either stopped or severely impacted by a new variation of a worm.&amp;nbsp;&amp;nbsp; As a new variation, the AV signature file wasn't updated with the proper signature and once the first machine got inffected it immediately started spreading the worm accros the customer production environment...&lt;/P&gt;
&lt;P&gt;Details like how the first machine got infected, how the worm spreads itself through the network&amp;nbsp;or even which worm is the variation of, will be ommited here as this scenario will be usefull only to illustrate what the tip is about.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;So, direct to the point:&lt;/U&gt;&lt;/STRONG&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;While on site&amp;nbsp;helping to control the situation,&amp;nbsp;one&amp;nbsp;of the steps in our action plan&amp;nbsp;while the signature file for the AV was being built was to control the infection or in other words, stop the&amp;nbsp;infected machines to keep infecting&amp;nbsp;the others.&amp;nbsp; Clean the machines was something we knew we wouldn't be able to accomplish unless we could build an AV engine overnight :)&lt;/P&gt;
&lt;P&gt;We&amp;nbsp;isolated the worm&amp;nbsp;itself&amp;nbsp;to&amp;nbsp;2 executable files&amp;nbsp;and a&amp;nbsp;DLL.&amp;nbsp; The executables are dropped&amp;nbsp;during the infection and&amp;nbsp;a registry&amp;nbsp;key is changed in order to load them&amp;nbsp;whenever the machine&amp;nbsp;is booted.&amp;nbsp; They also run as&amp;nbsp;Local System, so&amp;nbsp;you can't just open the &lt;STRONG&gt;task&amp;nbsp;manager&lt;/STRONG&gt;,&amp;nbsp;right click their processes,&amp;nbsp;and select the&amp;nbsp;&lt;STRONG&gt;"End process"&lt;/STRONG&gt; option as this would cause a access denied.&amp;nbsp;&amp;nbsp;What you can do though, is to&amp;nbsp;use the utility &lt;STRONG&gt;kill.exe&lt;/STRONG&gt;&amp;nbsp;together with the tlist.exe from&amp;nbsp;&lt;a href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx"&gt;Debugging Tools For Windows&lt;/a&gt; , build a script&amp;nbsp;that will filter the tlist.exe's output trying to&amp;nbsp;find the&amp;nbsp;specific processes names and then run&amp;nbsp;kill.exe to kill them, and&amp;nbsp;then you&amp;nbsp;use&amp;nbsp;the at.exe command or the &lt;STRONG&gt;Task&amp;nbsp;Scheduler&lt;/STRONG&gt; to schedule such a script to run.&amp;nbsp;&amp;nbsp;By using the&amp;nbsp;Task Scheduler service your script will run as&amp;nbsp;Local System and should be able to kill the processes running under the same security context.&lt;/P&gt;
&lt;P&gt;Ok, but this does not prevent the process to get&amp;nbsp;spawned again&amp;nbsp;(for instance in the next boot) and even deleting the registry entries that&amp;nbsp;could cause that, since the AV is not effective, this machine can get&amp;nbsp;infected again and&amp;nbsp;you will never&amp;nbsp;know when to run the script again to&amp;nbsp;stop the&amp;nbsp;worm's processes.&amp;nbsp; We needed&amp;nbsp;to find a&amp;nbsp;way to prevent these&amp;nbsp;specific processes to keep getting respawned...&lt;/P&gt;
&lt;P&gt;So here is the tip for something you can use in&amp;nbsp;different OS versions from Windows NT to Windows 2003 to accomplish that:&amp;nbsp;&amp;nbsp;There&amp;nbsp;is a registry key called &lt;STRONG&gt;"Image File Execution Options"&lt;/STRONG&gt; under &lt;STRONG&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion&lt;/STRONG&gt; which is normally used for debugging purposes.&amp;nbsp; There is a specific string value that we can use to accomplish our demand of preventing the processes to run.&amp;nbsp; It's the&lt;STRONG&gt; "Debugger"&lt;/STRONG&gt; SZ value.&amp;nbsp; This value is used to include a debugger that should launch the process whenever there is a demand for the OS to spawn it.&amp;nbsp; For instance:&amp;nbsp; If you create a key named "Calc.exe" under&lt;STRONG&gt; "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options"&lt;/STRONG&gt; and add a SZ value called "Debugger" and set it to, for instance, a debugger like cdb.exe (Debugger = c:\debuggers\cdb.exe) the effect will be such that whenever you try to execute the program calc.exe (regardless of user and regardless of how) the debugger cdb.exe will be called instead and it will spawn the calc.exe itself within the debugger.&lt;/P&gt;
&lt;P&gt;All right, so now we just need to be creative and find a way to, instead of run a debugger, just prevent the process to be spawned.&amp;nbsp; Here is one way:&lt;/P&gt;
&lt;P&gt;1. Create a registry key with the name of the process you want to prevent to execute.&amp;nbsp; Ex.: calc.exe&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\calc.exe&lt;/STRONG&gt; &lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;2. Under this new key you've just created, create a SZ value called "Debugger" and set it to the following value:&lt;BR&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;SZ Debugger = "cmd.exe /c echo&amp;nbsp; %time% %date% &amp;gt;&amp;gt; c:\ExecBlocked.log"&lt;/STRONG&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's it.&amp;nbsp; You don't need to restart anything or reboot the machine.&amp;nbsp; From now on you will not only be unable to run calc.exe as whenever you try to do it the file ExecBlocked.log will get the attempt to execute recorded with the date/time information.&lt;/P&gt;
&lt;P&gt;To enable the process the run again, simply remove the registry key.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=477732" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/marcelofartura/archive/tags/Tip/default.aspx">Tip</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/Debug/default.aspx">Debug</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/Gflags/default.aspx">Gflags</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/Image+File+Execution+Options/default.aspx">Image File Execution Options</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/Registry/default.aspx">Registry</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/Virus/default.aspx">Virus</category></item><item><title>Perfmon's counters output format (tip)</title><link>http://blogs.technet.com/marcelofartura/archive/2006/09/14/perfmon-s-counters-output-format-tip.aspx</link><pubDate>Thu, 14 Sep 2006 03:38:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:456069</guid><dc:creator>Marcelo Fartura</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.technet.com/marcelofartura/comments/456069.aspx</comments><wfw:commentRss>http://blogs.technet.com/marcelofartura/commentrss.aspx?PostID=456069</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The System Monitor (Perfmon.exe) reports the data gathered through some of its objects and counters with no formatting and depending on what kind of counters are you looking at, or how tired you are, sometimes&amp;nbsp;this can be confusing and even cause misinterpretation problems.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;As an example, take the counter&amp;nbsp;Processes::Virtual Bytes.&amp;nbsp; We normally have MBytes or even more than 1GByte being reported, however the output is still reported in bytes with thousands separators.&amp;nbsp; The following picture better illustrates this situation:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/photos/mfartura/picture456345.aspx" target=_blank mce_href="http://blogs.technet.com/photos/mfartura/picture456345.aspx"&gt;&lt;IMG src="http://blogs.technet.com/photos/mfartura/images/456345/630x476.aspx" border=0 mce_src="http://blogs.technet.com/photos/mfartura/images/456345/630x476.aspx"&gt;&lt;/A&gt;&lt;A href="file:///C:/Documents%20and%20Settings/mfartura/Application%20Data/Windows%20Live%20Writer/PostSupportingFiles/a717eb07-d087-4583-9197-5fd798cb8bba/image05.png" mce_href="file:///C:/Documents%20and%20Settings/mfartura/Application%20Data/Windows%20Live%20Writer/PostSupportingFiles/a717eb07-d087-4583-9197-5fd798cb8bba/image05.png" atomicselection="true"&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The tip to fix it is provided by the article &lt;/FONT&gt;&lt;A href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;300884" mce_href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;300884"&gt;&lt;FONT face=Verdana color=#0000ff size=2&gt;KB300884 - How to: Display Comma Separators in Windows Performance Tool in Windows XP&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;and after changing the registry as instructed in the article, the System Monitor's output will be like the picture below:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/photos/mfartura/picture456344.aspx" target=_blank mce_href="http://blogs.technet.com/photos/mfartura/picture456344.aspx"&gt;&lt;IMG src="http://blogs.technet.com/photos/mfartura/images/456344/636x456.aspx" border=0 mce_src="http://blogs.technet.com/photos/mfartura/images/456344/636x456.aspx"&gt;&lt;/A&gt;&lt;A href="file:///C:/Documents%20and%20Settings/mfartura/Application%20Data/Windows%20Live%20Writer/PostSupportingFiles/a717eb07-d087-4583-9197-5fd798cb8bba/image08.png" mce_href="file:///C:/Documents%20and%20Settings/mfartura/Application%20Data/Windows%20Live%20Writer/PostSupportingFiles/a717eb07-d087-4583-9197-5fd798cb8bba/image08.png" atomicselection="true"&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Depending on what problem you're troubleshooting&amp;nbsp;you might want to use the Processes and Threads objects.&amp;nbsp; When choosing which process or which thread within a process we want to monitor, the System Monitor does not report a important information called Process ID for processes and Thread ID for the threads.&amp;nbsp;&amp;nbsp;Instead the&amp;nbsp;objects provide a separate counter named ID Process and ID Thread which are supposed to provide these information.&amp;nbsp; So another good tip, that might save you some time, is to create the following registry DWORD values:&lt;/FONT&gt;&lt;/P&gt;
&lt;H4&gt;&lt;FONT face=Verdana color=#004080 size=2&gt;&lt;STRONG&gt;KEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PerfProc\Performance&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P align=left&gt;&lt;FONT face=Verdana color=#004080 size=2&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessNameFormat = 2&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P align=left&gt;&lt;FONT face=Verdana color=#004080 size=2&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ThreadNameFormat = 2&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P align=center&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;After restarting the System Monitor, the next time you need to use either the Process or Threads objects, they will appear followed by their ID information as illustrated in the pictures below:&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;A href="file:///C:/Documents%20and%20Settings/mfartura/Application%20Data/Windows%20Live%20Writer/PostSupportingFiles/a717eb07-d087-4583-9197-5fd798cb8bba/image015.png" mce_href="file:///C:/Documents%20and%20Settings/mfartura/Application%20Data/Windows%20Live%20Writer/PostSupportingFiles/a717eb07-d087-4583-9197-5fd798cb8bba/image015.png" atomicselection="true"&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt; &lt;/FONT&gt;&lt;/P&gt;&lt;FONT face=Verdana size=2&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/photos/mfartura/picture456343.aspx" target=_blank mce_href="http://blogs.technet.com/photos/mfartura/picture456343.aspx"&gt;&lt;IMG src="http://blogs.technet.com/photos/mfartura/images/456343/640x313.aspx" border=0 mce_src="http://blogs.technet.com/photos/mfartura/images/456343/640x313.aspx"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#ff0000 size=2&gt;&lt;STRONG&gt;Thank you Brian for the Tip!!!!&amp;nbsp; It has been saving a lot of my time :)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=456069" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/marcelofartura/archive/tags/Tip/default.aspx">Tip</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/objects/default.aspx">objects</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/Perfmon/default.aspx">Perfmon</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/decimal/default.aspx">decimal</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/counters/default.aspx">counters</category><category domain="http://blogs.technet.com/marcelofartura/archive/tags/Output/default.aspx">Output</category></item></channel></rss>