1

I use Microsoft Visual Studio 2012 and I want to write an application in native C++. Reason why I don't want to use Manged Code (.NET) because I don't want that my application was decompiled back to the Source Code with such tools like a .NET Reflector, but it would be nice if I still could use UI (CLR Windows Form) in my application.

But when I'm adding UI (CLR Windows Form) to my Win32 Project this message pops up:

message

Does that mean that from now all my project won't be compiled as a native code and there will be possibility to decompile whole my application with such tools like a .NET Reflector?

Or it will be "mixed" (Native Code + Managed Code) project ant there won't be ability to decompile whole application with such tools like a .NET Reflector only certain part of it which is responsible for UI?

P.S. Yes, I know that any application can be decompiled (!!!), but I namely asking about the decompiling tools for .NET based applications. With .NET Reflector you can "get back the original source code" from .NET applications. So my question is, does it will be possible "to get back the original source code" from this application or it will be somehow "mixed" code (manged + native) and there won't be possibility to decompile it back to the original source code with such tool like a .NET Reflector?

  • 7
    Never forget that if the machine can run a program, someone can decompile your program. – Bestter Jan 09 '13 at 15:46
  • It'll be a mixed project. – slugonamission Jan 09 '13 at 15:47
  • 1
    Unless I'm badly mistaken, it's telling you that (if you approve) it's going to compile your C++ as C++/CLI. IOW, if you click "Yes", it's going to do exactly what you're trying to avoid. – Jerry Coffin Jan 09 '13 at 15:54
  • 4
    @MartinLabelle: While you're (at least mostly) correct, CLR code is *dramatically* easier to decompile (meaningfully) than most native code. – Jerry Coffin Jan 09 '13 at 15:57
  • Consider writing a DLL for your business logic and referencing that in a CLI project that only manages the UI. – Wutz Jan 09 '13 at 16:01

1 Answers1

5

If "decompiling" menas "to get back the original source", in absence of any symbol table in the executable, tha would be not possible.

If "decompiling" means "to get a user modifiable code that is semantically equivalent to the original and can be compiled back into an executable program" that is always possible (even by modifying the machine code itself directly: there are people that understand it!). How this is understandable to what large audience that's all another story.

The general law of marketing says "the only thing that cannot be copied is the one that never gets sold!" It's a matter related to the physical nature of software. There is no workaround from that (apart working for another universe)

Emilio Garavaglia
  • 20,229
  • 2
  • 46
  • 63
  • Yes, I know that any application can be decompiled, but I namely asking about the decompiling tools for .NET based applications. With .NET Reflector you can "get back the original source code" from .NET applications. So my question is, does it will be possible "to get back the original source code" from this application or it will be somehow "mixed" code (manged + native) and there won't be possibility to decompile it back to the original source code with such tool like a .NET Reflector? – user1961297 Jan 09 '13 at 16:11
  • The managed parts of your application can be decompiled by .NET tools like Reflector. The native parts of your application cannot (but can be decompiled by other tools, although the result is not as close to the original source code) – jalf Jan 09 '13 at 16:25
  • @jalf So manged and native code somehow will be mixed and stored in the single file (if I will choose to compile it to the single EXE) and .NET Reflector will be able to took only peaces with managed code? If it is true then it sounds good for me. – user1961297 Jan 09 '13 at 16:39