[vox-tech] advanced gdb question

vox-tech@lists.lugod.org vox-tech@lists.lugod.org
Tue, 18 Jun 2002 18:14:32 -0400


On Fri, Jun 14, 2002 at 08:46:44PM -0700, Charles Polisher wrote:
> Peter Jay Salzman writes:
> > but what if you don't?  or rather, what if you can't compile with -g?

  if you "don't [compile with -g]" you recompile with -g.
  if you "can't [compile with -g]" you don't have source and shouldn't 
be trying to debugging the program at all.  so you submit a bug report to
the vendor of the commercial software you are using and if they don't fix
it you switch to something else or write your own program that does the
same thing.  :)


> What you're looking for is a decompiler, such as the
> one described in Cifuentes, but they're scarce as
> hen's teeth:

I think there are a few possible reasons why disassemblers are painful
and decompilers don't exist...

- in the software world "reverse engineering" has been deemed evil by 
  the big software houses of the world and is against the rules of 
  most commercial software licenses.

- some of us in an source code available world.  if you have the source
  code you wouldn't want to disassemble anything unless maybe you are 
  looking for bugs in the assembler (because the compiler toolchain
  spits out assembly code it's simple to see bugs in that :)

- if you have a big blob of compiled code and no source, it is almost
  always easier to just write replacement code to do what the blob 
  does, then to painfully reconstruct the program from assembly.

- _so_ much useful information is lost in the compilation process
  like comments and variable names, imagine taking something as
  trivial as the gzip command, strip all comments and change all
  variables to useless names... 'v1', 'v2', 'v3'.  One could spend
  weeks trying to convert that into something understandable.