34

Mono 是否有等效的 ILDASM?

4

1 回答 1

49

是的,monodis是 Mono 的 ildasm 等价物。

$ 猫 a.cs
    公共课 Foo
    {
        公共静态无效 Main()
        {
            System.Console.WriteLine("Hello world");
        }
    }

$ monodis a.exe
    .assembly extern mscorlib
    {
      .ver 1:0:5000:0
      .publickeytoken = (B7 7A 5C 56 19 34 E0 89) // .z\V.4..
    }
    .汇编'a'
    {
      .hash算法0x00008004
      .ver 0:0:0:0
    }
    .module a.exe // GUID = {034ADE1A-22D2-4B2B-960B-AE9DBFB2FCE7}


      .class public auto ansi beforefieldinit Foo
        扩展 [mscorlib]System.Object
      {

        // 方法第 1 行
        .method public hidebysig specialname rtspecialname
               实例默认 void '.ctor' () cil 托管
        {
            // 方法从 RVA 0x20ec 开始
        // 代码大小 7 (0x7)
        .maxstack 8
        IL_0000:ldarg.0
        IL_0001: 调用实例 void object::'.ctor'()
        IL_0006: 恢复
        } // 方法 Foo::.ctor 结束

        // 方法第 2 行
        .method public static hidebysig
               默认 void Main () cil 托管
        {
            // 方法从 RVA 0x20f4 开始
        。入口点
        // 代码大小 11 (0xb)
        .maxstack 8
        IL_0000: ldstr "你好世界"
        IL_0005:调用 void 类 [mscorlib]System.Console::WriteLine(string)
        IL_000a:ret
        } // 方法 Foo::Main 结束

      } // Foo 类结束

于 2009-10-31T22:20:25.227 回答