From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11040 invoked by alias); 19 Jul 2007 03:10:13 -0000 Received: (qmail 11032 invoked by uid 22791); 19 Jul 2007 03:10:13 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 19 Jul 2007 03:10:11 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id DA9FE982C3; Thu, 19 Jul 2007 03:10:10 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id B8679982A3; Thu, 19 Jul 2007 03:10:10 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1IBMP2-0003aB-UE; Wed, 18 Jul 2007 23:10:08 -0400 Date: Thu, 19 Jul 2007 05:26:00 -0000 From: Daniel Jacobowitz To: Nate Eldredge Cc: gdb@sourceware.org Subject: Re: Add to symbol table for reverse engineering? Message-ID: <20070719031008.GB13744@caradoc.them.org> Mail-Followup-To: Nate Eldredge , gdb@sourceware.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-07/txt/msg00149.txt.bz2 On Wed, Jul 18, 2007 at 02:56:39PM -0700, Nate Eldredge wrote: > 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 ". Is there any way to do this? I didn't see such > a thing in the manual. Not using GDB. But you can probably do it with objcopy on the binary. -- Daniel Jacobowitz CodeSourcery