其中C#方法名不应该混淆? [英] Which C# method names should not be obfuscated?

查看:317
本文介绍了其中C#方法名不应该混淆?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个C#程序混淆,如果有是硬到框架,因此不应被修改方法名我不知道。映入脑海的往往.ctor,.cctor和处置。是否有任何其他人,我应该避免修改

I'm working on a C# obfuscation program, and I'm wondering if there are method names that are "hardwired" into the framework and should therefore not be modified. The ones that spring to mind are .ctor, .cctor and Dispose. Are there any others I should avoid modifying?

编辑:
要详细说明,以及保罗·亚历山大(感谢您的答案)的启发,我这样做通过修改的IL的源代码。下面是一些典型的陈述。方法(?):

To elaborate, and inspired by Paul Alexander (thanks for your answer), I'm doing this by modifying the IL source code. Here are some typical(?) .method statements:

  .method family hidebysig virtual instance void 
          Dispose(bool disposing) cil managed

  .method private hidebysig instance void 
          InitializeComponent() cil managed

  .method public hidebysig specialname rtspecialname 
          instance void  .ctor(class [mscorlib]System.Collections.Generic.List`1<string> twoLetterWords) cil managed

  .method private hidebysig static string[] 
          CreateStringArray() cil managed

我可以看到,构造函数(.ctor)有一个rtspecialname选项,并处置有一个家庭选项。这是那种我应该找出来的事吗?

I can see that the constructor (.ctor) has a "rtspecialname" option, and Dispose has a "family" option. Is this the sort of thing I should be looking out for?

推荐答案

对于一个给定方法的元数据包含了一个特殊的名字国旗是不能被重新命名方法,你可以作为一个基本的启发式使用。然而,要准确判断,你必须遍历整个继承树的方法的资格,占基类,接口,方法/按属性字符串等关联的属性。

The meta data for a given method contains a "special name" flag on methods that cannot be renamed which you can use as a basic heuristic. However to accurately determine the eligibility of a method you have to walk the entire inheritance tree, accounting base classes, interfaces, methods/properties referenced by attribute strings, etc.

这篇关于其中C#方法名不应该混淆?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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