348
|
Chapter 10, Work with Visual Studio Tools
#80 Obfuscate Your Code
HACK
inside” compiled assemblies. If this is alarming, it should be. After all, you
may have class libraries with highly confidential business logic—if that logic
were to fall into the wrong hands, you could lose your competitive advan-
tage. Luckily, Visual Studio contains a tool named Dotfuscator that you can
use to make sure that the output of a decompiler is as close to gibberish as
possible.
Create a Dotfuscator Project
To use the Dotfuscator, you’ll first need to create a project in Visual Studio
and compile it (in this case, I’ve created a project with a class named Simple-
Math). Then create a Dotfuscator Project for your assembly by following
these steps:
1. On the Visual Studio menu, click Tools
Dotfuscator Community Edi-
tion. This will start the Dotfuscator.
2. At the Select Project Type dialog box, choose Create New Project and
click OK. You’ll now see a tool with several tabs along the top
(Figure 10-25).
Although several tabs and numerous options can be configured in the
Dotfuscator, you need to configure two items at a minimum to create an
obfuscated assembly. They are the trigger file(s) and the build destina-
tion directory. Once these two options are set, you can save the Dotfus-
cator Project for use later. Dotfuscator Projects are saved in XML
format.
Figure 10-24. Performance counters statistics

Get Visual Studio Hacks now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.