5

我正在编译的网站上尝试使用 SmartAssembly 混淆工具。它适用于大多数代码,但 App_Code 中的任何类都不会被混淆。例如,我在 App_Code 中有以下课程

public class Helper
{
    public Helper()
    {
    }

    public static String GetData()
    {
        String text = DateTime.Now.ToString();
        return text;
    }

    ---Other methods----
}

跳过此 Helper 类。它不会对 Helper 类及其方法进行名称修改。使用 SmartAssembly 的任何人都可以在这方面提供帮助吗?是否有其他一些比 SmartAssembly 更好的成本效益工具(免费或付费)。

4

2 回答 2

10
  • Disclaimer: I work for RedGate on SmartAssembly *

SA (SmartAssembly) automatically excludes public members in DLLs from obfuscation and pruning, because it assumes they will be used externally. You can override this behaviour by editing the saproj file to make the obfuscation line look like:

<Obfuscation ExcludePublicMembers="0" Obfuscate="1">

This will obfuscate all members, regardless of their public status.

This may cause problems because IIS may use reflection to look for specific public members with specific names. In this case, you will need to exclude those items from pruning/obfuscation.

As for obfuscation tools, SmartAssembly is quite a powerful obfuscator (hackers agree!), and has a lot of extras in it (error-reporting, feature-usage reporting etc). But, of course, there are a number out there beyond SmartAssembly, e.g. Dotfuscator or Deep Sea Obfuscator. Some are rather good, some are very bad.

If you've got any more problems, come ask us at: http://www.red-gate.com/products/dotnet-development/smartassembly/support

于 2011-07-29T16:28:38.950 回答
2

public默认情况下,方法不会被混淆(在 DLL 中 - 它们在 exes 中)。您可以强制混淆,但您需要使用代码装饰。更多细节可以在这里找到

于 2011-07-29T16:20:29.763 回答