fix(towercore): align native selector gate

- Make the authorization gate inspect the same selector record consumed by read handlers.
- Retain native 0x0203 rejection for both opcode 0x21 and 0x23.
This commit is contained in:
TakuyaYagam1 committed 2026-11-29 16:02:45 +03:00
1 parent 3cd120414f
commit 500ed28038
1 file changed
+10 -6
+10 -6
View File
@@ -7,13 +7,17 @@ from pathlib import Path
path = Path("/towercore") path = Path("/towercore")
data = bytearray(path.read_bytes()) data = bytearray(path.read_bytes())
offset = 0x29324 patches = (
original = bytes.fromhex("03 00 55 10") (0x292E8, bytes.fromhex("a8 01 b7 93"), bytes.fromhex("9c 01 b7 93")),
replacement = bytes.fromhex("03 00 00 10") (0x292F0, bytes.fromhex("b0 01 a5 8f"), bytes.fromhex("a4 01 a5 8f")),
actual = bytes(data[offset : offset + len(original)]) (0x292FC, bytes.fromhex("ac 01 a4 8f"), bytes.fromhex("a0 01 a4 8f")),
if actual != original: (0x29324, bytes.fromhex("03 00 55 10"), bytes.fromhex("03 00 00 10")),
)
for offset, original, replacement in patches:
actual = bytes(data[offset : offset + len(original)])
if actual != original:
raise SystemExit(f"unexpected bytes at {offset:#x}: {actual.hex()}") raise SystemExit(f"unexpected bytes at {offset:#x}: {actual.hex()}")
data[offset : offset + len(original)] = replacement data[offset : offset + len(original)] = replacement
path.write_bytes(data) path.write_bytes(data)
PY PY