Closed jan-auer closed 6 years ago
Hmm, I thought I had a reason for doing this the long way. Is there a Microsoft tool that can confirm the intended byte order, either in the PDB or in the corresponding PE executable?
Sorry for not checking this earlier. Microsoft's GUIDs specify little endian representation of the fields indeed, which means your initial implementation was correct. dumpbin /headers electron.exe
showed the original GUID.
Surprisingly, llvm-pdbutil is buggy. I'll go ahead and put in a bug report there. Thanks for double-checking this!
The endianness of the
guid
inPDBInformation
seems to be off compared to llvm-pdbutil, specifically its first three fields:The problem seems to originate in manually parsing the UUID fields with platform-endianness here: https://github.com/willglynn/pdb/blob/7947bcc3cc1f8f7ab2952155f83ed1bd8dd0eb05/src/pdbi.rs#L159-L164
After changing this to
Uuid::from_bytes(buf.take(16)?)
, the output is correct. I'll submit a patch shortly, after running some more tests. I did not verify that llvm-pdbutil is correct in this case, but I'm assuming so foolishly 😄For testing, I was using the Electron v2.0.11 x64 PDB. You can obtain an archive here (sorry, it's rather large).