I've been looking into obfuscation software, but wondered if one could do it easily with a macro. If you go into the class diagram in visual studio 2010, you can easily click on class names, properties, fields, etc, and rename them from something meaningful to a, aa, aaa, abc, whatever. In a really small project, this would be really easy, but not so in larger projects. Could one just write a macro that looped through the set of classes, field, properties, etc. in the class diagram, and renamed them. I couldn't immediately figure out how (given I haven't written any macros in studio). Any direction would be helpful. I'm happy to post the final macro code. Thanks! Wayne.
Any reason why you'd go with a macro instead of Dotfuscator? It's free in VS2010, and has more features with a commercial license.
If you wanted simply to push a button and have your sourcecode obfuscated on-the-fly, you could write a macro. Dotfuscator commercial does boast "Visual Studio Integration".
Doing this via a macro does not guarantee correctness - many times, VS fails to rename a class/method- what would happen in that case?
Also, "writing" a macro" sounds simple to the ears, but you are essential writing a complete obfuscator - you must decide what you must rename classes/methods to, avoid conflicts, take care of special cases like virtual methods, exclude some classes/methods, and countless other rules.
You are much better off using an obfuscator. Try Crypto Obfuscator.