Re: Getting source file from the object file



Richard Tobin wrote:

In article
<58bb918e-5b7f-476b-8c76-2148cc496e5e@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
user923005 <dcorbit@xxxxxxxxx> wrote:

Now, it is probably impossible to decompile 100%, because it has been
shown to be equivalent to the "does the turing machine halt?" problem.

What?

Obviously decompilation is impossible in a sense, because different
source programs can produce the same object file.

Equally obviously, it is theoretically possible to find a source
program which produces that code by enumerating all the source
programs and compiling them until we find one which produces the
desired object file. (Assuming of course that the object file really
is the result of compiling a source file.)

Nitpick: this assumes that the object code depends /only/ on the source
code, and not (say) on the user that compiled it, or the time it was
compiled, or the IP address of the machine it was compiled on -- all of
which /might/ be left, as provenance, in the object code.

I agree that decompilation is not a halting-problem issue. On the other
hand, we might want a slightly faster algorithm than blind search ...

--
RIP Ian Carr, 21-Apr-1933 -- 25-Feb-2009 /Out of the Long Dark/

Hewlett-Packard Limited registered office: Cain Road, Bracknell,
registered no: 690597 England Berks RG12 1HN

.



Relevant Pages

  • Re: Getting source file from the object file
    ... shown to be equivalent to the "does the turing machine halt?" ... Obviously decompilation is impossible in a sense, ... source programs can produce the same object file. ... programs and compiling them until we find one which produces the ...
    (comp.lang.c)
  • Re: Number of Objects in Static Link Library
    ... Up until this time, I've generated the libraries from object files that each represent a related group of functions and their data. ... The end result is that if a symbol in the object file is referenced, the entire object file is dragged in, even if just one function is referenced. ... With most linkers, the minimum amount that can normally be pulled in is one "module" or "translation unit". ... This normally corresponds to a single .o file that comes from either compiling a .c file or assembling an assembly-language file. ...
    (comp.unix.programmer)
  • Re: Driver linking error(symbols already defined), please help thi
    ... Compiling - shimmer.rc for i386 ... ning treated as error - no object file generated ... IST_ENTRY': macro redefinition ...
    (microsoft.public.development.device.drivers)
  • Re: Driver linking error(symbols already defined), please help thi
    ... Well, the fact that you're getting a macro redefinition error suggests to me that you might be trying to include 2 mutually incompatible headers. ... Compiling - shimmer.rc for i386 ... ning treated as error - no object file generated ...
    (microsoft.public.development.device.drivers)
  • Re: [SLE] Does GPL allow a company to say "Pay and Ill give you the program/sourcecode"?
    ... it becomes a derivative work. ... If the work during execution displays ... that uses the Library", as object code and/or source code, so that the user ... "If such an object file uses only numerical parameters, ...
    (SuSE)