Creating secure .exe files in C#
I have heard some mutterings a开发者_JS百科bout C# being quite easy to "crack" and/or reverse engineer.
Is this the case and if so, how can I go about preventing this, if possible ? Or at least making it more difficult ?
Thanks, George.
Obfuscate your assembly.
You can refer to this instituitional article to learn more about Obfuscation.
You can obfuscate your source code using for example Dotfuscator software which comes with Visual Studio. If you want to see reverse engineering in action - download Reflector, and open your exe in it. You'll be surprised :)
You could obfuscate the generated assembly.
To some extent it is. The IL can be viewed and reverse-engineered. Some people use obfustators to scramble all of the names in the assembly, thus making it near impossible to derive any app logic.
There are a number of libraries to deal with this, I think Microsoft release (or at least endorse) Dotfuscator
.Net code is pretty easy to view even when compiled, because all the metadata (the information about classes, methods and properties) is all contained in the executable. Basically all you need to get at the code is Reflector.
Obfuscating will basically rearrange and rename everything to make tools like Reflector harder to use. There's a stackoverflow question asking about which particular obfuscater you could use.
精彩评论