import struct

with open('/tmp/amdgpu_installed.ko', 'rb') as f:
    data = f.read()

# Check if the old validation values are still present
old_lea = bytes.fromhex('49f7ffff')  # -(2231)
new_lea = bytes.fromhex('3bf6ffff')  # -(2501)
old_cmp = bytes.fromhex('a6f8ffff')  # -(1882)
new_cmp = bytes.fromhex('98f7ffff')  # -(2152)
orig_lea = bytes.fromhex('2ff8ffff')  # -(2001) original

print("Checking offsets in INSTALLED module:")
for offset in [0x330186, 0x33018D, 0x3301F9, 0x3301FE]:
    val = data[offset:offset+4]
    print(f"  0x{offset:x}: {val.hex()}", end="")
    if val == old_lea: print(" <-- OLD lea (2230)")
    elif val == new_lea: print(" <-- NEW lea (2500)")
    elif val == old_cmp: print(" <-- OLD cmp (2230)")
    elif val == new_cmp: print(" <-- NEW cmp (2500)")
    elif val == orig_lea: print(" <-- ORIGINAL lea (2000)")
    else: print(" <-- UNKNOWN")

print("\nSearching for old validation pattern (49f7ffff) in module:")
pos = 0
while True:
    idx = data.find(old_lea, pos)
    if idx == -1: break
    ctx = data[max(0,idx-8):idx+12].hex()
    print(f"  Found at 0x{idx:x}: {ctx}")
    pos = idx + 1