开发者

Code protection and code weaving in .net

开发者 https://www.devze.com 2022-12-19 11:54 出处:网络
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.La

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.Pub开发者_开发技巧lic

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?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消