Reflector Addin: LanguageWriterHelper

by Jason Haley 2. December 2008 12:44

I'm starting to write the new IL writer for the Debris addin, but first need to get a better understanding of how Reflector's language translator works ... so I wrote a language addin that outputs the object structure as xml.  I really doubt too many people will find this helpful, but just in case here are the download links:

Dll Only: LanguageWriterHelper.zip 

Source Code Only: LanguageWriterHelperSource.zip

Just put the dll in your Reflector directory and add it as an addin.  You'll then have a new choice on the language dropdown called "Helper".

WARNING: The xml files get big fast!

Here are some examples of the output for a simple snippet of the following C# code:

Console.WriteLine("Hello World");

With the Helper language you get a rather long xml segment(cut off due to the length):

image

The idea is to use the Export functionality in order to open it in IE (or you favorite xml browsing tool).  Make sure "Helper" is the active language, then right click on the assembly (context menu shown below) and choose Export and you'll have Reflector generate the xml version of the assembly. 

image

By default Reflector will save it in your %My Documents%\Reflector\Disassembler\ directory.  As long as the xml file is not too big, you should be able to easily  browse the code as an xml hierarchy and see the way Reflector builds the statements and expressions when writing out to the disassembler window.

image

Comments (2) | Post RSSRSS comment feed |

Categories:
Tags:

Comments

Comments are closed