Astaroth
Astaroth

Reputation: 2291

How can I know which PDB file contains type information for a given struct?

I'm translating some Windows header files to Delphi. In order to verify alignment of related C structs, I need to dump certain PDB files to see the associated type information. To do this, I tried to use PdbXtract, but this tool asks me to select a PDB file to inspect. How do I know which PDB file contains the desired struct definition?

Upvotes: 0

Views: 391

Answers (2)

Astaroth
Astaroth

Reputation: 2291

After investigating PDB files using hex editor, I figure out to know which PDB file contains the desired struct definition, by using a grep-like tool to search for PDB filenames containing the following regex pattern:

\x15\x00\x00\x80\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00_Struct_Name\x00

Upvotes: 0

Marc Sherman
Marc Sherman

Reputation: 2363

Use the strings.exe command line utility from SysInternals (now MS). I ran the following strings -s . | findstr /i critical_section in my symbols folder and got a lot of interesting output:

C:\debuggers-v6.12.2.633-x86\sym\verifier.pdb\8878279C450C4F4DA6B252A4B824B4981\verifier.pdb: _RTL_CRITICAL_SECTION C:\debuggers-v6.12.2.633-x86\sym\verifier.pdb\8878279C450C4F4DA6B252A4B824B4981\verifier.pdb: U_RTL_CRITICAL_SECTION@@ C:\debuggers-v6.12.2.633-x86\sym\wntdll.pdb\B193CACD9AB340E7BF3434EA1ABBE0482\wntdll.pdb: _RTL_CRITICAL_SECTION C:\debuggers-v6.12.2.633-x86\sym\wntdll.pdb\B193CACD9AB340E7BF3434EA1ABBE0482\wntdll.pdb: U_RTL_CRITICAL_SECTION@@ C:\debuggers-v6.12.2.633-x86\sym\wntdll.pdb\B193CACD9AB340E7BF3434EA1ABBE0482\wntdll.pdb: _RTL_CRITICAL_SECTION_DEBUG

Upvotes: 1

Related Questions