C# ANTI-REFLECTOR SOURCE

来源:互联网 发布:直播软件哪个最火 编辑:程序博客网 时间:2024/05/16 14:56

How can I make my application, so no reflector software can get it's source code?

 

There is no way to prevent reflector from extracting "source code" from an assembly.  What reflector is doing is just reverse-engineering the code from the IL code and metadata in the assembly.  It is actually possible to reverse-engineer any sort of application, such as one compiled in native C++.  However, because of some of the properties of IL and all the metadata that .NET stores in assemblies (which is needed by the CLR for linking and other things), reflector and programs like it are able to derive source code that is much more readable than what it typically possible with native applications.

For example, .NET metadata includes names of class fields, and so the reflector is not only able to reconstruct the structure of the class, but also the descriptive names.

You can't stop people from using reflector, but what you can do is use an obfuscator that jumbles all the names in the assemby and performs transformations on the code that do not modify its behavior but makes it much harder to understand.  If someone tries to use reflector on an obfuscated assembly, they will have a very hard time understanding the resulting source code, and it will most likely be useless to them because it would be easier for them to write their own code from scratch rather than try to steal yours.