#!/usr/bin/env python3 """crash_lookup.py: names the function at a crash offset in rac1_game.dll. Builds from kit 2026.10.14 on name crashes in rac1_log.txt themselves (rac1_game.sym); this is for older builds, or offsets from elsewhere. usage: python crash_lookup.py rac1_game.dll rac1_game.pdb 0x0c4f6807 [more offsets] The offset is the "Fault offset" of a Windows Application Error event (or a crash address minus the DLL's base). The .pdb must come from the same build as the .dll: the launcher deletes it after building, so rebuild by hand to keep it (see below). A player's crash can be looked up with your own build as long as both were built from the same kit version: the build is reproducible. To keep the .pdb, run the build yourself from the game's folder (games\\rac1): ..\\..\\toolchain\\python\\python.exe -u build.py --platform windows --iso "C:\\path\\disc.iso" --repo decomp --levels 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18 with ..\\..\\toolchain\\zig on PATH. It reads only the PDB's public symbols.""" import bisect, struct, sys def sections(dll): d = open(dll, "rb").read(4096) pe = struct.unpack_from("