Re: [SLUG] Reversing C Compilation

From: Jason Copenhaver (jcopenha@typedef.org)
Date: Mon Apr 06 2009 - 20:38:04 EDT


In general it's very hard to get back to the C code from any object file.
You can use objdump to dump the various function names and some symbol
information. Otherwise, you'll just have to disassemble it and read that.

On Mon, Apr 6, 2009 at 6:17 PM, Paul M Foster <paulf@quillandmouse.com>wrote:

> On Mon, Apr 06, 2009 at 03:50:07PM -0400, Paul Bransford wrote:
>
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Paul M Foster wrote:
> > | I've got a ELF .o (object) 32 bit file compiled under GCC (not
> > | stripped), and I'd like to look at the actual C code which created it.
> > | Anyone know of a way to run that object file through something to
> > | reconstruct the C code? (Seems like I should know this, but it escapes
> > | me.)
> > |
> > | Paul
> > |
> >
> > http://www.itee.uq.edu.au/~cristina/dcc.html>
> >
> > It won't be the same code that generated it, but the code given will
> > recompile back into the binary you have.
> >
> > If there are no symbols in the binary, you will get strange looking code
> > and variables will be named oddly. I haven't used this practically.
>
> This binary is not stripped, so all the symbols should be there.
> However, DCC is for Windows binaries. Sorry and thanks.
>
> Paul
>
> --
> Paul M. Foster
> -----------------------------------------------------------------------
> This list is provided as an unmoderated internet service by Networked
> Knowledge Systems (NKS). Views and opinions expressed in messages
> posted are those of the author and do not necessarily reflect the
> official policy or position of NKS or any of its employees.
>
>

-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:32:26 EDT