如何检查未出现在图像列表中但出现在!DumpDomain输出中的.NET程序集的版本?

时间:2016-07-06 19:57:43

标签: windbg

假设:

0:000> lmm *day*
start             end                 module name
0:000> .shell -i- -ci "!DumpDomain" findstr /i "day"
Assembly:           0000005fa3efdbe0 [C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\mobilewebservice\390f679a\951c08b4\assembly\dl3\95cd4f84\7081b1ad_ccc8d101\Dayforce.Common.dll]
00007ff7b82c8ff8            C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\mobilewebservice\390f679a\951c08b4\assembly\dl3\95cd4f84\7081b1ad_ccc8d101\Dayforce.Common.dll
...

(有很多)

关键是!DumpDomain识别出Dayforce.Common.dll程序集的存在,但lm没有。

我依靠lmvm来获取程序集的版本。但在这里我很困惑:

  1. 首先,lm怎么看不到加载的程序集?
  2. 在这种情况下如何获得程序集的版本?
  3. 请注意,检查托管堆栈会确认已加载程序集,只是它们在图像列表中缺失。

1 个答案:

答案 0 :(得分:4)

TLDR:.imgscan /l扫描MZ标头并加载模块信息。然后再次尝试lm

在我的应用程序中,我可以看到lm没有列出任何程序集。这似乎是一种默认行为,因为我对应用程序中的那些程序集没有任何特殊之处。试图找到一个特定的失败:

0:009> .symfix d:\debug\symbols
0:009> .reload
Reloading current modules
......................................
0:009> lm m Test*
start    end        module name

然而,列出了!DumpDomain

0:009> !DumpDomain
[...]
Assembly:           00737f20 [C:\Program Files (x86)\...\TestAdore.dll]
ClassLoader:        0071dd98
SecurityDescriptor: 00729ba8
  Module Name
00377440    C:\Program Files (x86)\...\TestAdore.dll

使用.imgscan /l我能够找到DLL的MZ头并加载模块信息:

0:009> .imgscan /l
[...]
MZ at 003a0000, prot 00000002, type 01000000 - size e000
  Name: TestAdore.dll
  Loaded TestAdore.dll module

之后,该模块将显示在lm列表中:

0:009> lm m Test*
start    end        module name
003a0000 003ae000   TestAdore   (deferred) 

可以查询版本信息

0:009> lm vm TestAdore
start    end        module name
003a0000 003ae000   TestAdore   (deferred)             
    Image path: TestAdore.dll
    Image name: TestAdore.dll
    Has CLR image header, track-debug-data flag not set
    Timestamp:        Sun Jul 26 23:13:53 2015 (55B54D91)
    File version:     1.0.0.0
[...]