如何理解类名添加<>符号? [英] How to understand the class name add <> symbol?

查看:86
本文介绍了如何理解类名添加<>符号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在C#中理解此代码?

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?

看看下面的代码:

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.

我用 ILSpy 反编译了这个DLL。但是如何使用此代码并对其进行模糊处理?

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

推荐答案

这看起来可能是混淆代码。该代码以仍然有效的方式编译到IL中,但人类无法轻易理解。

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.

之所以有效,是因为有效标识符的规则不同在C#和IL中。因此,当您尝试反编译代码时,您会得到无效的C#,但是IL本身是有效的。

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.

此外,类不必位于命名空间中,即使在C#中也是如此。

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

这篇关于如何理解类名添加&lt;&gt;符号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆