我希望将大量的程序集反编译成C#。我发现了几个可以进行可视化反编译的工具。然而,我想知道是否有一个工具可以从命令行进行反编译(类似于ildasm /OUT)。
其动机是存在程序集的100+,我不想打开每个程序集并将其另存为.cs文件。.NET Reflector似乎有一个批量加载的程序集,但它没有批量保存。因此,我正在考虑编写一个脚本,它遍历每个程序集,并使用命令行命令对其进行反编译。
发布于 2011-11-12 05:12:28
如果你正在寻找一个为程序集生成C#代码的程序,Jon Gallant最近有一篇博客文章介绍了如何使用Telerik的JustDecompile来实现这一点。您可以链接到几个程序集,然后可以在没有UI的情况下控制代码的生成。
发布于 2020-05-10 21:47:18
您唯一需要的就是这个名为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 mscorlibhttps://stackoverflow.com/questions/8099966
复制相似问题