0

Is it possible to decompile C++ Builder exe?

Is C++ Builder safe programming tools or anyone can decompile it and see the code?

akappa
  • 10,220
  • 3
  • 39
  • 56
N K
  • 121
  • 1
  • 2
  • 6

1 Answers1

9

The short answer, yes, it can be decompiled, and it's not "safe". Anything ran on a computer can be disassembled and from that inspected by reading the disassembly. Decompiling would mean restoring even some of the original compiled source code - which indeed is possible, to some extent. After all, it is "just" about writing a program which can translate assembly to the desired language. If a human can do that, then a program can do that too, because it is only about applying known rules and logic to translate the program from different representation/language to another. However, it is not just that simple...

Lots of information (like source files, variable names, some unused code, comments etc.) gets lost in the compilation process. This is further worsened by compiler optimizations which usually make the resulting disassembly near unreadable in some cases. As such, the decompiled source code can only give mere clues about the implementation details and mainly just the logic, not the actual source code used to build the project.

Please note that this has near nothing to do with any form of "safety" or security of a program itself. Any program can be disassembled in a way or another, any logic behind a working program can be inspected and reverse-engineered. There can be no secrets inside a program, nothing can be hidden if it can be run.

It is often much easier to disassemble a piece of executable and work through its logic in assembly, than trying to rely on very vague and usually broken reconstruct in high-level language such as C which many such decompilers still produce. Sometimes though, tools can produce readable and very clear high-level representations by disassembling, but they are often the simple cases and short excerpts of code.

The bottom line is, that you don't need a decompiler to inspect, reverse-engineer and understand a target program. All one needs is the access to the executable, a disassembler and understanding of assembly language. There is no way to avoid this fact, and it is very rarely a real problem.

zxcdw
  • 1,629
  • 1
  • 10
  • 18
  • 1
    Is it like .Net Application? Or like MFC or QT exe? – N K Jun 22 '12 at 12:50
  • It is none of them. C++ Builder is probably written in Delphi, so to decompile it you would have to find a tool which can reconstruct some of the constructs of the original source code from a program written in Delphi. Such tool probably does not exist though - that doesn't mean it wouldbe *impossible* though. – zxcdw Jun 22 '12 at 12:58
  • The IDE and frameworks are written in Delphi, but the compiler is not. Both C++Builder and Delphi compile to native assembly, though the semantics of that assembly are going to be different where the C/C++ and Delphi languages differ. – Remy Lebeau Jun 22 '12 at 22:24