4

I have .pdb file, downloaded from MS symbols server. I need to fetch list of symbols (functions, arguments, anything it has). There is a tool on CodeProject, but it only reports modules. There is DbgHelp API, but it only could be attcahed to running process. How can I read .pdb file offline?

user996142
  • 2,753
  • 3
  • 29
  • 48
  • PDB (Program DataBase) maps addresses to symbols. It does not contain any symbols, functions, variables, etc.). What are you really trying to achieve? – IInspectable May 17 '16 at 07:26
  • I have ``.dll.`` By reading its PE headers I can get list of exported symbols (functions). But PDB may contain information about not exprted functions (and their line numbers of course), their parameters etc. I want to read this information – user996142 May 17 '16 at 10:01
  • Line numbers are meaningless unless you have the source code. And if you do, why do you need to reverse engineer the binary? You can use the [Debug Help Library](https://msdn.microsoft.com/en-us/library/windows/desktop/ms679309.aspx) to read certain information from [Symbol Files](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363368.aspx). – IInspectable May 17 '16 at 14:23
  • 1
    https://stackoverflow.com/q/2040132/67824 – Ohad Schneider Jan 30 '20 at 15:08
  • Does this answer your question? [Reading a .pdb file](https://stackoverflow.com/questions/2040132/reading-a-pdb-file) – StayOnTarget Aug 26 '20 at 17:45

2 Answers2

3

Good News for anyone still looking,

The information you seek is now open source!

https://github.com/Microsoft/microsoft-pdb

Some real interesting stuff there. Like this pdbdump.cpp file, with its dumpPublics function or its main flow controls. Good documentation too

Frison Alexander
  • 3,228
  • 2
  • 29
  • 32
3

You can also use Visual Studio's Dia2Dump sample program to dump human-readable output from a PDB file, including its public symbols.

Be sure to build it as a 32-bit application though, or you might run into some problems with it. (See dia2dump: CoCreateInstance failed - HRESULT = 80040154)

Cazra
  • 123
  • 9