29.2. Decompilers

One of the most widely used decompilers is Reflector for .NET by Lutz Roeder (available for download at www.aisto.com/roeder/dotnet/). Reflector can be used to decompile any .NET assembly into C#, Visual Basic, Managed C++, and even Delphi. In Figure 29-3, the same assembly you just accessed is opened using IL Dasm, in Reflector.

Figure 29.3. Figure 29-3

In the pane on the left of Figure 29-3, you can see the namespaces, type, and method information in a layout similar to IL Dasm. Double-clicking a method should open the Disassembler pane on the right, which will display the contents of that method in the language specified in the Toolbar. In this case, you can see the Visual Basic code that generates the magic number, which is almost identical to the original code.

You may have noticed in Figure 29-3 that some of the .NET Framework base class library assemblies are listed, including System, System.Data, and System.Web. Because obfuscation has not been applied to these assemblies, they can be decompiled just as easily using Reflector. However, in early 2008, Microsoft made large portions of the actual .NET Framework source code publically available, which means you can browse the original source code of these assemblies including the inline comments. This is shown in Chapter 43.

If the generation of the magic number were a real secret on which your organization ...

Get Professional Visual Studio® 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.