
352
|
Chapter 10, Work with Visual Studio Tools
#80 Obfuscate Your Code
HACK
Investigate the Results with Reflector
Reflector is a tool that can be used to “look inside” .NET assemblies and see
its codepaths and logic
[Hack #64]. It does not produce an exact copy of the
actual code for an assembly, but that’s not the point. It’s used to provide
insight to the logic used for the internals of an assembly. Therefore, continu-
ing to use the SimpleMath class, we’ll investigate the differences Reflector
shows between unobfuscated and obfuscated assemblies.
Launch two instances of Reflector: one to open the unobfuscated assembly
and the other to open the obfuscated assembly. The figures show the disas-
sembler view of the SimpleMath class. Figure 10-30 is the unobfuscated
assembly; Figure 10-31 is the obfuscated one.
Similarly to what was shown in ILDASM, Reflector does not show the actual
class and method names in the obfuscated code (because the IL for the
obfuscated assembly does not have them).
Reflector’s real power is viewing the disassembled code for each method, so
using the Add method again, let’s take a look. This is the disassembled code
for the Add method. Figure 10-32 is the unobfuscated version; Figure 10-33
is the obfuscated one.
As you can see with this extremely simple example, the disassembled views
are very similar. However, to know that the “d” method was for adding two
numbers, I had to