"""Read-only native flight symbol inventory; no attaching, invocation or file patching."""
import argparse,hashlib,json,pathlib,re
p=argparse.ArgumentParser();p.add_argument('image',type=pathlib.Path);p.add_argument('--output',type=pathlib.Path,required=True);a=p.parse_args()
raw=a.image.read_bytes();names=set()
for match in re.finditer(rb'[\x20-\x7e]{4,180}\x00',raw):
 value=match[0][:-1].decode('ascii')
 if re.search(r'heat|thermal|scoop|obscur|hyperdrive|hyperspace|orientation|angularvelocity',value,re.I) and re.fullmatch(r'[A-Za-z_?.@$0-9:<> ,~()\-]{4,180}',value):names.add(value)
a.output.parent.mkdir(parents=True,exist_ok=True);a.output.write_text(json.dumps({'sha256':hashlib.sha256(raw).hexdigest(),'scope':'Static symbol evidence only','symbols':sorted(names)},indent=2),encoding='utf-8')
print(json.dumps({'symbols':len(names),'candidates':[n for n in sorted(names) if re.search(r'heat|thermal|obscur|orientation',n,re.I)][:130]},indent=2))
