【问题标题】:C# commandline decompilerC# 命令行反编译器
【发布时间】:2011-11-11 21:05:03
【问题描述】:

我希望将大量程序集反编译成 C#。我发现了几个可以进行可视化反编译的工具。但是我想知道是否有可以从命令行进行反编译的工具(类似于ildasm /OUT)。

动机是有 100 多个程序集,我不想打开每个程序集并保存为 .cs 文件。 .NET Reflector 似乎有批量加载程序集,但没有批量保存。所以我正在考虑编写一个脚本来遍历每个程序集并使用命令行命令对其进行反编译。

【问题讨论】:

    标签: c# decompiler


    【解决方案1】:

    如果您正在寻找一个为程序集生成 C# 代码的程序,Jon Gallant 最近有一篇关于使用 Telerik 的 JustDecompile 执行此操作的博客文章。您可以链接到几个程序集,然后您可以在没有 UI 的情况下控制代码的生成。

    【讨论】:

      【解决方案2】:

      您唯一需要的是这个名为 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
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-01-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-07-05
        • 2016-01-01
        相关资源
        最近更新 更多