Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Nate Eldredge <neldredge@math.ucsd.edu>
To: gdb@sourceware.org
Subject: Add to symbol table for reverse engineering?
Date: Thu, 19 Jul 2007 03:09:00 -0000	[thread overview]
Message-ID: <Pine.GSO.4.64.0707181341040.15725@zeno.ucsd.edu> (raw)

Hi all,

I am trying to reverse engineer a stripped binary using gdb.  I wonder if 
there is a way to interactively add symbols as I go.  For example, suppose 
I discover that 0xdeadbeef is the address of a function that does "foo". 
Presumably the binary originally had an entry "foo = 0xdeadbeef" in its 
symbol table, which is now gone.  I would like to be able to "put it back" 
and use it with gdb's convenient symbol features.  For instance, if I come 
across a "call 0xdeadbeef" instruction elsewhere in the program, I would 
like the gdb disassembler to tag it as "call 0xdeadbeef <foo>".  Is there 
any way to do this?  I didn't see such a thing in the manual.

I know I can do:

set $foo = 0xdeadbeef


so that at least the address is saved, but gdb won't do the reverse 
translation in disassembly.

I suppose it is possible to keep an external symbol table which I load, 
but then I would have to have a separate file which I have to paste in 
stuff from gdb, and then reload it every time I add something new.

-- 

Nate Eldredge
neldredge@math.ucsd.edu


             reply	other threads:[~2007-07-18 21:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-19  3:09 Nate Eldredge [this message]
2007-07-19  5:26 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.64.0707181341040.15725@zeno.ucsd.edu \
    --to=neldredge@math.ucsd.edu \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox