摘要:
c# code:using System;public class aidd2008{ public static void Main(String[] argv) { int x = 10; int y = 6; if (x > y) { Console.WriteLine(x); } else { Console.WriteLine(y); } Console.Read(); } } MSIL code... 阅读全文
摘要:
IL文件修改入门篇==================================Object: 掌握简单的IL文件处理知识 能够熟练运用ildasm,ilasm工具==================================1.编写简单的hello.cs2.编译源代码csc hello.cs3.反编译hello.exe,命令如下:ildasm hello.exe /out=hello.il4.打开hello.il文件,找到下面语句IL_0000: ldstr "Hello World!"修改为IL_0000: ldstr "Hello World! 阅读全文
摘要:
今天看到一个朋友在override,new上的问题搞错,呵呵我想很多刚入门的朋友也一样吧我呢就查查资料顺便巩固一下自己的理解,现在整理出学习笔记.先看段代码:1usingSystem;2usingSystem.Collections.Generic;3usingSystem.Text;45namespaceConsoleApplication16{7classProgram8{910staticvoidMain(string[]args)11{12baseClassbc;13class1ct1=newclass1();1415class2ct2=newclass2();1617ct1.prin 阅读全文
摘要:
AppDomain是CLR的运行单元,它可以加载Assembly、创建对象以及执行程序。AppDomain是CLR实现代码隔离的基本机制。每一个AppDomain可以单独运行、停止;每个AppDomain有自己默认的异常处理;一个AppDomain的运行失败不会影响到其他的AppDomain。CLR在被CLR Host(windows shell or InternetExplorer or SQL Server)加载后,要创建一个默认的AppDomain,程序的入口点(Main方法)就是在这个默认的AppDomain中执行。1.AppDomain vs 进程AppDomain被创建在进程中, 阅读全文
摘要:
.Net框架SDK中提供的IL(Intermediate Language:中间语言)反汇编工具(ILDasm.exe)来查看得到的托管PE文件中的元数据和IL代码。.Net控件的核心就是公共语言运行时 (Common Language Runtime,简称CLR)。CLR在运行时对编程语言是一无所知的,因为我们在开发时所用的编程语言无论使用何种语言都要最终生成一个托管模块 (managed module)。托管模块是一个需要CLR才能执行的标准Windows可移植可执行(portable executable,简称PE)文件。通过查看程序的IL代码和元数据可以了解我们自己编写的代码究竟 都干 阅读全文
摘要:
这段时间为跟踪一个Bug而焦头烂额,最后发现是.NET Framework的问题,这让人多少有些绝望。所以到微软论坛提了个帖子,希望能得到些帮助。虽然论坛智能到能够判断楼主是否是MSDN订阅用户,以便尽快解决(传说MSDN订阅用户的问题能在两天内得到回复的,当时还很得意公司为我们购买的MSDN订阅账号),但得到的回复是“Could you file a bug report for this issue through Connect?”,绝望之后的又一次寒心啊。看过payeasy的广告之后,便有了以下的这些内容,如何修改.NET Framework:这里我们以修改Guid类为例,我们将修改这 阅读全文