#!/usr/bin/env python3 """Side-by-side dword dump at named anchor addresses for both canary and ours.""" import struct, os here = os.path.dirname(os.path.abspath(__file__)) canary = open(os.path.join(here, "canary-v80.bin"), "rb").read() ours = open(os.path.join(here, "ours-v80.bin"), "rb").read() V80 = 0x80000000 def dump(addr, n=16, label=""): off = addr - V80 print(f"=== {addr:#010x} {label} ===") for j in range(n): a = addr + j*4 c = struct.unpack_from(">I", canary, off + j*4)[0] o = struct.unpack_from(">I", ours, off + j*4)[0] mark = " " if c == o else "DIFF" print(f" {a:#010x} canary={c:#010x} ours={o:#010x} {mark}") print() for a, n, lbl in [ (0x828F4070, 32, "0x15e4 worker singleton"), (0x828F4838, 32, "audit-023 listener struct"), (0x828F3D08, 16, "0x100c dispatcher"), (0x828F3EC0, 16, "0x1004 dispatcher"), (0x828F48B0, 24, "audit-024A singleton-pool start"), (0x828A3230, 16, "audio buffer-completion semaphore"), (0x828A3254, 12, "audit-025 audio wait target"), (0x82006CF4, 8, "audit-025 audio_system vtable"), (0x828A6900, 24, "0x828a0000 page diff cluster"), ]: dump(a, n, lbl)