diff --git a/emulator/firmware-decomp/capture_triage.py b/emulator/firmware-decomp/capture_triage.py new file mode 100644 index 0000000..5f31ff1 --- /dev/null +++ b/emulator/firmware-decomp/capture_triage.py @@ -0,0 +1,79 @@ +"""Triage captures for battle-scene replay: for each capture, WITHOUT emulation, +parse the first slice of the wire log and report (a) embedded firmware build header, +(b) action census, (c) the init config string, (d) actions outside cap7's known-good +set. Cheap parse-only pass to pick the best replay candidates.""" +import sys, os, struct +sys.path.insert(0, r'C:\VWE\TeslaRel410\emulator\firmware-decomp') +sys.path.insert(0, r'C:\VWE\TeslaRel410\dpl3-revive\patha') +from vrboard import Assembler, A + +P = r'C:\VWE\TeslaRel410\dpl3-revive\patha' +BOOT = {int(A.hspcode), int(A.code860), int(A.data860), int(A.bss860), int(A.args860)} + +def parse_slice(path, slice_bytes=6_000_000): + with open(path, 'rb') as f: + data = f.read(slice_bytes) + start = None + for i in range(0, len(data) - 8): + w = struct.unpack_from('