"""Independently map selected LLVM strings through ELF64 PT_LOAD and file bytes. The producer golden supplies candidate coordinates. This checks those coordinates and encoded spans, not completeness of the native recognizer or runtime behavior. """ import hashlib import json import mmap from pathlib import Path import struct import sys if not __debug__: raise RuntimeError("Run this oracle without Python optimization") golden_path, output_path = map(Path, sys.argv[1:]) golden = json.loads(golden_path.read_text()) target = Path(golden["manifest"]["target"]) with target.open("rb") as handle: digest = hashlib.file_digest(handle, "sha256").hexdigest() assert digest == golden["manifest"]["target_sha256"] with mmap.mmap(handle.fileno(), 0, access=mmap.ACCESS_READ) as data: assert data[:6] == b"\x7fELF\x02\x01" assert struct.unpack_from("