Posted by: leppie | July 20, 2011

Decompiler FUUU!!!

ILSpy:

Debug.ProcedureEnter(ldtoken($1()));   // WTF?

Reflector:

Crashes blatantly! Unhandled ‘ldtoken’ at offset 0000.

dotPeek:

Well well, at least it got this right! Not sure why it is an issue though…

// ISSUE: method reference
Debug.ProcedureEnter(__methodref (eval\u002Dcore\u0028003\u0029.\u00241));

Responses

  1. This means that ILSpy has encountered a code which is does not know how to convert to C#. I am not sure it is even posible to generate a valid C# in this case. The ILSpy’s solution in these cases is to use the unknown bytecodes as pseudo-functions so that you can still see what is happening. The dotPeek seems to have invented their own keywords.

    I would call the “$1()” a bug though. It should display the method name.

    So what is the parameter of Debug.ProcedureEnter? I believe that in this case ldtoken will give you RuntimeMethodHandle.

    The C# way would be to create a delegate by ldftn + delegate constructor.

    • Yes, the parameter is RuntimeMethodHandle. It is simply used for tracking the current method (name), but more than likely will be more utilized for parameter info perhaps.

      I do see your point regarding the made up name by dotPeek. 🙂

  2. What are you working on?

    • Hey Grant!

      Working on an in-process lightweight debugger for IronScheme.

  3. Just discovered this project, and looks nice!! 🙂
    Is it still alive? 😐

    • Nope, sorry. VS2008 pretty much killed the need for it.


Leave a comment

Categories