簡體   English   中英

C#命令行反編譯器

[英]C# commandline decompiler

我希望將大量程序集反編譯為 C#。 我找到了幾個可以進行可視化反編譯的工具。 但是我想知道是否有一個工具可以從命令行進行反編譯(類似於ildasm /OUT )。

動機是有 100 多個程序集,我不想打開每個程序集並另存為.cs文件。 .NET Reflector似乎有批量加載程序集,但沒有批量保存。 所以我想寫一個腳本,通過每個程序集並使用命令行命令反編譯它。

如果您正在尋找為程序集生成 C# 代碼的程序, Jon Gallant最近發表了一篇關於使用 Telerik 的 JustDecompile 執行此操作的博客文章。 您可以鏈接到幾個程序集,然后您可以在沒有 UI 的情況下控制代碼的生成。

您唯一需要的是這個名為 dnSpy 的開源反編譯器 -> https://github.com/0xd4d/dnSpy

包括一個命令行工具:

Examples:
  dnSpy.Console.exe -o C:\out\path C:\some\path
      Decompiles all .NET files in the above directory and saves files to C:\out\path
  dnSpy.Console.exe -o C:\out\path -r C:\some\path
      Decompiles all .NET files in the above directory and all sub directories
  dnSpy.Console.exe -o C:\out\path C:\some\path\*.dll
      Decompiles all *.dll .NET files in the above directory and saves files to C:\out\path
  dnSpy.Console.exe --md 0x06000123 file.dll
      Decompiles the member with token 0x06000123
  dnSpy.Console.exe -t system.int32 --gac-file "mscorlib, Version=4.0.0.0"
      Decompiles System.Int32 from mscorlib

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM