Take the 2-minute tour ×

So in the code below you'll notice the comment "// This item is obfuscated and can not be translated."

What I'm wondering is does that mean that the comment is there in place of some obfuscated code and what follows is not actually obfuscated or does it mean "the following code is obfuscated"?

From what I can find on the web it sounds like the former but I'm not sure. The code clearly looks obfuscated but it's not untranslatable, just hilarious.

public static NameValueCollection ParseStringIntoNameValueCollection(string responseString, bool undoCallbackEscapes)
    // This item is obfuscated and can not be translated.
    NameValueCollection values;
    string[] strArray;
    int num;
    string str2;
    string str3;
    int num3;
    goto Label_0027;
switch (num3)
    case 0:
        if (!undoCallbackEscapes)
            goto Label_0057;
        num3 = 4;
        goto Label_0002;

    case 1:
        goto Label_00E5;

    case 2:
        if (num < strArray.Length)
            string str = strArray[num];
            int index = str.IndexOf('=');
            str2 = str.Substring(0, index);
            str3 = str.Substring(index + 1);
            num3 = 0;
            num3 = 6;
        goto Label_0002;

    case 3:
        if (7 < (7 - 5))
            goto Label_0071;
        goto Label_00E5;

    case 4:
        str2 = unEscapeCallbacks(str2);
        str3 = unEscapeCallbacks(str3);
        num3 = 5;
        goto Label_0002;

    case 5:
        goto Label_0057;

    case 6:
        return values;
    values = new NameValueCollection();
    strArray = responseString.Split(new char[] { '&' }, StringSplitOptions.RemoveEmptyEntries);
    num = 0;
    num3 = 1;
    goto Label_0002;
    values.Add(str2, str3);
    num3 = 3;
    goto Label_0002;
    num3 = 2;
    goto Label_0002;

Update: I did find this... "Sometimes, not too often, when Reflector is disassembling source code for you, it will show "This item is obfuscated and can not be translated" instead of code."

Which to me implies that it's covering up obfuscated code with the comment. Can anyone verify this? I did look at the IL and it seems like it's showing everything so maybe that statement isn't accurate.

To me this code looks like it was obfuscated by a 5 year old with a knowledge of BASIC as opposed to some obfuscation software.

share|improve this question
I Like case 3: above. –  No Refunds No Returns Feb 26 '10 at 23:50
It should be noted Case 3 is also how random number generators work. –  Woot4Moo Feb 27 '10 at 0:01
add comment

2 Answers

up vote 1 down vote accepted

No matter how obfuscated it is, you should always be able to decompile into IL, so you can look at that and see if reflector is actually showing you everything.

share|improve this answer
So, I did look at the IL for this and I mean it seems like everything is the probably there, but it's kind of hard to say. How would reflector even know that's obfuscated code? –  Carter Feb 27 '10 at 0:03
add comment

It seems to look obfuscated in the sense, that it's a string function that splits up a string based on the ampersand and goes through the switch/case to determine how to handle it. The usage of goto is purely (by the look of it) to confused code readers in a somewhat bad way...

Sure you can load any .NET EXE/DLL using Redgate's reflector (Formerly Rutz Loeder's Reflector) to analyze and dump the code, so no matter how 'obfuscated' it is, obfuscation does not really serve a purpose as the code can be decompiled quite easily.

There is no real way of protecting the .NET EXE/DLL unless it is encrypted and using a unmanaged C/C++ code to load the .NET runtime, decrypt the .NET EXE and load that into a newly hosting appdomain...

Hope this helps, Best regards, Tom.

share|improve this answer
so ho we can do that? can you show a hello world example pls? –  Mustafa Ekici Feb 3 '12 at 11:50
add comment

Your Answer


