Attributes in eazfuscator. Net 3.3

Source: Internet
Author: User

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




Class B



Public int AAA;


Public int BBB {Get; set ;}


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:


[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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.