Obfuscating your .NET project DLL / EXE
This entry was posted on 11/17/2006 6:13 PM and is filed under Technical.
Quite often, we techie people worry about the stealing and usage of complex DLLs we create. A .NET can easily be de-compiled and regenerated into the project code files. At some point, this may look irreversible. VS.NET comes pre-packed with an obfuscation tool replaces the meaning strings with some non-meaning strings.. that makes it difficult for any person to understand your code.
Here, I show some steps in brief to use Dotfuscator to obfuscate your DLL / EXE.
1. open dotfuscator from VS.NET -> Tools -> Dotfuscator Community Edition
2. When it start, click on "New Project"
3. In the windpow that appears, click new. there give the your project name that you want to obfuscate, and the path where you want to create the project. this should ideally be the project folder itself
4. The click on "Trigger" tab
5. click "Browse". And select your .NET project's DLL or EXE that you want to obfuscate
6. Then click on "Build" tab
7. Under "Destination Directory" provide the path to folder where build output will be stored. This shall ideally be the path to new folder inside your projects DLL / EXE folder.
8. Go to "Rename" tab, and provide "Map Output File" path. This is required. The map file is
an essential piece of information that contains the unambiguous name mappings between the original and unobfuscated names. It is very important to keep this file after you obfuscate your application; without it, you will not be able to easily troubleshoot the obfuscated app. Due to its importance, Dotfuscator will not overwrite an existing map file by default unless you explicitly check the "Overwrite Map file" box. "Check the box".
9. Now click on "Save" icon from shortcut tab, and save the project configuration in the XML folder. It is recommended to save the file in bin folder of your .NET project; because then we can automate obfuscation upon build/rebuild of our project
10. Finally create your obfuscated DLL ... by either:
a. clicking on "Play" button on shortcut nav; OR
b. going to "Build" tab and click on "Build" Button.
The bottom region shows the build process and output - success or failure.
The output tab shows the new string mapping done by obfuscation.
Resources:
1. Help file in dotfuscator
2. http://msdn.microsoft.com/msdnmag/issues/03/11/NETCodeObfuscation/default.aspx