#!/usr/bin/env python3 """Test pinned real kernel pair routines with reviewed RAM and pointer graphs. The contract manifest pins the inspected source hashes without embedding Apple code. These are bounded instruction/leaf tests, not functioning kernel services. """ import argparse import hashlib import importlib.util import json import mmap import ctypes from pathlib import Path import random import struct import subprocess import sys import tempfile from capstone import Cs, CS_ARCH_ARM64, CS_MODE_ARM from differential import ROOT, MASK, State, native, reference, states from evidence import write_evidence def module(name, filename): spec = importlib.util.spec_from_file_location(name, ROOT / "dev" / filename) value = importlib.util.module_from_spec(spec) sys.modules[name] = value spec.loader.exec_module(value) return value leaves = module("stela_kernel_leaves", "kernel-leaves.py") pairs = module("stela_pair_differential", "pair-differential.py") def u64(data, offset, value): struct.pack_into("