Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check the version of a .NET assembly which does not appear in the image list, but does appear in the !DumpDomain output?

Tags:

windbg

Given:

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
...

(There are pretty many)

The point is that !DumpDomain recognizes the presence of the Dayforce.Common.dll assembly, but lm does not.

I depend on lmvm to get the version of the assembly. But here I am puzzled:

  1. First of all how come lm does not see an assembly that is loaded?
  2. How to get the version of the assembly in this case?

Note that inspecting managed stacks confirm that the assemblies are loaded, it is just that they are missing from the image list.

like image 784
mark Avatar asked Oct 24 '25 00:10

mark


1 Answers

TLDR: .imgscan /l scans for MZ headers and loads module info. Then try lm again.


In my application I can see that none of my assemblies are listed by lm. This seems to be a kind of default behavior, since I do nothing special about those assemblies in my application. Trying to find a specific one fails:

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

However, doing a !DumpDomain it is listed:

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

Using .imgscan /l I was able to find the MZ header of the DLL and load the module information:

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

After that, the module appears in the lm list:

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

and the version info can be queried

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
[...]
like image 145
Thomas Weller Avatar answered Oct 26 '25 08:10

Thomas Weller



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!