"""Measure ARM64 UEFI reproducibility in independent clean copies and caches.""" from pathlib import Path import datetime import hashlib import json import os import re import shutil import struct import subprocess import tempfile ROOT=Path.cwd() out=Path(tempfile.mkdtemp(prefix='K2485-uefi-reproducibility-',dir='reports/os-implementation')) def art(p):return dict(path=str(p),sha256=hashlib.sha256(Path(p).read_bytes()).hexdigest()) def read(p):return json.loads(Path(p).read_bytes()) def pe(data,zero_timestamp=False): if len(data)<64 or data[:2]!=b'MZ':raise ValueError('DOS header') at=struct.unpack_from('len(data):raise ValueError('bounded PE headers') if struct.unpack_from('len(data):raise ValueError('section outside file') if any(offset