Author Topic: will CodeBlocks do reverse compiling?  (Read 1598 times)

Offline MrCrashTestDummy

  • Single posting newcomer
  • *
  • Posts: 2
will CodeBlocks do reverse compiling?
« on: January 21, 2022, 08:44:24 pm »
So the question (for now anyway) seems a pretty simple yes or no type of question...

Will CodeBlocks do reverse compiling?

The reason I ask isnt really to hack or rip anyone off...  It's more like I just dont know what I am doing (as a C++ newbie)...  when I learned HTML - it was largely because I could look at the source code through the browser...   so I thought reverse compiling, if possible, might provide a similar way to get some ideas on how to use C++...

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3255
Re: will CodeBlocks do reverse compiling?
« Reply #1 on: January 21, 2022, 09:27:26 pm »
It is not possible to "reverse" compile c++ binaries to c++ because of non loose less optimization of the compiler. You can disassemble it from byte code (binary) to assembler and then to some sort of c++ code, but it never gets to the code you compiled.
There are tools that help you by drawing call graphs and recognise some compiler optimisations and decompile some things (for example IDA Pro https://hex-rays.com/ida-pro/ ) but they are expensive.

Codeblocks can display disassembled code during debugging. This is useful when you work with embedded systems but less useful for x86 or AMD64 code.

In short: If you are a nooby and want to decompile and understand binary executables where you do not have the code, then you will have no luck, with no tool. Understanding decompiled code is difficult.

You can read code from open source projects and other tutorials to learn c++

You can debug code to understand what it is doing but you will need the source code of the application: for ex.: https://www.youtube.com/watch?v=IN_RTt_5cf0