Justdecompiler Q2 2013

8 posts, 0 answers
  1. Isidro Padilla
    Isidro Padilla avatar
    31 posts
    Member since:
    Sep 2012

    Posted 15 Jun 2013 Link to this post

    Hello Justdecompiler Team,
    I'm checking the quality of the generated code and the result is really good. Basically I focus on code quality because the features that I occur to me you have them recorded by other users.

    I've decompiled several assemblies of some difficulty and the result has been very good. Some residual problems are related to anonymous types and MyProject.cs class in those assemblies that were created with VB.Net. These problems are well known to you and I am sure that will be corrected in a timely manner.

    Congratulations and thanks for sharing this valuable tool.
    ipadilla
  2. Vladi
    Admin
    Vladi avatar
    167 posts

    Posted 18 Jun 2013 Link to this post

    Hello Isidro,

    Thank you again for the kind words. We appreciate them a lot.

    As for the VB.NET issues, can you please give us some details? As we have logged some, but better to have them reported twice than to miss them.

    Kind regards,
    Vladi
    Telerik
    Tell us what you think about JustDecompile. Your opinion matters! You can use our forum, or our JustDecompile UserVoice website for feature requests.
  3. DevCraft banner
  4. Isidro Padilla
    Isidro Padilla avatar
    31 posts
    Member since:
    Sep 2012

    Posted 18 Jun 2013 Link to this post

    Hi Vladi,
    okay, here you have MyProject.cs class with 2 errors found:

    1) Exception in: T Create__Instance__ (T).
    2) Missing two lines when writing to disk (Look at the bottom of the class).

    Both errors have been commented in the attached code with /*  */ and repaired for the class to be compilable.

    There is another small problem: The MySettinsProperty.cs class is decompiled correctly, but not written to disk when we export the project.
    This occurs in any assembly that we try to decompile.

    That´s all.

    regards
    ipadilla



    using Luna;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.ApplicationServices;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.CodeDom.Compiler;
    using System.Collections;
    using System.ComponentModel;
    using System.ComponentModel.Design;
    using System.Diagnostics;
    using System.Reflection;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;

    namespace Luna.My
    {
        [GeneratedCode("MyTemplate", "10.0.0.0")]
        [HideModuleName]
        [StandardModule]
        internal sealed class MyProject
        {
            private readonly static MyProject.ThreadSafeObjectProvider<MyComputer> m_ComputerObjectProvider;

            private readonly static MyProject.ThreadSafeObjectProvider<MyApplication> m_AppObjectProvider;

            private readonly static MyProject.ThreadSafeObjectProvider<Microsoft.VisualBasic.ApplicationServices.User> m_UserObjectProvider;

            private static MyProject.ThreadSafeObjectProvider<MyProject.MyForms> m_MyFormsObjectProvider;

            private readonly static MyProject.ThreadSafeObjectProvider<MyProject.MyWebServices> m_MyWebServicesObjectProvider;

            [HelpKeyword("My.Application")]
            internal static MyApplication Application
            {
                [DebuggerHidden]
                get
                {
                    MyApplication getInstance = MyProject.m_AppObjectProvider.GetInstance;
                    return getInstance;
                }
            }

            [HelpKeyword("My.Computer")]
            internal static MyComputer Computer
            {
                [DebuggerHidden]
                get
                {
                    MyComputer getInstance = MyProject.m_ComputerObjectProvider.GetInstance;
                    return getInstance;
                }
            }

            [HelpKeyword("My.Forms")]
            internal static MyProject.MyForms Forms
            {
                [DebuggerHidden]
                get
                {
                    MyProject.MyForms getInstance = MyProject.m_MyFormsObjectProvider.GetInstance;
                    return getInstance;
                }
            }

            [HelpKeyword("My.User")]
            internal static Microsoft.VisualBasic.ApplicationServices.User User
            {
                [DebuggerHidden]
                get
                {
                    Microsoft.VisualBasic.ApplicationServices.User getInstance = MyProject.m_UserObjectProvider.GetInstance;
                    return getInstance;
                }
            }

            [HelpKeyword("My.WebServices")]
            internal static MyProject.MyWebServices WebServices
            {
                [DebuggerHidden]
                get
                {
                    MyProject.MyWebServices getInstance = MyProject.m_MyWebServicesObjectProvider.GetInstance;
                    return getInstance;
                }
            }

            [DebuggerNonUserCode]
            static MyProject()
            {
                MyProject.m_ComputerObjectProvider = new MyProject.ThreadSafeObjectProvider<MyComputer>();
                MyProject.m_AppObjectProvider = new MyProject.ThreadSafeObjectProvider<MyApplication>();
                MyProject.m_UserObjectProvider = new MyProject.ThreadSafeObjectProvider<Microsoft.VisualBasic.ApplicationServices.User>();
                MyProject.m_MyFormsObjectProvider = new MyProject.ThreadSafeObjectProvider<MyProject.MyForms>();
                MyProject.m_MyWebServicesObjectProvider = new MyProject.ThreadSafeObjectProvider<MyProject.MyWebServices>();
            }

            [EditorBrowsable(EditorBrowsableState.Never)]
            [MyGroupCollection("System.Windows.Forms.Form", "Create__Instance__", "Dispose__Instance__", "My.MyProject.Forms")]
            internal sealed class MyForms
            {
                public frmMain m_frmMain;

                public SplashScreen m_SplashScreen;

                [ThreadStatic]
                private static Hashtable m_FormBeingCreated;

                public frmMain frmMain
                {
                    [DebuggerNonUserCode]
                    get
                    {
                        this.m_frmMain = MyProject.MyForms.Create__Instance__<frmMain>(this.m_frmMain);
                        frmMain mFrmMain = this.m_frmMain;
                        return mFrmMain;
                    }
                    [DebuggerNonUserCode]
                    set
                    {
                        if (value != this.m_frmMain)
                        {
                            if (value != null)
                            {
                                throw new ArgumentException("Property can only be set to Nothing");
                            }
                            this.Dispose__Instance__<frmMain>(ref this.m_frmMain);
                        }
                    }
                }

                public SplashScreen SplashScreen
                {
                    [DebuggerNonUserCode]
                    get
                    {
                        this.m_SplashScreen = MyProject.MyForms.Create__Instance__<SplashScreen>(this.m_SplashScreen);
                        SplashScreen mSplashScreen = this.m_SplashScreen;
                        return mSplashScreen;
                    }
                    [DebuggerNonUserCode]
                    set
                    {
                        if (value != this.m_SplashScreen)
                        {
                            if (value != null)
                            {
                                throw new ArgumentException("Property can only be set to Nothing");
                            }
                            this.Dispose__Instance__<SplashScreen>(ref this.m_SplashScreen);
                        }
                    }
                }

                [DebuggerHidden]
                [EditorBrowsable(EditorBrowsableState.Never)]
                public MyForms()
                {
                }

                [DebuggerHidden]
                private static T Create__Instance__<T>(T Instance) where T: Form, new()
                {
                    if ((((Instance == null) || Instance.IsDisposed) ? 1 : 0) == 0)
                    {
                        return Instance;
                    }
                    if (m_FormBeingCreated != null)
                    {
                        if (m_FormBeingCreated.ContainsKey(typeof(T)))
                        {
                            throw new InvalidOperationException(Utils.GetResourceString("WinForms_RecursiveFormCreate", new string[0]));
                        }
                    }
                    else
                    {
                        m_FormBeingCreated = new Hashtable();
                    }
                    m_FormBeingCreated.Add(typeof(T), null);
                    try
                    {
                        return Activator.CreateInstance<T>();
                    }
                    catch (Exception exception)
                    {
                        throw new InvalidOperationException(Utils.GetResourceString("WinForms_SeeInnerException", new string[] { exception.InnerException.Message }), exception.InnerException);
                    }
                    finally
                    {
                        m_FormBeingCreated.Remove(typeof(T));
                    }
                }

    /*            [DebuggerHidden]
                private static T Create__Instance__<T>(T Instance)
                where T : Form, new()
                {
                    T instance;
                    TargetInvocationException targetInvocationException = null;
                    bool flag;
                    flag = (Instance == null || Instance.IsDisposed ? true : false);
                    if (!flag)
                    {
                        instance = Instance;
                    }
                    else
                    {
                        if (MyProject.MyForms.m_FormBeingCreated == null)
                        {
                            MyProject.MyForms.m_FormBeingCreated = new Hashtable();
                        }
                        else if (MyProject.MyForms.m_FormBeingCreated.ContainsKey(typeof(T)))
                        {
                            throw new InvalidOperationException(Utils.GetResourceString("WinForms_RecursiveFormCreate", new string[0]));
                        }
                        MyProject.MyForms.m_FormBeingCreated.Add(typeof(T), null);
                        try
                        {
                            try
                            {
                                instance = Activator.CreateInstance<T>();
                            }
                            catch//
                            // Current member / type: T Luna.My.MyProject/MyForms::Create__Instance__(T)
                            // File path: C:\.Pruebas\Luna V3.4.19.12.exe
                            //
                            // Product version: 2013.1.527.5
                            // Exception in: T Create__Instance__(T)
                            //
                            // Referencia a objeto no establecida como instancia de un objeto.
                            //    en —.–.•( ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\CSharp\CSharpWriter.cs:línea 1071
                            //    en †”.–.Visit(„” ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Ast\BaseCodeVisitor.cs:línea 129
                            //    en Ÿ˜..Visit(„” ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1057
                            //    en Ÿ˜..Visit(IEnumerable €) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1979
                            //    en Ÿ˜..•( ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 3249
                            //    en †”.–.Visit(„” ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Ast\BaseCodeVisitor.cs:línea 132
                            //    en Ÿ˜..Visit(„” ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1057
                            //    en Ÿ˜..Visit(IEnumerable €) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1979
                            //    en Ÿ˜..˜.”() en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1941
                            //    en —.–.Œœ(Action , String šš) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\CSharp\CSharpWriter.cs:línea 459
                            //    en Ÿ˜..”(•Ÿ ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1939
                            //    en †”.–.Visit(„” ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Ast\BaseCodeVisitor.cs:línea 81
                            //    en Ÿ˜..Visit(„” ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1057
                            //    en Ÿ˜..•( ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 3245
                            //    en †”.–.Visit(„” ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Ast\BaseCodeVisitor.cs:línea 132
                            //    en Ÿ˜..Visit(„” ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1057
                            //    en Ÿ˜..Visit(IEnumerable €) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1979
                            //    en Ÿ˜..˜.”() en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1941
                            //    en —.–.Œœ(Action , String šš) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\CSharp\CSharpWriter.cs:línea 459
                            //    en Ÿ˜..”(•Ÿ ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1939
                            //    en †”.–.Visit(„” ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Ast\BaseCodeVisitor.cs:línea 81
                            //    en Ÿ˜..Visit(„” ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1057
                            //    en Ÿ˜..•( ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 3113
                            //    en †”.–.Visit(„” ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Ast\BaseCodeVisitor.cs:línea 90
                            //    en Ÿ˜..Visit(„” ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1057
                            //    en Ÿ˜..Visit(IEnumerable €) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1979
                            //    en Ÿ˜..˜.”() en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1941
                            //    en —.–.Œœ(Action , String šš) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\CSharp\CSharpWriter.cs:línea 459
                            //    en Ÿ˜..”(•Ÿ ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1939
                            //    en †”.–.Visit(„” ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Ast\BaseCodeVisitor.cs:línea 81
                            //    en Ÿ˜..Visit(„” ) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1057
                            //    en Ÿ˜..Write(Ž” Ž”) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1032
                            //    en Ÿ˜..Write(MethodDefinition €) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseImperativeLanguageWriter.cs:línea 1719
                            //    en Ÿ˜.š.WriteInternal(IMemberDefinition , Boolean ˜‘, Boolean ™) en c:\Builds\245\Behemoth\TabAfterFeedbackBranch Production Build\Sources\Decompiler\Cecil.Decompiler\Languages\BaseLanguageWriter.cs:línea 281
                            //
                            // mailto: JustDecompilePublicFeedback@telerik.com
    */

                [DebuggerHidden]
                private void Dispose__Instance__<T>(ref T instance)
                where T : Form
                {
                    instance.Dispose();
                    T t = default(T);
                    instance = t;
                }

                [EditorBrowsable(EditorBrowsableState.Never)]
                public override bool Equals(object o)
                {
                    bool flag = this.Equals(RuntimeHelpers.GetObjectValue(o));
                    return flag;
                }

                [EditorBrowsable(EditorBrowsableState.Never)]
                public override int GetHashCode()
                {
                    int hashCode = this.GetHashCode();
                    return hashCode;
                }

                [EditorBrowsable(EditorBrowsableState.Never)]
                internal new Type GetType()
                {
                    Type type = typeof(MyProject.MyForms);
                    return type;
                }

                [EditorBrowsable(EditorBrowsableState.Never)]
                public override string ToString()
                {
                    string str = this.ToString();
                    return str;
                }
            }

            [EditorBrowsable(EditorBrowsableState.Never)]
            [MyGroupCollection("System.Web.Services.Protocols.SoapHttpClientProtocol", "Create__Instance__", "Dispose__Instance__", "")]
            internal sealed class MyWebServices
            {
                [DebuggerHidden]
                [EditorBrowsable(EditorBrowsableState.Never)]
                public MyWebServices()
                {
                }

                [DebuggerHidden]
                private static T Create__Instance__<T>(T instance)
                where T : new()
                {
                    T t;
                    t = (instance != null ? instance : Activator.CreateInstance<T>());
                    return t;
                }

                [DebuggerHidden]
                private void Dispose__Instance__<T>(ref T instance)
                {
                    T t = default(T);
                    instance = t;
                }

                [DebuggerHidden]
                [EditorBrowsable(EditorBrowsableState.Never)]
                public override bool Equals(object o)
                {
                    bool flag = this.Equals(RuntimeHelpers.GetObjectValue(o));
                    return flag;
                }

                [DebuggerHidden]
                [EditorBrowsable(EditorBrowsableState.Never)]
                public override int GetHashCode()
                {
                    int hashCode = this.GetHashCode();
                    return hashCode;
                }

                [DebuggerHidden]
                [EditorBrowsable(EditorBrowsableState.Never)]
                internal new Type GetType()
                {
                    Type type = typeof(MyProject.MyWebServices);
                    return type;
                }

                [DebuggerHidden]
                [EditorBrowsable(EditorBrowsableState.Never)]
                public override string ToString()
                {
                    string str = this.ToString();
                    return str;
                }
            }

            [ComVisible(false)]
            [EditorBrowsable(EditorBrowsableState.Never)]
            internal sealed class ThreadSafeObjectProvider<T>
            where T : new()
            {
    /* The following to lines are missing when this class is written to disk.            
                [ThreadStatic, CompilerGenerated]
                private static T m_ThreadStaticValue;
    */            
                [ThreadStatic, CompilerGenerated]
                private static T m_ThreadStaticValue;

                internal T GetInstance
                {
                    [DebuggerHidden]
                    get
                    {
                        if (MyProject.ThreadSafeObjectProvider<T>.m_ThreadStaticValue == null)
                        {
                            MyProject.ThreadSafeObjectProvider<T>.m_ThreadStaticValue = Activator.CreateInstance<T>();
                        }
                        T mThreadStaticValue = MyProject.ThreadSafeObjectProvider<T>.m_ThreadStaticValue;
                        return mThreadStaticValue;
                    }
                }

                [DebuggerHidden]
                [EditorBrowsable(EditorBrowsableState.Never)]
                public ThreadSafeObjectProvider()
                {
                }
            }
        }
    }
  5. Yordan Dikov
    Admin
    Yordan Dikov avatar
    69 posts

    Posted 19 Jun 2013 Link to this post

    Hello Isidro,

     Thank you for listing the issues. I'll try to cover each one of them.
    About 1): It seems to me, that this method has try-filter construct inside the code (you can check this by switching JustDecompile to IL, and see if the "filter" keyword appears anywhere in the code). If this is the case, then that's known issue, as JustDecompile doesn't really support try-filter and try-fault constructs.
    About 2): The lines you've added are marked with the [CompilerGenerated] attribute. This means, that JD doesn't have to output that member (in this case a field, but it can be a method or even whole class) as it will be generated by the compiler. We intentionally do not write such members during project generation, as they might make your projects unbuildable (for instance the name of the compiler-generated field will collide with the name of the field the compiler wants to create and this will cause an error).
    I guess the issue for MySettingsProperty is that it's marked as [CompilerGenerated] as well. Would you please check if this is the case.
    If you stumble upon any other strange things in JustDecompile, please do tell us. As Vladi said, it's better to have a bug reported multiple times, than miss it. 

    Regards,
    Yordan Dikov
    Telerik
    Tell us what you think about JustDecompile. Your opinion matters! You can use our forum, or our JustDecompile UserVoice website for feature requests.
  6. Isidro Padilla
    Isidro Padilla avatar
    31 posts
    Member since:
    Sep 2012

    Posted 19 Jun 2013 Link to this post

    Hi Yordan,
    here's my answer.

    1) Indeed the method is "try-filter construct". Here's the evidence:
     
           .method private static !!T Create__Instance__<.ctor ([System.Windows.Forms]System.Windows.Forms.Form) T> (
                    !!T Instance
                ) cil managed
            {
                .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = (
                    01 00 00 00
                )
                .locals init (
                    [0] !!T V_0,
                    [1] string V_1,
                    [2] class [mscorlib]System.Reflection.TargetInvocationException V_2,
                    [3] string[] V_3,
                    [4] bool V_4,
                    [5] bool V_5,
                    [6] bool V_6
                )

                IL_0000: nop
                IL_0001: ldarg.0
                IL_0002: box !!T
                IL_0007: brfalse.s IL_001b

                IL_0009: ldarga.s Instance
                IL_000b: constrained. !!T
                IL_0011: callvirt instance bool [System.Windows.Forms]System.Windows.Forms.Control::get_IsDisposed()
                IL_0016: brtrue.s IL_001b

                IL_0018: ldc.i4.0
                IL_0019: br.s IL_001c

                IL_001b: ldc.i4.1

                IL_001c: nop
                IL_001d: stloc.s V_4
                IL_001f: ldloc.s V_4
                IL_0021: brfalse IL_010c

                IL_0026: ldsfld class [mscorlib]System.Collections.Hashtable Luna.My.MyProject/MyForms::m_FormBeingCreated
                IL_002b: ldnull
                IL_002c: ceq
                IL_002e: ldc.i4.0
                IL_002f: ceq
                IL_0031: stloc.s V_5
                IL_0033: ldloc.s V_5
                IL_0035: brfalse.s IL_006a

                IL_0037: ldsfld class [mscorlib]System.Collections.Hashtable Luna.My.MyProject/MyForms::m_FormBeingCreated
                IL_003c: ldtoken !!T
                IL_0041: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
                IL_0046: callvirt instance bool [mscorlib]System.Collections.Hashtable::ContainsKey(object)
                IL_004b: stloc.s V_6
                IL_004d: ldloc.s V_6
                IL_004f: brfalse.s IL_0067

                IL_0051: ldstr "WinForms_RecursiveFormCreate"
                IL_0056: ldc.i4.0
                IL_0057: newarr [mscorlib]System.String
                IL_005c: call string [Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.Utils::GetResourceString(string,  string[])
                IL_0061: newobj instance void [mscorlib]System.InvalidOperationException::.ctor(string)
                IL_0066: throw

                IL_0067: nop
                IL_0068: br.s IL_0075

                IL_006a: nop
                IL_006b: newobj instance void [mscorlib]System.Collections.Hashtable::.ctor()
                IL_0070: stsfld class [mscorlib]System.Collections.Hashtable Luna.My.MyProject/MyForms::m_FormBeingCreated

                IL_0075: nop
                IL_0076: ldsfld class [mscorlib]System.Collections.Hashtable Luna.My.MyProject/MyForms::m_FormBeingCreated
                IL_007b: ldtoken !!T
                IL_0080: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
                IL_0085: ldnull
                IL_0086: callvirt instance void [mscorlib]System.Collections.Hashtable::Add(object,  object)
                IL_008b: nop
                IL_008c: nop
                .try
                {
                    .try
                    {
                        IL_008d: call !!0 [mscorlib]System.Activator::CreateInstance<!!T>()
                        IL_0092: stloc.0
                        IL_0093: leave.s IL_0112

                        IL_0095: leave.s IL_0109
                    }
                    filter
                    {
                        IL_0097: isinst [mscorlib]System.Reflection.TargetInvocationException
                        IL_009c: dup
                        IL_009d: brtrue.s IL_00a3

                        IL_009f: pop
                        IL_00a0: ldc.i4.0
                        IL_00a1: br.s IL_00b9

                        IL_00a3: dup
                        IL_00a4: stloc.2
                        IL_00a5: call void [Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.ProjectData::SetProjectError(class [mscorlib]System.Exception)
                        IL_00aa: ldloc.2
                        IL_00ab: callvirt instance class [mscorlib]System.Exception [mscorlib]System.Exception::get_InnerException()
                        IL_00b0: ldnull
                        IL_00b1: ceq
                        IL_00b3: ldc.i4.0
                        IL_00b4: ceq
                        IL_00b6: ldc.i4.0
                        IL_00b7: cgt.un

                        IL_00b9: endfilter
                    }
                    catch
                    {
                        IL_00bb: pop
                        IL_00bc: ldstr "WinForms_SeeInnerException"
                        IL_00c1: ldc.i4.1
                        IL_00c2: newarr [mscorlib]System.String
                        IL_00c7: stloc.3
                        IL_00c8: ldloc.3
                        IL_00c9: ldc.i4.0
                        IL_00ca: ldloc.2
                        IL_00cb: callvirt instance class [mscorlib]System.Exception [mscorlib]System.Exception::get_InnerException()
                        IL_00d0: callvirt instance string [mscorlib]System.Exception::get_Message()
                        IL_00d5: stelem.ref
                        IL_00d6: nop
                        IL_00d7: ldloc.3
                        IL_00d8: call string [Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.Utils::GetResourceString(string,  string[])
                        IL_00dd: stloc.1
                        IL_00de: ldloc.1
                        IL_00df: ldloc.2
                        IL_00e0: callvirt instance class [mscorlib]System.Exception [mscorlib]System.Exception::get_InnerException()
                        IL_00e5: newobj instance void [mscorlib]System.InvalidOperationException::.ctor(string,  class [mscorlib]System.Exception)
                        IL_00ea: throw

                        IL_00eb: call void [Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.ProjectData::ClearProjectError()
                        IL_00f0: leave.s IL_0109
                    }
                }
                finally
                {
                    IL_00f2: nop
                    IL_00f3: ldsfld class [mscorlib]System.Collections.Hashtable Luna.My.MyProject/MyForms::m_FormBeingCreated
                    IL_00f8: ldtoken !!T
                    IL_00fd: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
                    IL_0102: callvirt instance void [mscorlib]System.Collections.Hashtable::Remove(object)
                    IL_0107: nop
                    IL_0108: endfinally
                }

                IL_0109: nop
                IL_010a: br.s IL_0111

                IL_010c: nop
                IL_010d: ldarg.0
                IL_010e: stloc.0
                IL_010f: br.s IL_0112

                IL_0111: nop

                IL_0112: ldloc.0
                IL_0113: ret
            }


    2) Yes, it's true what you say you me, Jusdecompiler indicates the field as "CompileGenerated" but perhaps in these cases
        might also be shown  a message when writing to disk, if this is not a big extra work.


            [ComVisible(false)]
            [EditorBrowsable(EditorBrowsableState.Never)]
            internal sealed class ThreadSafeObjectProvider<T>
            where T : new()
            {
                internal T GetInstance
                {
                    [DebuggerHidden]
                    get
                    {
                        if (MyProject.ThreadSafeObjectProvider<T>.m_ThreadStaticValue == null)
                        {
                            MyProject.ThreadSafeObjectProvider<T>.m_ThreadStaticValue = Activator.CreateInstance<T>();
                        }
                        T mThreadStaticValue = MyProject.ThreadSafeObjectProvider<T>.m_ThreadStaticValue;
                        return mThreadStaticValue;
                    }
                }

                [DebuggerHidden]
                [EditorBrowsable(EditorBrowsableState.Never)]
                public ThreadSafeObjectProvider()
                {
                }
            }

            
    These lines are missing.


                [ThreadStatic, CompilerGenerated]
                private static T m_ThreadStaticValue;

        
        
    3) For MySettingsProperty.cs class is also identified as "Compilegenerated" and nothing is written to the hard disk.

    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.ComponentModel.Design;
    using System.Diagnostics;
    using System.Runtime.CompilerServices;

    namespace Luna.My
    {
        [CompilerGenerated]
        [DebuggerNonUserCode]
        [HideModuleName]
        [OptionText]
        [StandardModule]
        internal sealed class MySettingsProperty
        {
            [HelpKeyword("My.Settings")]
            internal static MySettings Settings
            {
                get
                {
                    MySettings @default = MySettings.Default;
                    return @default;
                }
            }
        }
    }

    The truth is that it is a matter of little importance if we consider that Justdecompiler is still in its Beta phase.

    Thank you for your explanation.

    ipadilla

  7. Nikolay G Rusev
    Admin
    Nikolay G Rusev avatar
    44 posts

    Posted 21 Jun 2013 Link to this post

    Hi Isidro,

     Thanks for the follow up. Better handling of compiler generated members and classes is on our list, so stay tuned for updates.
    Also, just a clarification, we've been out of beta ever since Q1 2012.

    Regards,
    Nikolay G Rusev
    Telerik
    Tell us what you think about JustDecompile. Your opinion matters! You can use our forum, or our JustDecompile UserVoice website for feature requests.
  8. Robert Warthen
    Robert Warthen avatar
    3 posts
    Member since:
    Jan 2010

    Posted 22 Apr 2015 in reply to Yordan Dikov Link to this post

    Is there a fix to this issue yet?  I'm running into exactly the same issue with MyProject.cs.  Of course maybe someone knows what this code should look like to begin with....  :)
  9. Alexander
    Admin
    Alexander avatar
    80 posts

    Posted 23 Apr 2015 Link to this post

    Hi Robert,

    Sorry for the inconvenience. The items on our list are prioritized and rather unfortunately the time to fix this issue hasn't came yet.

    Please, update regularly and stay tuned.

    Regards,
    Alexander
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top
DevCraft banner