9

I have a .NET method which is marked as an "Internal Call", meaning that it is implemented within the CLR itself. Is there any way to locate the code for and/or decompile such a method?

Stolas
  • 2,331
  • 14
  • 34
Levi Botelho
  • 193
  • 4
  • You can just read the CLR, it is almost the same as Assembly. But you can give ILSpy a try. Not sure if it will work but give it a go. – Stolas Sep 06 '13 at 13:03
  • ILSpy will not work on internal calls, they are native methods. – Shaun Wilson Dec 19 '13 at 15:25
  • 1
    I might have misinterpreted your question, but you can browse trough the source of .NET, search on Stackoverflow. (also http://www.dotnetframework.org) – Dominik Antal Dec 30 '13 at 13:55

1 Answers1

3

If you use the windbg sos extension you can step into the internal calls - which are unmanaged code. The documentation for using sos is a bit tricky to sort out IMO. This link is helpful for learning the sos commands: http://msdn.microsoft.com/en-us/library/bb190764(v=vs.110).aspx. To load SOS I use:

.loadby sos clr ; for .NET 4 and higher
.loadby sos mscorwks ; for .NET 2

However you have to wait until the .NET DLLs have been loaded before those commands work, so you either have to set a breakpoint or make sure the managed code has some kind of wait (for input or something else) to allow the process to load the .NET DLLs.

user2460798
  • 176
  • 3