Reflector插件

Reflector是一款强大的反编译工具.使用它你可以方便的查看一些组件的源代码.它的强大之处不仅在此, 它本身还提供了一个添加插件的框架, 使得它的功能可以很容易的得到扩展, 基于此已经有围绕它的插件开发出来.目前就包括将反编译的源代码直接导出文件, 查看源代码的统计信息等等很有用的插件.

Reflector.FileDisassemblerThis add-in can be used to dump the disassembler output to files for any Reflector supported language.
Website Download

Reflector.CodeMetrics
Analyses .NET assemblies and shows design quality metrics. The menu item is registered under the "Tools" menu.
Website Download

Reflector.SQL2005BrowserThis add-in allows to browse .NET assemblies stored in SQL Server 2005 (Yukon) databases.
Website Download

Reflector.DelphiLanguage
The Delphi view that is used inside .NET Reflector provided as a language add-in.
Website Download

Reflector.McppLanguage
This add-in extends Reflector with a Managed C++ language rendering module.
Website Download

Reflector.ChromeLanguage
This add-in extends Reflector with a Chrome language rendering module.
Website Download

Reflector.Diff
This add-in shows differences between two versions of the same assembly.
Website Download

Reflector.VisualStudio
This program is hosting .NET Reflector inside the Visual Studio 2003 IDE. Run Reflector.VisualStudio.exe to register the add-in with Visual Studio.
Website Download

Reflector.ClassView
Shows class definitions as plain text with color coding. The menu item is registered under the "Tools" menu.
Website Download

Reflector.CodeModelView
This add-in shows the underlying code model objects for a selected node in .NET Reflector. The menu item is registered under the "Tools" menu.
Website Download

Reflector.FileGenerator
This add-in can be used to dump the disassembler output to files for any Reflector supported language.
Download

Reflector.Graph
This add-in draws assembly dependency graphs and IL graphs.
Website Download

Reflector.OpenRunningAssembly
Opens an assembly or dependency from a process running on the system. The menu item is registered under the "Tools" menu.
Website Download

打开Reflector工具并且下载了一个FileDisassembler插件,FileDisassembler插件用于输出程序集的反编译结果到文件中。打开Reflector工具,并导入FileDisassembler插件。导入好后加载程序集将反编译结果输出到指定的文件夹中;


Reflector下载地址:http://www.aisto.com/roeder/dotnet 下载时必须输入用户名和Email地址,用户名中必须有空格;

FileDisassembler插件的下载地址:http://www.denisbauer.com/



使用VS.NET新建一个项目,根据文件夹结构新建相应的文件夹,导入所有的源文件和资源文件。使用FileDisassembler导出的资源文件为全名称,在实际的项目中必须根据namespace更改资源文件名且必须将“生成操作”更改为“嵌入的资源”,可以使用ILDASM查看metadata来决定资源文件名及所在的文件夹,编译并更改一些错误;


当编译好后,找到所有与COM有关的内容将其注释掉(因为以前使用过CCW/RCW技术),并做相应的更改,每更改一个class后,编译一次,直到去掉其相关引用为止;


更改完成后,需要对其进行重构,主要重构以下方面:
rename,因为Reflector工具反编译时其变量名会根据类型来命名,如text1,text2,num1等;
去掉goto语句,如果代码中有swtich语句时,Reflector工具会使用goto语句,严重影响程序逻辑其可读性;
Extract Method,将过于长的method执行分解操作;


当重构完成后,应用到项目中,并更改相应的Register语句,test,run,结果是successful,从而也在最短的时间内完成了项目经理所交给我的任务。



先行说明:在reflect时,请遵守ESRI公司的End User Licenses。