views:

345

answers:

6

Is this possible? Does the .NET framework depend on the meta data in the bytecode? I'd like to have an application i write not work in reflector or a similar .NET decompiler.

Any help would be super :D

A: 

I don't think you can remove the meta data, but you can obfuscate your code if you're looking to protect your IP.

lomaxx
A: 

The Dotfuscator will stop your code from being able to be decompiled http://www.preemptive.com/dotfuscator.html

Edit: I should have mentioned, that's the professional version, the free community version ships with visual studio

Glenn Slaven
+1  A: 

I think you are referring to the Assembly Manifest:

Every assembly, whether static or dynamic, contains a collection of data that describes how the elements in the assembly relate to each other. The assembly manifest contains this assembly metadata. An assembly manifest contains all the metadata needed to specify the assembly's version requirements and security identity, and all metadata needed to define the scope of the assembly and resolve references to resources and classes.

One of the most important features of .Net assemblies is that they are self-describing components and this is provided by the manifest. So removing them will somehow defeat its purpose.

John
+2  A: 

If you remove the metadata the framework won't be able to load your code, or figure out which other assemblies it references, or anything like that, so no, that's not a good idea.

Obfuscators will make it a lot harder for an 'attacker' to decompile your code, but at the end of the day if someone is motivated and smart there's not a lot you can do to stop them.
.NET will always compile down to MSIL, and MSIL is inherently easier to read than raw x86. That's just one of the tradeoffs you make for using .NET.

Don't worry about it. The source code to apache, linux, and everything else is freely available on the net, but it's not providing much competitive advantage to microsoft is it :-)

Orion Edwards
+1  A: 

This looks like the same question as:

http://stackoverflow.com/questions/29677/how-do-i-make-the-manifest-of-a-net-assembly-private

See my answer there:

http://stackoverflow.com/questions/29677/how-do-i-make-the-manifest-of-a-net-assembly-private#29692

"I think what you're talking about is "obfuscation". There are lots of articles about it on the net:

http://en.wikipedia.org/wiki/Obfuscation

The "standard" tool for obfuscation on .NET is by Preemptive Solutions:

http://www.preemptive.com/obfuscator.html

They have a community edition that ships with Visual Studio which you can use.

You mentioned ILDasm, have you looked at the .NET Reflector?

http://aisto.com/roeder/dotnet/

It gives you an even better idea as to what people can see if you release a manifest!"

Mark Ingram
A: 

Wouldn't solutions like VMware's ThinApp (Formerly Thinstall) help a bit with protecting your code also? It comes at an extremely high price though..

neslekkiM