Home - Forums-.NET - Spices.Net - Supporting System.Reflection.ObfuscationAttribute?

Spices.Net

NET code security, tools to protect, obfuscate, tamper defense, code and data safety, recover, convert, optimize, explore, browse and analyze .Net software.

This forum related to following products: Spices.Net Suite, Spices.Net Obfuscator, Spices.Net Decompiler

Supporting System.Reflection.ObfuscationAttribute?
Link Posted: 12-May-2015 08:07
Hi,

I am aware of the (non-standard) attributes (like DoNotObfuscateAttribute, etc.) supported by the Obfuscator, but I am wondering if you are going to support those attributes that shipped with the .NET 4.5 Framework (such as the one in the title)?

Kind Regards,
John
Link Posted: 12-May-2015 13:34
Hi John,
Thanks for your question. Yes, new attributes will be supported in the nearest releases of Spices.Net.
Link Posted: 17-Jun-2015 12:12
Thanks for the feedback, now (in the v5.10.0.0) Spices.Net completely supports System.Reflection.ObfuscationAttribute.
Link Posted: 18-Jun-2015 00:17
Awesome, thanks!
Link Posted: 28-Jul-2015 10:17
Tried it, and it works.  Cannot seem to find any documentation on it - do you support all the properties on the System.Reflection.ObfucationAttribute (ApplyToMembers, Exclude, StripAfterObfuscation)?  Any special values supported on the string property "Feature"?
Link Posted: 28-Jul-2015 11:00
You can see MS documentation.
ApplyToMembers, Exclude, StripAfterObfuscation properties - completely supported by Spices.Net Obfuscator,
Feature - currently not supported, just because we don't apply additional "processing options". Probably this property will be supported in the future.
Link Posted: 04-Aug-2015 07:35
Thanks for the response.  The reason I am asking is that I cannot find anyway to state that a method's signature should not be changed, but it's body can be obfuscated to your heart's delight:) - would have been a nice parameter?
Link Posted: 04-Aug-2015 11:48
What do you mean under "signature"?
1. If .Net Metadata binary representation (in metadata Methods table) - in that case signature of method will be untouched, even if method obfuscated.
2. If you mean full name of method (for example int MyMethod(int firstParameter, out bool secondParameter)), if you apply [Obfuscate(Exclude=true, ApplyToMembers = true)] to its declaring class, in that case this method will excluded from obfuscation and its full name will be untouched (excluding the case when method implementing/overriding method-ancestor from obfuscated class-ancestor/interface, if method-ancestor is obfuscated)
Link Posted: 04-Aug-2015 23:59
Hi, the ObfuscationAttribute works perfectly.

I was suggesting the use of the Feature property to notify the obfuscator that even though the method signature (e.g. int MyMethod()) should not be changed (as is the correct default behavior when using the attribute), have a way of stating that the body of the method (between { ... }) can be obfuscated / stubbed out / whatever.

Whether not this suggestion makes it into the product, I am wondering if it is possible via .ilproject properties / command line parameters to indicate that some methods' signature should stay in tact, while the method body is allowed to be obfuscated.
Link Posted: 07-Aug-2015 02:23
Hi John,
Thanks for your suggestion. In the next version we'll implement all obfuscation control provided by NineRays.Obfuscation attributes on a Feature property of System.Reflection.ObfuscationAttribute, like DontStub, DontAnonymize, etc and vice versa.