Obfuscate Revit addins

EDIT: What is described below, does not work, if you have UAC enabled – you can not copy files in C:\Program Files\ directory or subdirectories – see this post for more information.

All of you that develop Revit addins have or will at one point need some obfuscation tool to protect your intellectual property. Jeremy and Kean have already written about what obfuscation is and how to do it for either Revit or AutoCAD addins.

I would like to add few notes which may be useful for you. Since I was on a tight budget, the only option for me was free obfuscator. I chose Eazfuscator.NET.

When I ran the obfuscation, I got an error saying “Unable to find type…” – see this post for more info. Daren had the similar problem and he solved it with free version of Babel.NET.

The solution was, to copy all the assemblies in Revit directory (e.g. C:\Program Files\Autodesk\Revit Architecture 2011\Program\) obfuscate it there and then move it back to working directory. Here is the BATCH file which does the trick (the file has to be located in your bin directory):

rem copy libraries
set file=Library1.dll
copy /y %file% "C:\Program Files\Autodesk\Revit Architecture 2011\Program\"
set file=Library2.dll
copy /y %file% "C:\Program Files\Autodesk\Revit Architecture 2011\Program\"

rem copy addin
set assembly=Addin.dll
copy /y %assembly% "C:\Program Files\Autodesk\Revit Architecture 2011\Program\"

rem obfuscate
"C:\Program Files (x86)\Eazfuscator.NET\eazfuscator.net.exe" "C:\Program Files\Autodesk\Revit Architecture 2011\Program\%assembly%"
move /y "C:\Program Files\Autodesk\Revit Architecture 2011\Program\%assembly%"

rem cleanup libraries
set file=Library1.dll
del "C:\Program Files\Autodesk\Revit Architecture 2011\Program\%file%"
set file=Library2.dll
del "C:\Program Files\Autodesk\Revit Architecture 2011\Program\%file%"

I haven’t tried it yet, but I guess the method works also for AutoCAD addins.

Enhanced by Zemanta
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: