用Reflector反编译的问题 (.NET)

新建了一个winform工程,名为TestIL,包含一个窗体Form1,编译生成exe文件,使用 Reflector反编译Form1的Main函数,代码如下:
.method private hidebysig static void Main() cil managed { .custom instance void [mscorlib]System.STAThreadAttribute::.ctor() // Code Size: 11 byte(s) .maxstack 1 L_0000: newobj instance void TestIL.Form1::.ctor() L_0005: call void [System.Windows.Forms]System.Windows.Forms.
Application
::Run([System.Windows.Forms]System.Windows.Forms.Form) L_000a: ret }
又使用ILDASM反编译相同的函数,代码如下:






.method private hidebysig static void? Main() cil managed
{
? .entrypoint //注意这个
? .custom instance void [mscorlib]System.STAThreadAttribute::.ctor() =
( 01 00 00 00 )
? // 代码大小?????? 11 (0xb)
? .maxstack? 1
? IL_0000:? newobj???? instance void TestIL.Form1::.ctor()
? IL_0005:? call?????? void [System.Windows.Forms]System.Windows.Forms.
Application::Run(class [System.Windows.Forms]System.Windows.Forms.Form)
? IL_000a:? ret
} // end of method Form1::Main






















Reflector反编译的代码没有.entrypoint,由于才开始接触这方面的知识,
在《Inside MICROSOFT .NET IL Assembler》(电子版)
中找到对.entrypoint的说明:


.entrypoint
identifies the current method as the entry point of the
application (the assembly). Each managed EXE file must have a single
entry point.The ILAsm compiler will refuse to compile a module without
a specified entry point, unless you use the /DLL command-line option.


看来还是.net自带的工具保险些
不知是否有其他原因,还请大家指教
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值