views:

135

answers:

2

Hi! I tried to use code protection (code is encrypted and can't be reflected) made by clisecure with postsharp but secured dlls won't compile when post sharp is used in solution. I use just PostSharp.Laos and PostSharp.Public

Have You ever tried such combination? Did you manage to make it work. If so please tell what obfuscation tool and what code weaving framework have you been using?

+1  A: 

I have successfully used Dotfuscator and Postsharp in combination but only with the compile time IL Weaving and not yet with any runtime interception. Everything should be fairly straightforward as long as you obfuscate the binary that PostSharp post-compilation weaving outputs.

The usual obfuscation caveats apply to any of your cross cutting code (especially where you use reflection) as obfuscation changes symbol names and you will need to exclude any symbols from being renamed or pruned that will be reflected upon or that use late binding.

Joe Kuemerle
A: 

There are some tricks when using an obfuscator. For instance, you cannot change the name of aspect types and fields of aspect types because aspect are serialized by PostSharp and deserialized at runtime. You may want to use obfuscation exceptions for aspects.

Another issue is that you cannot rename some methods that are the target of aspects. I think this happens only with generic methods or methods of generic types.

An alternative is to use an obfuscator that does not rename the code, such as WIBU. I did not try, however.

Gael Fraiteur
Thanks for reply. I should have written that cli secure "code protection" does not change names of types so that is not an issue here. It just removes methods' bodies and encrypts them.
PK