How to understand the class name add <> symbol?

£可爱£侵袭症+ 提交于 2019-12-08 01:54:42

问题


How to understand this code in C#?

using System;
internal class <Module>
{
}

The class name can't contain the symbol <> but it is allowed to have it in code? How would you achieve this? And how can I understand this difference?

Take a look at this code:

internal class <Module>{D8BAC701-C957-4CBE-8F97-37BB3A7DAFFE}
{
    static <Module>{D8BAC701-C957-4CBE-8F97-37BB3A7DAFFE}()
    {
        if (!(eqXmHMg8VVPy3nYeAo.eHiMp4DL8(Convert.ToBase64String(Type.GetTypeFromHandle(epOl6XynGueNUNwY5Y.e53w34m968awCm9P85taUZe(33554477)).Assembly.GetName().GetPublicKeyToken()), "eObc8gibn") != "34NavQ/3DsKjaKpYVSNSMjtuaXO9zUZlQl7AY+p3wrM="))
        {
            return;
        }
        while (true)
        {
            eqXmHMg8VVPy3nYeAo.ce4DmfsmSrOT856tDgfrkMb();
        }
    }
}

This class doesn't even have a namespace.

I decompiled this DLL with ILSpy. But how can I use this code and de-obfuscate it?


回答1:


This looks like it could be obfuscated code. That's code that is compiled into IL in a way that is still valid, but can't be easily understood by humans.

This works because the rules for valid identifiers are different in C# and IL. So, when you try to decompile the code, you're getting invalid C#, but the IL itself is valid.

Also, classes don't have to be in namespaces, even in C#.



来源:https://stackoverflow.com/questions/19615662/how-to-understand-the-class-name-add-symbol

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!