微軟反組譯碼利器ILdasm

來源:互聯網
上載者:User

微軟中繼語言 (MSIL) 是一種語言,是許多編譯器(C#、VB.NET等)的輸出。ILDasm (中繼語言反組譯碼器)程式和.Net Framework SDK(FrameworkSDK/Bin/ildasm.exe或Program Files/Microsoft SDKs/Windows/v6.0A/bin)打包在一起,讓使用者以人可閱讀的格式查看MSIL代碼。通過該工具,我們可以開啟任何.net可執行檔(exe或dll)並查看其MSIL代碼,例如windows控制台應用程式(exe)、windows library動態連結程式庫檔案(dll)、windows form(exe)檔案等。

樣本如下:

建立windows 表單應用程式WindowsFormsApplication1,代碼:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}

編譯後產生WindowsFormsApplication1.exe檔案

找到isdasm.exe,在它裡面開啟WindowsFormsApplication1.exe。

 

可以看到,裡麵包括了windows表單應用程式的form、屬性properties和program。展開

 

可以清楚的看到表單應用程式的結構幾個部分功能。包括屬性資源及設定、各部分的構造器實現及主程式入口清晰可見。

.ctor是構造方法,.cctor是類型初始化器,在C#中也就是靜態建構函式,相關內容可查看我部落格轉載的文章《.ctor,.cctor 以及 對象的構造過程》。

其他檔案開啟類似。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.