SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Siegfried Pammer

ILSpy: Taking a look at BAML

As David and Daniel already wrote on their blogs, we have made a lot of progress with ILSpy lately. Yesterday I added support for decompiling BAML. BAML is the result of compiling XAML and is usually contained in .resources-files. You can decompile the BAML simply by selecting a .baml-file from the resources list, as shown in the screenshot below.

The decompiler works simply by using the Baml2006Reader class shipping with .NET 4 in System.Xaml.dll. Its output is processed and redirected to a XamlXmlWriter, which produces the appropriate text output.

The only major problem with this is that all assemblies needed to decompile the BAML have to be loaded via Reflection. Assemblies cannot be unloaded once they are loaded the runtime. The only way to get rid of them is to unload the AppDomain. Therefore a separate AppDomain is created every time a .baml-file is decompiled by ILSpy.

Note that the BAML decompiler is still under development. There might be some BAML-files that it might fail to decompile. If you come across any such assembly, please report it in the ILSpy forum.

Published Feb 19 2011, 08:30 PM by siegi44
Filed under: , ,

Comments

No Comments
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.