Tuesday, May 16, 2017

Protect .Net Source Code (Anti-Reflector) with ConfuserEx

When you build a program on .Net, it can be decompiled easily with some tools if you don't apply any solution to protect.

You can use some commercial tools for protecting your program from reflector, your spent money is worth if the program is your business.

In this post, I'll introduce an open source tool which can help you do that. It's free but it's power as commercial tool. It's ConfuserEx, you can find it on GitHub: https://github.com/yck1509/ConfuserEx

Below is a sample case which can help you start to use this tool right way.

1. In this sample, I will use the source code from my GitHub: https://github.com/vnheros/export-data-set then build it to create my application called: ExportDataGrid.exe

2. After that I use ILSpy from https://github.com/icsharpcode/ILSpy to decompile it, here is result:

Ops... my god... the source code is there. Now let see what ConfuserEx can do.

3. Open ConfuserEx.exe, its interface is like the following:

Click (+) button or drag ExportDataGrid.exe into, then we will see:

Click tab Setting and add some rules, see the following picture for how to:

After setting rules, move to Protect! tab then click Protect button:

4. Almost done now, let check with ILSpy again to see what ConfuserEx did:

What a magic! Oh lah lah...

5. But wait..., let check if the application ExportDataGrid.exe still works properly:

Yeah! We did! ConfuserEx is hero.
That's it. Happy coding! Any comment is welcome!

Subscribe to RSS Feed Follow me on Twitter!