Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-13-2005, 18:00
jonwil jonwil is offline
VIP
 
Join Date: Feb 2004
Posts: 387
Rept. Given: 2
Rept. Rcvd 21 Times in 9 Posts
Thanks Given: 2
Thanks Rcvd at 65 Times in 34 Posts
jonwil Reputation: 21
editing Debug Information Directory in a PE file

I have a PE file and a matching PDB file.
Problem is, the PE file was packed and somewhere the packer (or the unpacking process) has removed the debug information directory that points at the PDB file.
Which means that (AFAIK) IDA cant read the PDB file.

Is there a way to add back the debug information directory or to get IDA to load the PDB file without it?

I am sure the PDB file matches because I dumped some symbols from it with pdbdump and I can match them up to ASM in IDA.
But I dont want to have to manually input all these symbols if I dont have to
Reply With Quote
  #2  
Old 01-13-2005, 23:00
ee45678 ee45678 is offline
Friend
 
Join Date: Jan 2005
Posts: 27
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 0 Times in 0 Posts
ee45678 Reputation: 0
I don't think it should be a problem.

To test it I have just compiled a sample program to generate debug symbols and then stripped the executable of all the debug info (saved the PDB file for later use) and fed it to IDA.

And when asked to load the PDB file it complained about not having the dbghelp.dll file in IDA or Windows System directory. I located an appropriate dbghelp.dll file, copyied it to Windows System directory, rebooted just to be safe, then loaded the executable into IDA, and finally asked it to load the PDB file.

It reports as having loaded the symbols OK, reported as having loaded xxx number of symbols. But to be honest I don't see all the symbol names in the listed code :-(
Reply With Quote
  #3  
Old 01-14-2005, 21:16
Thims's Avatar
Thims Thims is offline
Friend
 
Join Date: Aug 2003
Location: Russia
Posts: 23
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
Thims Reputation: 0
I used dbghelp 4.1+ plugin (with manual PDB loading dialog): it worked flawless in a sutiation like yours.
Reply With Quote
  #4  
Old 01-15-2005, 02:07
gigaman gigaman is offline
Friend
 
Join Date: Jun 2002
Posts: 87
Rept. Given: 0
Rept. Rcvd 3 Times in 2 Posts
Thanks Given: 0
Thanks Rcvd at 14 Times in 11 Posts
gigaman Reputation: 4
Btw, there's a pdbplus plugin for IDA - it extracts more information than the default one.
Reply With Quote
  #5  
Old 01-15-2005, 02:37
ee45678 ee45678 is offline
Friend
 
Join Date: Jan 2005
Posts: 27
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 0 Times in 0 Posts
ee45678 Reputation: 0
Thims, I couldn't locate any IDA plugin with such a name while searching.

What is this dbghelp plugin, are you referreing to PDBPlus (1.9) or is it something else? And if it is something else then where might we find it?
Thanks

Last edited by ee45678; 01-15-2005 at 02:59.
Reply With Quote
  #6  
Old 01-15-2005, 05:46
Cobi Cobi is offline
Friend
 
Join Date: Sep 2004
Location: Germany
Posts: 55
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
Cobi Reputation: 0
Quote:
'PDB Plus' is a replacement PDB loader for IDA Pro 4.5 that uses newer versions of DBGHELP.DLL to get all local variable names into an IDA database, in addition to standard function/data names. In future this might be extended to define IDA structures and enumerations based on the data in the .PDB file.. but I need to find time first.
Quote:
... that uses newer versions of DBGHELP.DLL ...
You can also use PDB Plus.
Reply With Quote
  #7  
Old 01-15-2005, 06:18
dmownz
 
Posts: n/a
detours (hxxp://research.microsoft.com/sn/detours/) has some code for adding a section to an exe file. You should be able to modify it to reinsert the debug section pointing to the pdb.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add debug directory to an exe file? jonwil General Discussion 1 08-11-2006 03:05
Editing a .key file? peedizzle General Discussion 1 09-09-2004 00:49
How to convert map file to debug with eVS ? nahoda General Discussion 0 04-02-2004 17:15
Getting exe file information merrycosta General Discussion 1 01-24-2003 07:59


All times are GMT +8. The time now is 12:34.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )