rizin icon indicating copy to clipboard operation
rizin copied to clipboard

PDB parser loses information about certain method overrides

Open imag0r opened this issue 3 years ago • 1 comments

Environment information

  • Operating System: Windows 10 20H2
  • Cutter version: 2.0.0
  • Obtained from:
    • [ ] Built from source
    • [x] Downloaded release from Cutter website or GitHub
    • [ ] Distribution repository
  • File format: PE32 + PDB

Describe the bug When applying PDB information Cutter seems to ignore certain method overrides. They are correctly recognized by the MSDIA parser based tools - WinDBG, IDA, even Ghidra. For instance, build the following program (VS2019 project attached: Project1.zip)

#include <iostream>

class __declspec(novtable) ITest
{
public:
    virtual int Foo() const = 0;
};

class CTest1 : public ITest
{
public:
    virtual int Foo() const
    {
        std::cout << "hello from " << __FUNCTION__ << std::endl;
        return 0;
    }

    virtual int Bar() const = 0;
};

class CTest2 : public CTest1
{
public:
    virtual int Bar() const
    {
        std::cout << "hello from " << __FUNCTION__ << std::endl;
        return 1;
    }
};

int main()
{
    const auto inst = std::make_unique<CTest2>();
    inst->Foo();
    inst->Bar();
    return 0;
}

For some reason, Cutter is able to properly name CTest2::Foo, but not CTest2:Bar

To Reproduce

Steps to reproduce the behavior:

  1. Build the project from the attachment, or use the included pre-built binary
  2. Load the exe into Cutter, make sure that you indicate the PDB path
  3. Using the functions window try locating "Foo" and "Bar" methods

Expected behavior Both Foo and Bar methods are present

Current behavior Foo is there, but Bar is not image

For comparison, Ghidra's Symbol Tree shows both correctly: image

imag0r avatar Mar 30 '21 17:03 imag0r

@Basstorm could you please take a look at this issue then?

XVilka avatar Oct 09 '21 09:10 XVilka