tags:

views:

1310

answers:

7

I wrote a windows application using C# .Net 2.0 and i want to do something which hide the source code, so when any one use refactor tool can't see the source code. I used dotfuscator but it just changed the function names but not all the source code.

UPDATE: I want to hide the source code, not because of hiding the key, but to hide how the code is working.

Thanks,

+3  A: 

IL is by definition very expressive in terms of what remains in the body; you'll just have to either:

  • find a better (read: more expensive) obfuscator
  • keep the key source under your control (for example, via a web-service, so key logic is never at the client).
Marc Gravell
A: 

There are limits to the lengths obfuscation software can go to to hide the contents of methods, fundamentally changing the internals without affecting the correctness (and certainly performance) is extremely hard.

It is notable that code with many small methods tends to become far harder to understand once obfuscated, especially when techniques for sharing names between methods that would appear to collide to the eye but not to the runtime are employed.

Some obfuscators allow the generation of constructs which are not representable in any of the target languages, the set of all operations allowable in CIL for example is way more than that expressible through c# or even C++/CLI. However this often requires an explicit setting to enable (since it can cause problems). This can cause decompilers to fail, but some will just do their best and work around it (perhaps inlining the il it cannot handle).

If you distribute the pdb's with the app then even more can inferred due to the additional symbols.

ShuggyCoUk
A: 

As soon as people get a hand on your binaries they can reverse-engineer it. It’s easier with languages that are compiled to bytecode (C# and Java) and it’s harder with languages that are compiled to CPU-specific binaries but it’s always possible. Face it.

Bombe
+1  A: 

Try SmartAssembly http://www.smartassembly.com/index.aspx

Ries
+1  A: 

Well, the source code is yours and unless you explicitly provide it, youll perobably only be providing compiled binaries.

Now, these compiled binaries are IL code. To prevent someone "decompiling" and reverse engineering your IL code back to source code, you'll need to obfuscate the IL code. This is done with a code obfuscator. There are many in the marketplace.

You've already done this with dotfuscator, however, you say that it only changed the function names, not all the source code. It sounds like you're using the dotfuscator edition that comes with Visual Studio. This is effectively the "community edition" and only contains a subset of the functionality of the "professional edition". Please see this link for a comparison matrix of the features of the community edition and the professional edition.

If you want more obfuscation of your code (specifically to protect against people using tools such as Reflector), you'll need the professional edition of Dotfuscator, or another code obfuscator product that contains similar functionality.

CraigTP
from where i can download Dotfuscator Professional Edition?
Amr ElGarhy
Well, the Professional Edition costs money, but you can get an evaluation version from http://www.preemptive.com/dotfuscator.html
CraigTP
A: 

i found this one as well http://www.eziriz.com/ , seams nice, but still testing

Amr ElGarhy
A: 

Just symbol renaming is not enough of a hindrance to reverse-engineering your app. You also need control flow obfuscation, string encryption, resource protection, meta data reduction, anti-reflector defenses, etc, etc. Try Crypto Obfuscator which supports all this and more.

logicnp