platinoob_
platinoob_

Reputation: 161

Ghidra : unable to find PDB and Couldn't find type info structure

I downloaded Ghidra about a week ago(I am new to reverse engineering), I did what the tutorial video from Ghidra official site was showing, I made a simple C++ program to Visual Studio, the program has an infinity while(while(1)) that prints "Hello World!" to the screen(std::cout << "Hello World!";). I used Ghidra to disassemble that program as the person at the tutorial did it, but I am getting errors.

The errors :

PDB> ERROR: Unable to locate the DIA SDK. It is required to load PDB files.
* See docs/README_PDB.html for DLL registration instructions.


PDB> ERROR: Unable to locate the DIA SDK. It is required to load PDB files.
* See docs/README_PDB.html for DLL registration instructions.


Windows x86 PE RTTI Analyzer> Couldn't find type info structure.

I saw "README_PDB.html", I did what it said there to do, but still the errors, all of them, where there.

After some time I found out that the folder my .exe was stored had also a [name of my exe].pdb file and that when you choose analyzers there is an analyzer "PDB" and if you click on it will let you insert a path, tried to insert the path to the parent folder of that .pdb, but still nothing changed.

So : How can I make this work, please anyone, I am desperate

Upvotes: 1

Views: 5017

Answers (2)

j-ratz
j-ratz

Reputation: 21

The Microsoft Visual Studio 2019 msdia140.dll does not work with the Ghidra 9.1.2 pdb.exe. In order to build a new Ghidra pdb.exe that works with the Visual Studio 2019 msdia140.dll, you should use the Visual Studio project mentioned in the last bullet of inverzeio's response. $(GHIDRA)\Ghidra\Features\PDB\src\pdb\README.txt explains how to do that.

msdia140.dll must also be registered, as described in $(GHIDRA)\docs\README_PDB.html.

Upvotes: 0

inverzeio
inverzeio

Reputation: 555

Based on the error, it seems you are running ghidra on Windows, and the error is referred to at the README_PDB and load_pdb sites. Maybe the problem is with Visual Studio rather than ghidra.

Quoting from there:

In order for the native PDB parser to work on your Microsoft Windows machine, you must:

  1. Ensure you have msdia140.dll on your computer, and
  2. Register msdia140.dll in the Windows registry.

and:

  • The following instructions assume you have a 64-bit operating system. If you have rebuilt pdb.exe with a newer version of the DIA SDK you will need to register the corresponding version of the 64-bit DLL. The DIA SDK 14.0 corresponds to Visual Studio 2017.

  • The PDB format is known to change over time and may be incompatible with the current pdb.exe parser contained within Ghidra. A Microsoft Visual Studio project is provided within the Ghidra/Features/PDB/src/pdb directory which will allow you to rebuild it with a newer version of Visual Studio and DIA SDK.
  • Upvotes: 2

    Related Questions