Eazfuscator. net, if the type is marked serializable, eazfuscator. net automatically does not modify the type name, because the serialization and deserialization process needs to verify the object type information. One bad aspect is that the marked properties will disappear.
As follows, we define a feature and apply it to classes, attributes, fields, and methods:
Class myattr: attribute
{}
[Myattr]
Class B
{
[Myattr]
Public int AAA;
[Myattr]
Public int BBB {Get; set ;}
[Myattr]
Public void CCC (){}
}
After obfuscation using eazfuscator. net, the decompiled code is as follows:
As you can see, apart from the features of the class, there are two feature tags, one is a field, and the other is a method. The attribute features are missing. Other members are as follows:
The first blue line: The field encapsulated behind the property.
The second Blue Line: get of the property.
The third blue line: Set of the attribute.
The fourth Blue Line: constructor.
The attribute feature is not because eazfuscator. Net splits the attribute into a method. Although the attribute is essentially a method, il supports attribute definition and can add the feature above. For example, the following is the definition of the above Code without obfuscation of the BBB attribute:
. Property instance int32 bbb
{
. Get instance int32 mgen. B: get_bbb ()
. Set instance void mgen. B: set_bbb (int32)
. Custom instance void mgen. myattr:. ctor ()
}
. M is the definition of custom features, and everything is in the. Property Attribute definition.
While eazfuscator. Net directly removes attribute definitions and separates them into methods (this is also for obfuscation purposes). Therefore, attributes cannot be applied.
One solution is to use the system. reflection. obfuscationattribute feature (which was born after. NET 2.0) to command eazfuscator. net not to rename this attribute:
[Myattr]
[System. reflection. obfuscationattribute (feature = "Renaming", exclude = true)]
Public int BBB {Get; set ;}
The Decompilation result is as follows:
The attribute does not disappear, but the attribute itself is not renamed.
Therefore, eazfuscator. Net 3.3's processing status of attributes is like two extremes. Either it does not handle anything, or it throws the feature to completely process the attributes (split into independent methods ). Isn't it possible to provide an intermediate choice?