Today we introduce an open source. NET Obfuscation--confuserex
http://yck1509.github.io/ConfuserEx/
Due to the use of. NET obfuscation in the project, there are many online searches, such as Dotfuscator, Xeoncode, Foxit and so on.
But most of the charges, of course, there are cracked version of the company requirements can not use pirated software.
Find a half-day finally found Confuserex, use up also line, hurriedly take out to everyone to share under.
: https://github.com/yck1509/ConfuserEx/releases
As the online introduction of Chinese relatively few, I do a test here, to show you:
1, a new C # class library, I will not change the name, it is called ClassLibrary1 Bar, under the Class1.cs class to add a simple method:
Public class Class1 { publicstring Test () { return"2 " ; } }
2. Then create a console application Consoletest, add reference to the test method in the Classlibrary1.dll,main method called Classlibrary1.class1:
Static void Main (string[] args) { new classlibrary1.class1 (); Console.WriteLine (C.test ()); Console.ReadLine (); }
After compiling, open ConsoleTest.exe with Ilspy, no doubt, you can see the source code, such as:
3, now let's try to confuse Confuserex with:
Download Confuserex after unpacking, open ConfuserEx.exe, such as:
4, see the hint "Drag input modules here"?
Then put the ConsoleTest.exe in it, such as:
5. Click Settings
(1) Select Packer
(2) Modules->consoletest.exe
(3) Rules Click + Sign, True
Such as:
6. Click protest!->protect! , prompting for successful export (under the confused directory),
7, open with Ilspy ... \confused under the ConsoleTest.exe, look at the source:
The method is empty, copy the ConsoleTest.exe dependent ClassLibrary1.dll to the confused directory, click Run ConsoleTest.exe, and output the correct result.
Attention
8, if only to confuse the EXE file, so that you can, if just confuse a DLL file, you will see the following error:
Error: No executable module, no actuator?
Is there no exe file? We put ConsoleTest.exe in and ClassLibrary1.dll together to see.
9, according to the previous way, I put ConsoleTest.exe, ClassLibrary1.dll are dragged into the Confuserex together confused,
Such as:
Prompt succeeds.
10, but we open again ... \confused, found only the confused ConsoleTest.exe file, where did ClassLibrary1.dll run?
Isn't it possible to confuse DLL files?
Don't worry, we click ConsoleTest.exe try, oops, I went, unexpectedly run successfully, such as:
The only explanation here is that Confuserex embedded the DLL inside the EXE.
Now the confused ConsoleTest.exe is 17KB, and the original ConsoleTest.exe is 5kb,classlibrary1.dll is also 5KB.
11, we then use Ilspy to see at the same time confusion ConsoleTest.exe and ClassLibrary1.dll generated after the ConsoleTest.exe,
The method body is not visible and the referenced DLL file is not visible.
All right, here we go today.
. NET Obfuscation Confuserex