Decompiling .NET Applications

Posted by Johan Cyprich on 17 Mar 2007 | Tagged as: Programming

Have you ever wondered how a program worked? If your not a programmer then you probably wouldn’t think of such things. A software developer, however, might. They would be interested in knowing how a feature or an entire application functioned in order to duplicate it in their own work.

A program can be examined by decompiling it and then studying it’s source code.

What decompiling does is that it translates a program from it’s native machine language (i.e. CPU instructions) to a format easier to read, such as assembly language.

This seems kind of scary. All of the hard work you put into your award winning application can be copied by someone else. But it’s not as easy as it seems.

For example, have you ever tried reading someone else’s source code? Even with comments and meaningful variables, it’s a challenge. Now try reading code with no comments and cryptic variable names. This is what you typically get after decompiling. Trying to interpret decompiled code is a difficult and time consuming task.

However, a decompiled .NET program is easier to read than a Windows native app. Visual Studio leaves the names of identifiers alone when compiling to an assembly. The result is still difflcult to understand but you can have a good idea what’s going on.

If you want to try decompiling a .NET program, you can download Reflector by Lutz Roeder. Be prepared for the surprise when you see how close the decompiled code is to your source code.

Fortunately, Visual Studio comes with a utility to obfuscate .NET programs, the Dotfuscator Community Edition. It will change the names of identifiers so that they will no longer be meaningful. There are also other commercial applications that will do the same thing.

If you want even more security for your code, a linker can be used. This will turn your .NET app into a native Windows program. The advantage of using a linker is that there won’t be the slow JIT precompile stage due to the app already being compiled.

Even with all of these precautions, your code is still not safe. A determined hacker can still decompile your program and figure out what it does. An obfuscation or linking tool may have them looking elsewhere for easier ways to copy code.



Tweet This Tweet This Post!

Related posts:
    Free Alternatives to Windows Applications
    Visual Studio 2005 Express Now Free
    PHP 5 Going Mainstream
    Is There Gold in Them There Cell Phone Hills?

Share this post:

del.icio.us:Decompiling .NET Applications digg:Decompiling .NET Applications spurl:Decompiling .NET Applications wists:Decompiling .NET Applications simpy:Decompiling .NET Applications newsvine:Decompiling .NET Applications blinklist:Decompiling .NET Applications furl:Decompiling .NET Applications reddit:Decompiling .NET Applications fark:Decompiling .NET Applications blogmarks:Decompiling .NET Applications Y!:Decompiling .NET Applications smarking:Decompiling .NET Applications magnolia:Decompiling .NET Applications segnalo:Decompiling .NET Applications gifttagging:Decompiling .NET Applications

Follow Me:

Did you find this post interesting and useful? You can keep up to date on this blog by subscribing to my RSS feed, or you can have new posts sent to you by e-mail. You can also follow me on Twitter.


Trackback This Post | Subscribe to the comments through RSS Feed

Leave a Reply

CommentLuv badge