<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>Daniel Vasquez Lopez's Blog : KD</title><link>http://blogs.msdn.com/danielvl/archive/tags/KD/default.aspx</link><description>Tags: KD</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>How to find a process command-line using kernel debugger?</title><link>http://blogs.msdn.com/danielvl/archive/2007/04/30/how-to-find-a-process-command-line-using-kernel-debugger.aspx</link><pubDate>Tue, 01 May 2007 03:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2347073</guid><dc:creator>Daniel Vasquez Lopez</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/danielvl/comments/2347073.aspx</comments><wfw:commentRss>http://blogs.msdn.com/danielvl/commentrss.aspx?PostID=2347073</wfw:commentRss><description>&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hadn't posted since two years ago; a lot of things happen in such a time and now I'm part of the IIS team. I'm not sure about what to talk about, so I will start with random stuff.&lt;/P&gt;
&lt;P&gt;I found debugging very task oriented, there are a bunch of ways to get an answer to the same question; let's say that someone gave you a machine ready to be debugged in kernel mode and you want to do .tlist -v to list all the processes and the additional information such as PID, Session, Command Line. If you are using a remote machine to access the target machine in kernel mode, .tlist will give you the process in the remote machine; to get the processes in the target machine and dump&amp;nbsp;process information such as the Command Line arguments follow the next steps:&lt;/P&gt;
&lt;P&gt;1. List the processes.&lt;/P&gt;
&lt;P&gt;kd&amp;gt; !process 0 0&lt;/P&gt;
&lt;P&gt;**** NT ACTIVE PROCESS DUMP ****&lt;BR&gt;PROCESS 8447b790&amp;nbsp; SessionId: none&amp;nbsp; Cid: 0004&amp;nbsp;&amp;nbsp;&amp;nbsp; Peb: 00000000&amp;nbsp; ParentCid: 0000&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DirBase: 00122000&amp;nbsp; ObjectTable: 830002d8&amp;nbsp; HandleCount: 580.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Image: System&lt;/P&gt;
&lt;P&gt;... (some other processes)&lt;/P&gt;
&lt;P&gt;PROCESS 867b7d90&amp;nbsp; SessionId: 0&amp;nbsp; Cid: 07a4&amp;nbsp;&amp;nbsp;&amp;nbsp; Peb: 7ffdf000&amp;nbsp; ParentCid: 0a00&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DirBase: 7ea6b560&amp;nbsp; ObjectTable: 83170470&amp;nbsp; HandleCount:&amp;nbsp; 60.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Image: appcmd.exe&lt;/P&gt;
&lt;P&gt;2. Look for your process and copy the DirBase property, in this example I will use appcmd.exe (7ea6b560), and switch to the process' context:&lt;/P&gt;
&lt;P&gt;kd&amp;gt; .context 7ea6b560&lt;/P&gt;
&lt;P&gt;3. Dump the process information, that information includes the command-line&lt;/P&gt;
&lt;P&gt;kd&amp;gt; !peb&lt;/P&gt;
&lt;P&gt;PEB at 7ffdf000&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; InheritedAddressSpace:&amp;nbsp;&amp;nbsp;&amp;nbsp; No&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReadImageFileExecOptions: No&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BeingDebugged:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; No&lt;/P&gt;
&lt;P&gt;.... (more information)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ImageFile:&amp;nbsp;&amp;nbsp;&amp;nbsp; 'D:\Windows\System32\inetsrv\appcmd.exe'&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CommandLine:&amp;nbsp; 'D:\Windows\System32\inetsrv\appcmd.exe clear config -section:system.web&lt;BR&gt;Server/cgi'&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2347073" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/danielvl/archive/tags/KD/default.aspx">KD</category><category domain="http://blogs.msdn.com/danielvl/archive/tags/Kernel/default.aspx">Kernel</category><category domain="http://blogs.msdn.com/danielvl/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/danielvl/archive/tags/Line/default.aspx">Line</category><category domain="http://blogs.msdn.com/danielvl/archive/tags/FTP/default.aspx">FTP</category></item></channel></rss>