painterguy said:
hi once again,
is there software available which decompile a programme into source code again?
i was reading an intrductory book on computer which is very popular here which says there is another kind of software closely related to compiler called interpreter which checks every statement in the code 1 by 1 hence its easy to detect errrors.
Borek said:
No.
Debugger. Interpreter is something completely different.
Several years ago (about 20) I had an application that could disassemble an executable (.exe file) and display assembly code. If you understood assembly code, you could in theory understand what the executable was doing and how it was doing it, but this is a long way from displaying the source code in C or C++ or whatever language the executable program was written in.
Programs and DLLS that are written in languages supported by the .NET Framework can be disassembled and displayed in a number of languages, including IL (intermediate language, similar to an assembly language), C#, VB, Delphi, and others. This is pretty close to being able to see the source code for the program or DLL.
Yes, a debugger, not an interpreter, is what the book you were reading was describing. With a debugger you can set a breakpoint at a particular statement, and then single-step through the statements that follow, noting the values of variables at each step. Modern debuggers have lots of features.
An interpreter is one of three kinds of program translaters, with the others being compilers and assemblers.
An interpreter translates one statement in your source code into machine code, and then executes it, and continues through your program in this way.
A compiler translates your source code into machine code all at once. Another program, the linker, brings in the necessary addresses in library files so that your program can do input, output, and other useful things. The linker takes the object code produced by the compiler, and adds the necessary machine code, to produce an executable.
An assembler is like a compiler, but works with source code written in some assembly language, instead of a higher-level language such as C, C++, Fortran, etc. An assembler translates assembly source code to machine code. Typically, a linker is also used to produce an executable.