3

Does anyone know how to get the GUID from a PDB file?

I'm using Microsoft's Debug Interface Access SDK

http://msdn.microsoft.com/en-us/library/f0756hat.aspx

and getting E_PDB_INVALID_SIG when passing in the GUID i expect when trying to load the PDB.

I'd just like to know the GUID of the PDB so I can be certain that it's mismatching and not just a PDB that's perhaps corrupted somehow.

Is there a tool that can do this? I've tried dia2dump and dumpbin, but with no joy...

Many thanks,

thoughton.

Dylan Corriveau
  • 2,561
  • 4
  • 29
  • 36
thoughton
  • 511
  • 1
  • 5
  • 10

3 Answers3

6

There is a Code Project tool called PDB Inspector that should be able to help you. Or if you need to do this programatically essentially you call:

IDiaDataSource::LoadDataFromPdb
IDiaDataSource::openSession
IDiaSession::get_global_scope
IDiaSymbol::get_guid
David Duponchel
  • 3,959
  • 3
  • 28
  • 36
Paul Arnold
  • 439
  • 3
  • 7
2

I would use the dbghelp symbol APIs. If all you want is information about the PDB, you can use chkmatch on archive.org, or heck, just load the dll/exe into WinDbg and use !sym noisy, !lmi or !chksym.

Fixing the PDB to match is a different story! chkmatch can do some of the work, but cannot make age differences match, it only can do timestamps and GUID signatures.

Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
pj4533
  • 1,701
  • 4
  • 17
  • 38
2

an introduction to DIA and its relation to DbgHelp along with a C++ sample. Which is basically the article I wrote after the one mentioned by Paul Arnold.

Simon Mourier
  • 132,049
  • 21
  • 248
  • 298
mox
  • 6,084
  • 2
  • 23
  • 35