Code - FileGenerator for Reflector
Download it here.
This is an add-in for Reflector. It generates source code in the current selected language. It can also structure the code to be in one directory or in a directory hierarchy based on the full class name. Here's a screen shot of the add-in in action as it generates source for for mscorlib:
The add-in also can create a VS 2005 project file. This will work for any language plug-in; currently the add-in will use a default ".msbuild" extension if the chosen language is not C# or VB. Here's a screen shot of VS 2005 with the
AppDomain class open:
The 2.0 branch was tested against version 184.108.40.206 of Reflector. It will not work with previous versions of Reflector. Furthermore, it's unknown if it will work against future versions of Reflector. If you run into problems with FileGenerator with a different versions, try recompiling the add-in against the version of Reflector you have.
This tool is for educational purposes ONLY. It is not intended to illegally reverse-engineer assemblies; it's only to see the decompilation results that Reflector currently generates in a file. Any other use of this tool is up to the user, and any possible consequences of such actions are solely the responsibility of the user (i.e. the maker of Reflector and the add-in are not to blame if you reverse-engineer an assembly to re-sell for profit).
Also, I do not include Reflector.exe in the project. To get this file, go to http://www.aisto.com/roeder, and get the latest version of Reflector. You may have to adjust the target location of the reference in the VS project depending on where you install Reflector to get the code to compile. For the 1.1 branch, you have to copy and rename the EXE to have a DLL extension as VS 2003 does not support referencing EXE assemblies.
- The generated code is sometimes a bit bug-ridden. Up to version 220.127.116.11, this was never an immediate problem, but since project creation is supported I'm noticing odd code generation issues. I don't write language add-ins, but as I find issues that I can confirm are bugs I'll notify the add-in creator about them.
- Continue to address assembly content generation emission issues.
- No new code changes, but now the code drop is split into two directories - 4.2 and 5.0. If you're still using Reflector before 5.0, use the 4.2 code. Eventually, I'll drop the 4.2 branch (it's frozen - I won't make any new changes to the 4.2 branch).
- Added exception handling to resource generation.
- Fixed more bugs associated with creating projects.
- Fixed bugs associated with creating valid projects when selecting just a type.
- Fixed a bug with resource file creation.
- VS 2005 project generation was added...
- Minor upates to code structure.