"""Dump the PDB info stream so we know exactly which acclient.exe build matches our PDB GUID. The PDB header points to stream 1 ("PDB Info") which contains: u32 version, u32 signature(timestamp), u32 age, 16-byte GUID. Usage: py tools/pdb-extract/dump_pdb_info.py refs/acclient.pdb """ import struct import sys import datetime import uuid def _ceil_div(a, b): return (a + b - 1) // b def main(): if len(sys.argv) < 2: print("usage: dump_pdb_info.py ") sys.exit(1) pdb_path = sys.argv[1] with open(pdb_path, "rb") as f: data = f.read() magic = b"Microsoft C/C++ MSF 7.00\r\n\x1aDS\x00\x00\x00" assert data.startswith(magic), "not an MSF 7.00 PDB" block_size = struct.unpack_from(" linker timestamp UTC: {sig_dt.isoformat()}") print(f"age = {age}") print(f"GUID = {{{pdb_guid}}}") print() print("This is the GUID + age the matching acclient.exe must reference") print("in its CodeView entry. Find a binary whose linker timestamp") print(f"is around {sig_dt.strftime('%Y-%m-%d')}.") if __name__ == "__main__": main()