简体   繁体   English

在 WinDBG/SOS.DLL 中:如何将 !DumpDomain 列出的所有模块/程序集一次保存到磁盘?

[英]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:为了保存托管模块,请执行以下操作:

  1. Get NetExt extension: https://github.com/rodneyviana/netext/releases获取 NetExt 扩展: https : //github.com/rodneyviana/netext/releases

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

相关问题 Sos.dll和windbg获取引发的异常 - Sos.dll and windbg Get exceptions thrown 如何在C#程序中使用SOS.dll进行自动调试? - How can I use SOS.dll within a C# program for automated debugging purposes? WinDbg:SOS.dll x86 4.0.30319.237的副本 - WinDbg: Copy of SOS.dll x86 4.0.30319.237 引擎盖下的SOS.dll ObjSize和DumpObject。 如何在C#中重新创建SOS.dll? - SOS.dll ObjSize and DumpObject under the hood intricacies. How to recreate SOS.dll in C#? 识别GDR和LDR SOS.dll和mscordacwks.dll - Identify GDR and LDR SOS.dll and mscordacwks.dll VS2010成功加载了SOS.dll,但在我的64位OS上无法使用其他命令 - VS2010 loaded SOS.dll successfully but other commands can't be used on my 64bit OS 有没有办法检查通过SOS.dll分析转储文件时是否触发了垃圾收集 - Is there a way to check if garbage collection was triggered while analyzing dump file through SOS.dll Windbg与SOS,如何转储ac#struct - Windbg with SOS, How to dump a c# struct 如何查找引用特定dll的所有程序集? - How to find all assemblies that reference a specific dll? 如何使用“Directory.getFiles”获取具有特定扩展名的磁盘上的所有文件并将其保存在列表中 - How can i get all files on disk with a specific extension using 'Directory.getFiles' and save them in a list
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM