I’m learning C++ and then I found out that there are decompilers. I read that it is not possible to get back the source code from a compiled C++ program. This is true? If so, is it possible to make it impossible? And which programs decompile C++ programs?
Answer 1, authority 100%
Full decompilation for C++ is generally impossible: variable and function names are not saved.
Answer 2, authority 12%
Disassembler IDA PRO is a tool for research, debugging and, if necessary, modification of already compiled programs when there is no source code. There are, of course, decompilers into C++ pseudocode (IDA can do this too), but they will be of little use. Assembly only!
Here is a screenshot of IDA PRO:
Well, if you really want to protect the program from hacking, that is, special obfuscator programs. They obfuscate the processor instructions into which the program is assembled. Anyone who wants to hack your program will disassemble your executable file. He will not be able to get the text of the program in Java because of the peculiarities of C++. The assembler is so difficult for normal people to read, but here it is also turned into a terrible mess by an obfuscator. This will torment the hacker pretty much. But it can hardly stop completely. And at the same time, there is an increased risk of errors and a slowdown in performance in the piece of code processed by the obfuscator. So the value of the method is questionable, unless, of course, you are developing an AAA-class project. All means are good there.