[英]In WinDBG/SOS.DLL: How can I save all modules/assemblies listed by !DumpDomain to disk at once?
I have an app that loads a bunch of dlls
dynamically through a memorystream
at runtime.我有一个应用程序,它在运行时通过
memorystream
动态加载一堆dlls
。 Using WinDBG I can see the loaded modules when using the command !DumpDomain.使用 WinDBG,我可以在使用命令 !DumpDomain 时看到加载的模块。 Using other commands
(like ! lm)
does not show/list these hidden dlls
.使用其他命令
(like ! lm)
不会显示/列出这些隐藏的dlls
。
Now I want to save these dlls
to disk by using the !SaveModule
[ModuleNumber from !DumpDomain list] command.现在我想使用
!SaveModule
[ModuleNumber from !DumpDomain list] 命令将这些dlls
保存到磁盘。 It works perfectly but the thing is I have to do it manually for each module.它工作得很好,但问题是我必须为每个模块手动完成。 I want to automate this process and found the following code:
我想自动化这个过程并找到以下代码:
!for_each_module .if ($spat ("${@#ImageName}","*.exe")) { !SaveModule ${@#Base} c:\temp\${@#ModuleName}.exe } .else { !SaveModule ${@#Base} c:\temp\${@#ModuleName}.dll }
The problem with this code is that the code actually does not export the desired hidden dlls
.此代码的问题在于该代码实际上并未导出所需的隐藏
dlls
。 I think it has something to do that "for_each_module" does not include modules from the !DumpDomain command.我认为它与“for_each_module”不包含来自 !DumpDomain 命令的模块有关。
Does anybody have a solution for that?有人有解决方案吗? Or
或者
Is there a better way to save the dlls
to disk?有没有更好的方法将
dlls
保存到磁盘?
Any advice appreciated!任何建议表示赞赏!
.NET modules are not listed with lm so it is not in .for_each_module .NET 模块未与 lm 一起列出,因此它不在 .for_each_module 中
In order to save managed modules, do this:为了保存托管模块,请执行以下操作:
Get NetExt extension: https://github.com/rodneyviana/netext/releases获取 NetExt 扩展: https : //github.com/rodneyviana/netext/releases
Use !wmodule command: https://github.com/rodneyviana/netext#wmodule使用 !wmodule 命令: https : //github.com/rodneyviana/netext#wmodule
!wmodule -managed -saveto c:\temp\
To avoid saving Microsoft modules (like System.Web.dll), use this command instead:为避免保存 Microsoft 模块(如 System.Web.dll),请改用以下命令:
!wmodule -managed -noms -saveto c:\temp\
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.