When you published your compiled application and thought that your ideas on how your build it can’t be stolen, then you made a big mistake. There are a lot of decompiler software out there like ILSpy, which use to convert machine code to how originally or close to it looks like before .
Now, how to protect your code or intellectual property? Well that’s why I want to tackle “Obfuscation Software Development in .NET”. So, Obfuscation is way of making the original message or computer functions to a very difficult to understand. In the following you can see a example how executable file can be decompiled using ILspy.
This is a sample of how your code looks if its in executable format meaning it is a ready to be executed from the CPU. This is where all the encoded operation and reference to all DLL files that use in the applications. Don’t worry this not intended to be read, I just wanna show how it unpleasant in the eye.

This is the “Hello World” console application program that will be become a executable file.


Now let’s try to decompile it using ILSpy

As you can see above, the decoded is almost no difference with the original one.
So, how to Obfuscate our code?
Here are the list of Obfuscation software in this link. In my case since I am usng VS2019, I will Obfuscate my project using ConfuserEx. You can also install ConfuserEx from visual studio market place.
After you installing ConfuserEx in your visual studio, go to Tools-> and enable it by selecting “Protect With ConfuserEx”. This will Obfuscate your code when building it in release mode.

Now let’s see how the Obfuscated code look like.

Now that our code has been Obfuscated. The ILSpy decompiler sees different output, which is too hard for human eye to understand. This is now more difficult and impossible to point out what is the program actually doing.
That’s it!
Follow us for daily hack news 🙂