2

I have attached windbg to an application, I then inject a simple .dll which I made.

I use the line

lm

The output is

259b0000 259e5000 Project (deferred)

I then use

0:046> !SaveModule 259b0000 c:\Users\name\Documents\pleasework.dll

With the error:

No export sam found

Could someone please suggest a way to fix this error. Thank you

Edit I made a really stupid mistake I forgot to load SOS.dll I do this then after entering the !sam or !SaveModule command I get this error

Extension commands need clr.dll in order to have something to do.

I try all the sxe ld clr etc. I enter "g" it doesn't break automatically so I break it myself then still get this

.loadby sos clr

Unable to find module 'clr'

reidjako
  • 384
  • 3
  • 4
  • 17
  • Possible duplicate of [.loadby not work, but .load works well](http://stackoverflow.com/questions/25929496/loadby-not-work-but-load-works-well) – Thomas Weller May 08 '16 at 14:04
  • 3
    Are you sure you're debugging a .NET application? What does '!lmi clr' show? If not found, what does '!lmi mscorwks' show? The former module is for later versions of .NET and the latter is for earlier versions. – Marc Sherman May 08 '16 at 15:36
  • Marc is exactly right. Run those two commands, and if they do not show either as loaded in the target, then no runtime has been initialized. With no .NET runtime in the target, SOS has no point. – Steve Johnson May 09 '16 at 03:28
  • @SteveJohnson: well, `!sam` as long as it only saves a DLL could be potentially useful. – Thomas Weller May 10 '16 at 14:32
  • @Thomas: That's true, but I think SOS always looks for a runtime in its extension init. – Steve Johnson May 11 '16 at 04:05

0 Answers0