C# .net 反汇编器/反编译器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/578883/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
A .net disassembler/decompiler
提问by Dana
I am looking for a disassembler or better, a decompiler for .net. The situation is that the source code for an assembly written by one of my predecessors is lost and I'd like to take a look to see what it's doing.
我正在寻找反汇编程序或更好的 .net 反编译程序。情况是我的一位前任编写的程序集的源代码丢失了,我想看看它在做什么。
I know that ildasm comes with the Visual Studio installation so I can get at the MSIL, but I was hoping there was a program clever enough to work back to the C# code (or best approximation).
我知道 ildasm 随 Visual Studio 安装一起提供,因此我可以使用 MSIL,但我希望有一个足够聪明的程序可以返回 C# 代码(或最佳近似值)。
Are there any tools for this out there?
有没有任何工具可以做到这一点?
(If not, I suppose it'll be a good excuse for me to sit down and start to learn MSIL)
(如果没有,我想这将是我坐下来开始学习 MSIL 的好借口)
采纳答案by overstood
回答by mqp
.NET Reflectoris the usual tool for this.
.NET Reflector是常用的工具。
回答by BFree
回答by Brian Rasmussen
Reflector is the way to go, but if you can't use that for some reason, Microsoft ships a disassembler called ILDasm with the framework.
Reflector 是可行的方法,但如果由于某种原因您不能使用它,Microsoft 会随该框架提供一个名为 ILDasm 的反汇编程序。
A good source for MSIL knowledge is the book Expert .NET 2.0 IL Assemblerby Serge Lidin.
Serge Lidin所著的Expert .NET 2.0 IL Assembler一书是 MSIL 知识的一个很好的来源。
回答by Phil Wright
Now that Red Gate have started charging for the .NET Reflector tool you might want to check out these free alternatives instead...
现在 Red Gate 已经开始对 .NET Reflector 工具收费,您可能想查看这些免费替代品......
回答by Aftershock
Ok,
好的,
I tried on a project. ILSpy
我尝试了一个项目。ILSpy
Telerik JustDecompile
Telerik JustDecompile
.NET Reflector Demo
.NET 反射器演示
All can create Visual C# project. The generated code did not compile for JustDecompile and Reflector. In one case, ILSpy made a code that compiled (just references had to be set) The mistakes IlSpy did not look as compiicated as one found in others. All generated code can be fixed if one know C# well enough.
都可以创建 Visual C# 项目。生成的代码没有为 JustDecompile 和 Reflector 编译。在一种情况下,ILSpy 制作了一个编译代码(只需要设置引用) 错误 IlSpy 看起来不像其他人发现的那样复杂。如果足够了解 C#,所有生成的代码都可以修复。
An interesting direction can be used to decompile code using both JustDecompile and Ilspy and merge the codes that are correct because these decompilers (and third as well) seem to make different mistakes.
一个有趣的方向可用于使用 JustDecompile 和 Ilspy 反编译代码并合并正确的代码,因为这些反编译器(以及第三个)似乎会犯不同的错误。