Today I learned how to use ildasm to crack and use ilasm to recompile.
(1)ProgramWritten in advanced OO language (C #, VB. NET, VC. net, COBOL, python ...)Code, The code goes through
. Net Compiler (such as Visual Studio. NET), compiled into a unified msil (Microsoft intermediate language ). NET applications appear in the form of msil. They are compiled as native code through the real-time compiler JIT (just-in-time) only during program execution.
(2) When the program is executed, the JIT loads the msil of the program, and the JIT performs a lot of other work at the same time (loading the corresponding Runtime Library, Security Detection ..) At last, JIT will convert the local machine code (exe or DLL ).
(3) the local machine code is loaded into the memory and executed.
Through these steps,. Net implementsProgramming LanguageIrrelevant (all converted to msil); platform irrelevant (executed
Generate the corresponding machine code according to the local configuration); Security (JIT has done a lot of detection ).
As a cracker, you can use the tool that comes with the. NET Framework SDK to swap between msil and exe (DLL:
Use ilasm and ildasm in the frameworksdk \ bin \ directory
(1) ilasm example:
The following command assembles the msil file mytestfile. Il and generates the executable file mytestfile.exe.
Ilasm mytestfile
The following command assembles the msil file mytestfile. Il and generates the. dll file mytestfile. dll.
Ilasm mytestfile/DLL
The following command assembles the msil file mytestfile. Il and generates the. dll file mynewtestfile. dll.
Ilasm mytestfile/dll/output: mynewtestfile. dll
(2) ildasm example
The following command displays the metadata and disassembly code of the PE file myhello.exe in the default GUI of ildasm.exe.
Ildasm myhello.exe
The following command decomassembles the myfile.exe file and stores the msil assembler text in the myfile. Il file.
Ildasm myfile.exe/output: myfile. Il
The following command decomassembles the myfile.exe file and displays the msil assembler text in the console window.
Ildasm myfile.exe/Text
If the file myapp.exe contains embedded hosted and unmanaged resources, the following command will generate the following four files: MyApp. Il, MyApp. Res, icons. Resources, and message. Resources:
Ildasm myapp.exe/output: MyApp. Il
The following command decomassembles the mymethod method in the myclass class of myfile.exe and displays the output in the console window.
Ildasm/item: myclass: mymethod myfile.exe/Text
In the above example, there may be several mymethod methods with different signatures. The following command disassemble the mymethod method with the return type void and parameters int32 and system. String.
Ildasm/item: "myclass: mymethod (void (int32, class system. String)" myfile.exe/Text
Address: http://www.cnblogs.com/OwenWu/archive/2010/06/30/1768027.html