Support for System.Reflection.ObfuscationAttribute
yGuy
Posts: 3
Hi,
I cannot find information about whether SmartAssembly supports the standard (mscorlib.dll) .net System.Reflection.ObfuscationAttribute.
If I have a binary third party software that is consistently annotated with these attributes, how can I instruct SmartAssembly to obfuscate all the members in that .dll and honor the ObfuscationAttribute that is present for some classes and members, which may not be obfuscated due to reflection usage.
I have seen that SmartAssembly supports custom attributes, but since this is a binary third party library, adding custom attributes to the existing binary is difficult at least.
Is this really not supported or just not documented well enough? I was not able to find any information about the ObfuscationAttribute in your documentation.
Thank you for your help!
Sebastian
I cannot find information about whether SmartAssembly supports the standard (mscorlib.dll) .net System.Reflection.ObfuscationAttribute.
If I have a binary third party software that is consistently annotated with these attributes, how can I instruct SmartAssembly to obfuscate all the members in that .dll and honor the ObfuscationAttribute that is present for some classes and members, which may not be obfuscated due to reflection usage.
I have seen that SmartAssembly supports custom attributes, but since this is a binary third party library, adding custom attributes to the existing binary is difficult at least.
Is this really not supported or just not documented well enough? I was not able to find any information about the ObfuscationAttribute in your documentation.
Thank you for your help!
Sebastian
Comments
Thanks for your post and so sorry for the delay!
I'm sorry to say that the standard ObfuscationAttribute is not supported at the moment.
It is something we think will be technically feasible and we're considering it for the future, but it unfortunately may be a while since it could lead to a potentially confusing change of behaviour for users that we’d need to carefully think out first.
(A bit more on this: SmartAssembly currently works on the basis of opt-out--it will try to obfuscate everything unless it is explicitly excluded or marked with a DoNotObfuscate attribute. The standard ObfuscationAttribute is, by definition, opt-in -ie, nothing is obfuscated unless marked with the attribute. If for example, if you have an existing project with our DoNotObfuscate attributes and you merge a new third-party DLL containing Obfuscation attributes--should SmartAssembly continue working as opt-in or as opt-out? We'd still have to work out what SmartAssembly would do in cases like these.)
Sincere apologies for the inconvenience this causes! I've +1'd our feature request to support the attribute though and if there is any update, I will let you know!
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
As far as I understand translating the standard attribute to your proprietary attribute should be trivial and you would do your customers the favor and enable them to use your tool with third party libraries. You could even write an attribute processing tool that ildasms the dll, translates the attributes and does the bundling again.
For example, I'd expect the following usages to implicitly map to SA attributes:
For example, I'd expect the following usages to implicitly map to SA attributes: