Search code examples
c++windowsobfuscationdecompilingsource-code-protection

Protect C++ program against decompiling


Possible Duplicate:
Is it possible to decompile C++ Builder exe? Is C++ Builder exe safe?

I use Microsoft Visual C++ 2010 Express to write my programs. When i want to distribute my program I compile it with 'Release' configuration and also I set the linker to not add debug information. So my question is, Is my executable safe or anyone can decompile it and see the source code? If it is unsafe, how can I prevent it from being decompiled?


Solution

  • All programs can be decompiled to a degree. However, the vast bulk of the useful information in your source code is removed during compilation. The source code that a decompiler produces is a pale imitation of the original.

    The variable names, function names, class names etc. will not be available after decompilation. So the best that a decompiler can do is to turn your functions that look like this:

    double CalculateWidgetStrength(int WidgetType, int WidgetFrobishness);
    

    into rather meaningless code like this:

    double Function85(int p1, int p2);
    

    And even succeeding in doing that much accurately can be very hard for a decompiler.