How can I extract DLL file from memory dump?

前端 未结 3 525
深忆病人
深忆病人 2020-12-19 03:12

I have a memory dump (unmanaged process) . How can I extract (using windbg) one of the dlls loaded into the process ? I mean actually saving the dll file into the disk

3条回答
  •  借酒劲吻你
    2020-12-19 03:51

    To extract a DLL without using SOS, use the .writemem extension as follows:

    1. discover the module start and end addresses using lmvm dllname
      example output for ieframe:
      start end module name
      61370000 61fb8000 ieframe

    2. calculate the length = end-start: ? 61fb8000 - 61370000
      output: Evaluate expression: 12877823 = 00c48000

    3. then save the DLL as follows:
      .writemem C:\tmp\mydll.dll 61370000 L?00c48000

    This is unlikely to give you the exact DLL as it was loaded from disk, fixing this up is non-trivial.

    (Partly based on this article)

提交回复
热议问题