-
-
[求助]关于net方法修改后编译报错的问题
-
发表于:
2012-8-24 17:59
4667
-
有一net程序,里面有个方法,原先il代码:
.method assembly static string GetComputerInformation() cil managed
{
// Code size 44 (0x2c)
.maxstack 2
.locals init (string V_0)
IL_0000: call string [mscorlib]System.Environment::get_UserName()
IL_0005: stloc.0
IL_0006: ldloc.0
IL_0007: call string RIHWSty.RISuperpro::ProcessorID()
IL_000c: call string [mscorlib]System.String::Concat(string,
string)
IL_0011: stloc.0
IL_0012: ldloc.0
IL_0013: call string [mscorlib]System.Environment::get_MachineName()
IL_0018: call string [mscorlib]System.String::Concat(string,
string)
IL_001d: stloc.0
IL_001e: ldloc.0
IL_001f: call string RIHWSty.RISuperpro::DriveModel()
IL_0024: call string [mscorlib]System.String::Concat(string,
string)
IL_0029: stloc.0
IL_002a: ldloc.0
IL_002b: ret
} // end of method RISuperpro::GetComputerInformation
我修改成:
.method assembly static string GetComputerInformation() cil managed
{
// Code size 44 (0x2c)
.maxstack 2
.locals init (string V_0)
IL_0000: nop
IL_0001: nop
IL_0002: nop
IL_0003: nop
IL_0004: nop
IL_0005: nop
IL_0006: nop
IL_0007: nop
IL_0008: nop
IL_0009: nop
IL_000a: nop
IL_000b: nop
IL_000c: nop
IL_000d: nop
IL_000e: nop
IL_000f: nop
IL_0010: nop
IL_0011: nop
IL_0012: nop
IL_0013: nop
IL_0014: nop
IL_0015: nop
IL_0016: nop
IL_0017: nop
IL_0018: nop
IL_0019: nop
IL_001a: nop
IL_001b: nop
IL_001c: nop
IL_001d: nop
IL_001e: nop
IL_001f: nop
IL_0020: nop
IL_0021: nop
IL_0022: nop
IL_0023: nop
IL_0024: nop
IL_0025: nop
IL_0026: ldstr "abcdefgh"
IL_002b: ret
} // end of method RISuperpro::GetComputerInformation
为什么用ilasm编译无法通过呢,老是报错。
出错信息:“no entry point declared for exectuable"
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课