2009-11-27

Linux上的C#开发

 
 

Sent to you by l5g via Google Reader:

 
 

via Zhiwei.Li by zhiwei on 11/8/09

1. 安装monodevelop (monodevelop-debugger-mdb)<br />  将会安装gmcs编译器(支持CLI 2.0)

/usr/bin/ilasm (mono-devel)/usr/bin/ilasm2 (mono-2.0-devel)
/usr/bin/gmcs(mono-gmcs) Mono C# 2.0 and C# 3.0 compiler for CLI 2.0

2. 安装mono-utils
     将安装反编译器 monodis

3.  反编译后,精简出来的il文件

.assembly extern mscorlib
{
  .ver 0:0:0:0
}
.assembly 'hello'
{
  .hash algorithm 0×00008004
  .ver  0:0:0:0
}

.class HelloWorld extends [mscorlib]System.Object
{
    .method public instance void .ctor() cil managed
    {
        .maxstack 8
   
        ldarg.0
        call instance void [mscorlib]System.Object::.ctor()
   
        ret
    }

    .method public static void Main() cil managed
    {
        .entrypoint
        .maxstack 8
   
        ldstr "Hello,World."
        call void [mscorlib]System.Console::WriteLine(string)
        ret
    }
}

4. ilasm me.il 就能编译成exe文件

monodis –output=hello.il hello.exe
ilasm hello.il

http://wiki.debian.org.tw/index.php/Mono#monodis
http://www.mono-project.com/Dis/Assembling_CIL_Code

http://www.cnblogs.com/dotLive/archive/2006/11/29/576793.html


 
 

Things you can do from here:

 
 

No comments:

Post a Comment