IL文件修改入门篇

来源:互联网 发布:电脑 地图软件 编辑:程序博客网 时间:2024/05/16 13:52

注:原文地址:http://www.cnblogs.com/midea0978/articles/81071.html

==================================
Object:
   掌握简单的IL文件处理知识
   能够熟练运用ildasm,ilasm工具
==================================
1.编写简单的hello.cs

2.编译源代码

3.反编译hello.exe,命令如下:
ildasm hello.exe /out=hello.il

4.打开hello.il文件,找到下面语句
IL_0000:  ldstr      "Hello World!"
修改为
IL_0000:  ldstr      "Hello World! A Cracked Version."
保存文件。

5.编译il文件
ilasm /res:hello.res hello.il /out:hellocracked.exe
--------------------------------------------------------

Microsoft (R) .NET Framework IL Assembler.  Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
Assembling 'hello.il' , no listing file, to EXE --> 'hellocracked.exe'
Source file is ANSI

Assembled method HelloWorld::Main
Assembled method HelloWorld::.ctor
Creating PE file

Emitting members:
Global
Class 1 Methods: 2;
Writing PE file
Operation completed successfully

-----------------------------------------------------------
成功编译。

5.运行hellocracked.exe,结果如下:
Hello World! A Cracked Version.

好的,你已经掌握了基本的IL文件修改知识了。

相关源代码:

http://files.cnblogs.com/midea0978/dotnet-IL-guide.rar

原创粉丝点击