3

Possible Duplicate:
Is there some way to compile a .NET application to native code?

When you compile a C# application, it is compiled to CIL code, to be interpreted by the framework when it is ran, but im wondering if its possible to generate a native x86 EXE file stub for my application(s).

This way it is not possible to directly open my applications in a decompiler.

P.S I cannot use a obfuscator for anything.

Community
  • 1
  • 1
caesay
  • 16,932
  • 15
  • 95
  • 160
  • 1
    this is not possible, and also machine code can be decompiled, it is just harder to do... – Aykut Çevik Jul 25 '10 at 18:30
  • 1
    duplicate: http://stackoverflow.com/questions/1188006/turning-net-executable-into-native-executable http://stackoverflow.com/questions/45702/is-there-some-way-to-compile-a-net-application-to-native-code http://stackoverflow.com/questions/1778878/converting-net-app-to-x86-native-code http://stackoverflow.com/questions/189757/can-a-net-app-be-complied-to-native – Mauricio Scheffer Jul 25 '10 at 18:30
  • Voting to close this not because it's a bad question. It's a perfectly good question worthy of a +1 but there are so many duplicates already it's better just to link to those as has been done. – jcoder Jul 25 '10 at 18:36

2 Answers2

2

There is a tool called Salmander .NET Linker but it is offered for a high price. Personally I've never used it, but I see no point in doing that. Offical website

You could also try virtualizing you application using ThinInstall or Xenocode Virtualization Studio. I've used Xenocode's product to embed .NET runtime into my application and it worked great. It generates a native packed executable with your assemblies inside.

Kristina
  • 15,859
  • 29
  • 111
  • 181
  • The questionned mentionned the fact that he cannot use an obfuscator for anything. That prevented me from proposing an alternative tool. I'm still thinking how to answer this question ;) –  Jul 25 '10 at 18:32
  • Salmander .NET Linker is a linker, not an obfuscator. I think ... – Kristina Jul 25 '10 at 18:34
  • Yes but I do think that the user wanted to tell us that he do not want to use a commercial product. That's my guess. I'll give you 100 reputation points if I'm wrong ;) –  Jul 25 '10 at 18:47
0

According to this answer: Turning .NET executable into native executable what you are looking for is called AOT

http://www.mono-project.com/AOT

Alternatively, you can check this official Microsoft technical document: http://msdn.microsoft.com/en-us/library/ht8ecch6(VS.71).aspx

Community
  • 1
  • 1