I have a dump of a .NET application which creates and loads too many dynamic assemblies. I would like to inspect what is inside one of these assemblies.
For that, I want to dump such an assembly into a file and open it in Reflector.
The problem - I have no idea how to do it.
So, my question is this - given a full memory dump, how do I dump an arbitrary assembly to a file, in such a way that the new file is a valid .NET module or assembly itself?
A simpler variation - how do I do it from a live debugging session?
I am using WinDBG with SOS and SOSEX.
EDIT 1
So, 3 years later I need it again. Here is the relevant output from !DumpDomain
:
Assembly: 007f89a0 (Dynamic) []
ClassLoader: 00877998
SecurityDescriptor: 00879410
Module Name
054d0010 Dynamic Module
Starting with this information, how can I find the start and end of this assembly? Then I could use the .writemem
command.