Reflector Addin: LanguageWriterHelper

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

posted on Tuesday, December 02, 2008 5:44 PM

Feedback

# re: Reflector Addin: LanguageWriterHelper

I'm always curious to know why people create XML formats in which *everything* is an element?

It leads to huge files which are very hard to read (due mainly to their highly vertical nature)

Why can things like booleans, strings, integers (you know basic simple value types) not be attributes of their parents instead of sub elements?

Where does this compulsion come from?
12/2/2008 9:48 PM | Rory Becker

# re: Reflector Addin: LanguageWriterHelper

Rory: speed and simplicity
12/3/2008 3:53 AM | Jason Haley

Post Comment

Title  
Name  
Url
Comment   
Please enter the following code into the box below to stop spammers

  
Enter Code Here *