2012年1月1日 星期日

Windbg --How to get the computer name

In the Windbg help file show us how to get the computer name.  The computer name is a unicode string in the srv!SrvComputerName.

There are two ways to show unicode..


 dS Specifies that a UNICODE_STRING structure is to be displayed.
 du Unicode characters     
    Each line displays up to 48 characters. The display continues until the first null byte or until all characters in 
range have been displayed. All nonprintable characters, such as carriage returns and line feeds,are displayed as periods (.).         
For this case, it can use dS to show the computer name.

0: kd> dS srv!SrvComputerName
fffff8a0`0299aa60  "Y-SKU2-XX"

Note: 1. If the BSOD was happened during entering OS, maybe the srv.sys was not loaded yet.
          2. The srv.sys is the "Server driver"
          3. After try, the "!envvar COMPUTERNAME" command can't show the computer name.

沒有留言:

張貼留言