#!/usr/bin/env python3 """Guarded Rocketship body callbacks and isolated probe evidence. Pure projections omit actual rider/audio/scene execution. The optional C probe executes copied370/374 instructions with synthetic body/rider/audio dependencies. """ from __future__ import annotations import argparse from dataclasses import dataclass import hashlib import json import math from pathlib import Path import re import struct from checkpoint_script_state import EXE_SHA256, find_case, read_va from pe_inspect import PE from rocketship import collect as rocket_collect BODIES = ( ('ceiling', 0x43eb70, 0x43ebaf, '501a86c0a0263c4087932081a1516579f3a1fdb985d244682997e012a242ad3f'), ('wall', 0x43e8d0, 0x43ea49, '5a3c59889ae6ee9c4d599c1116782c7a2e8213c1b2cad9c22f7b8b55c1ee32a2'), ('physics', 0x479d20, 0x47a32a, '5f4b05518bef5e5f0ecc3909ff0de0b43d2c7350c6beae0c4f797d3238a77fa1'), ('prevent_setter', 0x470f70, 0x470f83, 'b4963d8c48531af2870e39531aadfa8c1178542943ba51d8e3b57184256ee81a'), ('pair_getter', 0x471930, 0x471937, '72ca47ad0ea64edf6110c3a080c805774593958fb2d34dce19f63261a8242327'), ('pair_setter', 0x471940, 0x47194d, 'fa5b69a6074a26a0b8dd535d288645d2875039673639282571e029a60479cd37'), ('pair_notify_gate', 0x470bf0, 0x470c44, '5211f48735716c7a7426486f0b44ae9e93388546d825437edc6ef3f787e2aa8d'), ('dynamic_push_gate', 0x47b2eb, 0x47b3a5, '75e20325939a77354add4decb44bba860003d56914426dc1b98f6d52c08056cb'), ) TABLES = ((0x370, 0x43eb70), (0x374, 0x43e8d0), (0x378, 0x472750), (0x37c, 0x472970), (0x1e0, 0x471930), (0x1e4, 0x471940), (0x208, 0x4719d0), (0x20c, 0x4719e0), (0x210, 0x4719f0)) def collect(original: Path | str): report = rocket_collect(Path(original)) pe = PE(find_case(Path(original), 'Neutron.exe')) records = [] for name, start, end, expected in BODIES: digest = hashlib.sha256(read_va(pe, start, end-start)).hexdigest() if digest != expected: raise ValueError(f'Changed Rocketship body span {name}') records.append(dict(name=name, va=hex(start), file_offset=hex(pe.offset(start-pe.base)), length=end-start, sha256=digest)) for slot, target in TABLES: if struct.unpack('