Protecting my intellectual property/XAML
Every .NET developer worth their salt has probably played round with Lutz Roeder's Reflector... This application allows you to peak into a .NET application and disassemble it to readable code! This can be very useful when you have a 3rd party library and you need to "see" how something was implemented! I recently discovered the BamlViewer. BamlViewer is a add-in for Reflector that allows you to disassemble BAML (Binary Application Markup Language). My big concern now is how do I protect my XAML? If I spend big bucks on a flashy WPF designer and he created some cool themes for my super dooper application... surely I would like to protect these "resources"? A common practice in WPF today is to place a "theme" in a separate resource dictionary. Using Reflector/BamlViewer, I can now extract this XAML and reuse it in my own application?
I few months ago, I wrote a article were I used the cool themes created by Corrina Barer for Silverlight. I used the exact same program and here is what Reflector gives me
I open my application in Reflector. Browse to the Resources and double click on the .g.resources file, which list all the resources in my application. It doesn't take a genius to figure out that theme/rough.baml is the file I am interested in! Tools -> BAML Viewer and now I can "open" or "save as..." rough.baml as plain XAML!!!
From what I have read, most of the common available Obfuscating software do not support XAML yet, so how do I protect my XAML?
The closes I could find so far is {smartassembly} .NET Obfuscator 3.0! Based on the product features, it supports XAML... will try it out and publish my results! If you find a cool or clever way and would like to share... please post here!!!
Resources
Reflector
BAML Viewer
Read more here
Rob Relyea - Obfuscation and Xaml/Baml
Obfuscate XAML
Obfuscated code
If you are going to Tech-ed 2008 South Africa, be sure to catch Tamir Khason's session on "Understanding Reflection"
And as always, If you found this article useful, please 