- Make the authorization gate inspect the same selector record consumed by read handlers. - Retain native 0x0203 rejection for both opcode 0x21 and 0x23.
26 lines
919 B
Docker
26 lines
919 B
Docker
# syntax=docker/dockerfile:1
|
|
FROM --platform=$BUILDPLATFORM python:3.12-slim AS patcher
|
|
|
|
COPY bin/towercore-linux-mips64le /towercore
|
|
RUN python - <<'PY'
|
|
from pathlib import Path
|
|
|
|
path = Path("/towercore")
|
|
data = bytearray(path.read_bytes())
|
|
patches = (
|
|
(0x292E8, bytes.fromhex("a8 01 b7 93"), bytes.fromhex("9c 01 b7 93")),
|
|
(0x292F0, bytes.fromhex("b0 01 a5 8f"), bytes.fromhex("a4 01 a5 8f")),
|
|
(0x292FC, bytes.fromhex("ac 01 a4 8f"), bytes.fromhex("a0 01 a4 8f")),
|
|
(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()}")
|
|
data[offset : offset + len(original)] = replacement
|
|
path.write_bytes(data)
|
|
PY
|
|
|
|
FROM towercore:final-mips64le
|
|
COPY --from=patcher /towercore /towercore
|