Use ildasm to crack and use ilasm to recompile

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.