views:

1005

answers:

3

Hi,

I am very curious as to how people write their own obfuscator.

How hard would it be to simply do the following:

  1. rename all public methods with GUID type names.

Where would I start? How would I go about reading the .net dll assemby, pulling the public methods out and renaming them?

+5  A: 

You can check those two projects that are using Cecil to write an open-source obfuscator:

Jb Evain
+1  A: 

If you're starting with source, it's pretty simple to do text replacements and then run the code through a compiler. If you are starting with a compiled assembly, then you need to use the stuff in the System.Reflection namespace to load the assembly and System.CodeDom to generate compilable code units.

ctacke
but how would you write a new version of the assembly after doing reflection on the original assembly.
Blankman
Using CodeDom - it can write code and then compile.
ctacke
+2  A: 

Jason Haley has some great links...

Brian Schmitt