Home > Article > Backend Development > Crack .net program (dll file) compilation and decompilation method_PHP tutorial
I will just give you a simple example to give you an idea, haha~~~~
1Use Tools
Reflector.exe is used to view .net code. Needless to say, it is an essential tool for learning .net
Ildasm.exe: used to compile dll, exe into IL files
ilasm.exe: used to compile IL files back to dll or exe
If you don’t have the EmEditor text processing tool, you can download it and there is a registration code EmEditor.rar
2 Basic knowledge of Ildasm and ilasm:
Usage of ilasm.exe and ildasm.exe
First open the cmd command. cd to C:Program FilesMicrosoft Visual Studio 8SDKv2.0Bin
Then pull in the dll file or exe file you want to view (because we need to use commands, you can open ildasm.exe directly or find each directory to open)
For example, text.dll (which contains console.writeline("hello word"))
ildasm text.dll Open the dll and find the method to view
ildasm text.dll /output:text.il Press Enter to compile an il file (you can open it with Notepad and edit hello word to save it)
Then use the ilasm tool to disassemble it into a dll or exe file
ilasm text Press Enter to automatically find the text4.il file and compile it into text4.exe
Or ildasm text /dll can be compiled into text.dll file (remember to delete the original text4.dll first)
3 Let’s get to work
Currently I have a program with a dongle that cannot be accessed
Start cracking
Open our program with reflector and start analyzing where there is verification
You need to have enough patience for this step
I found a way to exit the program without the dongle
Now use Ildasm.exe to open our program and dump the program into an IL file
Convert to utf-8 format
4 files will be generated
The most important thing is the il file
Open with EmEditor
Find the method SetDoLock() we want to modify
In this example I deleted them and changed them directly to
.method public hidebysig instance void void SetDoLock() cil managed { // 代码大小 103 (0x67) .maxstack 5 IL_0000: ret } // end of method Login::SetTextBox
Save
Now we use ilasm.exe to compile the IL file back to dll or exe
The above method has already been used, so I won’t say more
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>ilasm.exe C:\IL\aa.il
Okay, let’s take a look at the generated exe
Put the generated exe back into the original program and run it
Okay, the crack is successful! !
Author: bluejance Source: http://www.cnblogs.com/li-peng/