Icorrect decompilation of obfuscated code

2 posts, 0 answers
  1. Scott Shuppert
    Scott Shuppert avatar
    9 posts
    Member since:
    Feb 2010

    Posted 25 Apr 2012 Link to this post

    This IL code:

    .method public hidebysig virtual
        instance void GetObjectData (
            class [mscorlib]System.Runtime.Serialization.SerializationInfo info,
            valuetype [mscorlib]System.Runtime.Serialization.StreamingContext context
        ) cil managed
    {
        .permissionset demand = {
            [mscorlib]System.Security.Permissions.SecurityPermissionAttribute = {
                property bool SerializationFormatter = bool(true)
            }
        }
        IL_0000: ldarg.1
        IL_0001: brtrue.s IL_001d
     
        IL_0003: ldc.i4.1
        IL_0004: br.s IL_0009
     
        IL_0006: ldc.i4.0
        IL_0007: br.s IL_0009
     
        IL_0009: brfalse.s IL_000b
     
        IL_000b: br.s IL_000d
     
        IL_000d: ldstr "info"
        IL_0012: ldstr "Argument 'info' cannot be null."
        IL_0017: newobj instance void [mscorlib]System.ArgumentNullException::.ctor(string,  string)
        IL_001c: throw
     
        IL_001d: ldarg.1
        IL_001e: ldstr "type"
        IL_0023: ldarg.0
        IL_0024: ldfld class [mscorlib]System.Type Atalasoft.Imaging.AtalasoftLicenseException::b
        IL_0029: callvirt instance void [mscorlib]System.Runtime.Serialization.SerializationInfo::AddValue(string,  object)
        IL_002e: ldarg.0
        IL_002f: ldarg.1
        IL_0030: ldarg.2
        IL_0031: call instance void [mscorlib]System.Exception::GetObjectData(class [mscorlib]System.Runtime.Serialization.SerializationInfo,  valuetype [mscorlib]System.Runtime.Serialization.StreamingContext)
        IL_0036: ret
    }

    decompiled as:

    [SecurityPermission(SecurityAction.Demand, SerializationFormatter=true)]
    public override void GetObjectData(SerializationInfo info, StreamingContext context)
    {
        if (info != null)
        {
            info.AddValue("type", this.b);
            base.GetObjectData(info, context);
            return;
        }
        else
        {
            bool flag = true;
            !flag;
            throw new ArgumentNullException("info", "Argument 'info' cannot be null.");
        }
    }

    Hint: strange !flag; line of code.

  2. Yordan Dikov
    Admin
    Yordan Dikov avatar
    69 posts

    Posted 04 May 2012 Link to this post

    Hi Scott,

     Please excuse me for the delayed response. At the moment we don't support decompilation of obfuscated code, so statements like this are not a rare case. However, we've logged the issue and we'll definitely try to fix it at some later stage. Stay tuned for updates and don't hesitate to contact us about anything else that bothers you in JustDecompile.

    Regards,
    Yordan Dikov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top