.net Reflector 的开源替代品?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2425973/
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
Open Source Alternatives to Reflector?
提问by MagicAndi
Just to ask if anyone knows of an open sourcealternative to RedGate's Reflector? I'm interested in checking out how a tool similar to Reflector actually works.
只是想问问是否有人知道RedGate 的Reflector 的开源替代品?我有兴趣了解一个类似于 Reflector 的工具实际上是如何工作的。
Note, if you know of a free but notopen source alternative to Reflector, you can answer the following related question:
请注意,如果您知道Reflector的免费但非开源替代品,您可以回答以下相关问题:
Summary - Updated 11th May 2011
摘要 - 2011 年 5 月 11 日更新
A quick round-up of the various open source projects and tools that have been suggested:
已建议的各种开源项目和工具的快速汇总:
- Common Compiler Infrastructure(CCI)
- Mono Cecil
- ILSpy
- dnSpy(fork of ILSpy, project appears more active than original)
- Dotnet IL Editor (DILE)
- IL.View
- Monoflector(no longer activeas of April 2011)
- 通用编译器基础架构(CCI)
- 单色塞西尔
- ILSpy
- dnSpy(ILSpy 的分支,项目看起来比原始项目更活跃)
- Dotnet IL 编辑器 (DILE)
- IL.View
- Monolector(自 2011 年 4 月起不再活跃)
The following resources may also be of interest:
以下资源也可能令人感兴趣:
- TypeView.cs
- Jason Haley's notes on disassembling .NET
- Adrian Bank'srecent blog postsummarising a number of Reflector alternatives, including several options not mentioned below.
- Mark Lichtenberg's detailed blog postcomparing several of the open source alternatives (DILE, ILSpy and Mono Cecil using MonoDevelop) to Reflector.
- 类型视图.cs
- Jason Haley 关于反汇编 .NET的笔记
- Adrian Bank最近的博客文章总结了许多 Reflector 替代方案,包括下面未提及的几个选项。
- Mark Lichtenberg 的详细博客文章比较了几种开源替代方案(使用 MonoDevelop 的 DILE、ILSpy 和 Mono Cecil)与 Reflector。
采纳答案by leppie
回答by MagicAndi
Updated 13th December 2011
2011 年 12 月 13 日更新
The following open source tools are available:
可以使用以下开源工具:
- ILSpyfrom the SharpDevelop team. Thanks to Scott Hanselman's tweethighlighting the tool.
- Dotnet IL Editor(a disassembler)
- IL.View- a .NET Reflector alternative written in Silverlight 4 as an Out-of-Browser Silverlight Application. See this blogpost for details.
- 来自 SharpDevelop 团队的ILSpy。感谢Scott Hanselman 的推文重点介绍了该工具。
- Dotnet IL Editor(反汇编器)
- IL.View- 在 Silverlight 4 中编写的 .NET 反射器替代方案,作为浏览器外的 Silverlight 应用程序。有关详细信息,请参阅此博客文章。
回答by Ferdinand Prantl
Another replacement would be dotPeek. JetBrains announced it as a free tool. It will probably have more features when used with their Resharperbut even when used alone it works very well.
另一个替代品是dotPeek。JetBrains 宣布它是一个免费工具。当与他们的Resharper一起使用时,它可能会有更多的功能,但即使单独使用它也能很好地工作。
User experience is more like MSVS than a standalone disassembler. I like code reading more than in Reflector. Ctrl+T navigation suits me better too. Just synchronizing the tree with the code pane could be better.
用户体验更像是 MSVS,而不是独立的反汇编程序。与 Reflector 相比,我更喜欢阅读代码。Ctrl+T 导航也更适合我。仅将树与代码窗格同步可能会更好。
All in all, it is still in development but very well usable already.
总而言之,它仍在开发中,但已经很好用了。
回答by ray glover
Telerik today released a Beta of their own decompilation tool, JustDecompile. Closed source, but free and looks promising.
Telerik 今天发布了他们自己的反编译工具JustDecompile的 Beta 版。闭源,但免费,看起来很有前途。
回答by Rob
回答by Jason Haley
Actually, I'm pretty sure Reflector is considered a disassembler with some decompiler functionality. Disassembler because it reads the bytes out of an assembly's file and converts it to an assembly language (ILasm in this case). The Decompiler functionality it provides by parsing the IL into well known patterns (like expressions and statements) which then get translated into higher level languages like C#, VB.Net, etc. The addin api for Reflector allows you to write your own language translator if you wish ... however the magic of how it parses the IL into the expression trees is a closely guarded secret.
实际上,我很确定 Reflector 被认为是具有一些反编译器功能的反汇编器。反汇编器,因为它从程序集文件中读取字节并将其转换为汇编语言(在本例中为 ILasm)。它通过将 IL 解析为众所周知的模式(如表达式和语句),然后将其翻译成更高级的语言(如 C#、VB.Net 等)来提供反编译器功能。反射器的插件 api 允许您编写自己的语言翻译器,如果你希望......然而,它如何将 IL 解析为表达式树的神奇之处是一个严密保密的秘密。
I would recommend looking at any of the three things mentioned above if you want to understand how IL disassemblers work: Dile, CCI and Mono are all good sources for this stuff.
如果您想了解 IL 反汇编程序的工作原理,我建议您查看上面提到的三件事中的任何一项:Dile、CCI 和 Mono 都是这些东西的好来源。
I also highly recommend getting the Ecma 335 spec and Serge Lidin's book too.
我还强烈建议您阅读 Ecma 335 规范和 Serge Lidin 的书。
回答by Joe White
The main reason I used Reflector (and, I think, the main reason most people used it) was for its decompiler: it can translate a method's IL back into source code.
我使用 Reflector 的主要原因(我认为也是大多数人使用它的主要原因)是为了它的反编译器:它可以将方法的 IL 转换回源代码。
On that count, Monoflectorwould be the project to watch. It uses Cecil, which does the reflection, and Cecil.Decompiler, which does the decompilation. But Monoflector layers a UI on top of both libraries, which should give you a very good idea of how to use the API.
就此而言,Monoflector将是值得关注的项目。它使用执行反射的 Cecil 和执行反编译的 Cecil.Decompiler。但是 Monolector 在这两个库之上分层了一个 UI,这应该会让您对如何使用 API 有一个很好的了解。
Monoflector is also a decent alternative to Reflector outright. It lets you browse the types and decompile the methods, which is 99% of what people used Reflector for. It's very rough around the edges, but I'm thinking that will change quickly.
Monoflector 也是 Reflector 的一个不错的替代品。它可以让你浏览类型并反编译方法,这是人们使用 Reflector 的 99%。它的边缘非常粗糙,但我认为这会很快改变。
回答by Andrew Hare
Well, Reflector itself is a .NET assembly so you can open Reflector.exe in Reflector to check out how it's built.
嗯,Reflector 本身是一个 .NET 程序集,因此您可以在 Reflector 中打开 Reflector.exe 来查看它是如何构建的。
回答by Codewhisperer84
I am currently working on an open-source disassembler / decompiler called Assembly Analyzer. It generates source code for methods, displays assembly metadata and resources, and allows you to walk through dependencies.
我目前正在开发一个名为 Assembly Analyzer 的开源反汇编器/反编译器。它为方法生成源代码,显示程序集元数据和资源,并允许您遍历依赖项。
The project is hosted on CodePlex => http://asmanalyzer.codeplex.com/
该项目托管在 CodePlex => http://asmanalyzer.codeplex.com/
回答by Cheeso
The Reflector tool uses Reflection. - apparently this is not correct.
反射器工具使用反射。 - 显然这是不正确的。
You asked for two things - code that shows what reflector does, and also an alternative to reflector.
您要求两件事 - 显示反射器功能的代码,以及反射器的替代方案。
Here's an example, much simplified from what Reflector does, but it shows the technique of reflection: TypeView.cs
这是一个示例,与 Reflector 的功能相比大大简化,但它显示了反射技术: TypeView.cs
I don't have a suggestion for an open-source Reflector replacement.
我没有关于开源 Reflector 替代品的建议。

