pdb icon indicating copy to clipboard operation
pdb copied to clipboard

Add support for small MSF file format

Open gtker opened this issue 1 year ago • 5 comments

Currently it's just a hard error.

The specific use case is writing a utility for assisting in decompiling applications compiled with Visual Studio C++ 6.0. Currently it seems the only other Rust option is to parse the output of various Windows-only PDB parser executables without source code available.

Let me know if example files are needed, and what they should contain.

gtker avatar Dec 22 '23 22:12 gtker

I'd also be interested into this, do you have any public test files in mind to write an implementation against? From reading the Wikipedia page(https://en.wikipedia.org/wiki/Program_database) It seems It's mostly just the header which is different, and the streams are the same.

jon-zu avatar Jan 22 '24 13:01 jon-zu

Storm.zip

This .pdb and associated .dll exhibits the error.

I think in reality everything compiled using Visual C++ 6.0 has this.

A portable version can be found here.

On windows you can call VC98\Bin\VCVARS32.BAT and then generate build files with Cmake like normal: cmake -S -B build_dir && cmake --build build_dir .

gtker avatar Jan 22 '24 14:01 gtker

I've been able to implement the Msf Trait for small/2.00 files. I'll try to make some test cases and then create a pull request.

jon-zu avatar Jan 29 '24 11:01 jon-zu

You can check it out here: https://github.com/jon-zu/pdb-rs/tree/jz/version2 I've tried It with resym, and It seems to work fine, but since It contains a few more patches from the Vector35 Fork and support for utf8 chars I'd probably need to split those up for a merge request.

jon-zu avatar Feb 02 '24 13:02 jon-zu

Hey @jon-zu, thanks for the work done on that! FYI, I merged your commits into resym's fork of the pdb crate and resym's master branch now includes those changes, so people should be able to open small MSF files with resym using your changes 😉

For pdb maintainers: the changes proposed by @jon-zu seem to be a good start, although some more work will be needed to fully support this version of the format. For example I get Unimplemented PDB feature: Unsupported symbol data format errors when trying to parse symbol data on some PDBs of mine.

ergrelet avatar Mar 08 '24 01:03 ergrelet