Reverted experimental fix as game checks dll byte changes.

This commit is contained in:
2026-08-28 21:56:13 +02:00
parent e90cb788ba
commit c49c56bc97
10 changed files with 198 additions and 90 deletions

View File

@@ -1,9 +1,8 @@
"""Exact-profile selection for the post-login V21 world-transition helper."""
"""Retired V21 world-helper metadata and legacy status-file parsing."""
from __future__ import annotations
from dataclasses import dataclass
import hashlib
import json
import os
from pathlib import Path, PureWindowsPath
@@ -18,6 +17,12 @@ WORLD_FIX_HELPER_FILENAME = "pt-world-fix.exe"
WORLD_FIX_HELPER_SHA256 = (
"a7a17d29ef4c11f9603790f0110a4d6823b91cce03f70e466b7e0bdbd6fa313e"
)
WORLD_FIX_ENABLED = False
WORLD_FIX_DISABLED_REASON = (
"the experimental world fix is retired because PristonTale V21 periodically "
"checks the loaded game.dll code section; its five-byte map-loader detour "
"causes Module Code Sync Error / Banned Code 1"
)
WORLD_FIX_STATUS_PROTOCOL = 1
WORLD_FIX_STATUS_MAX_BYTES = 64 * 1024
@@ -29,7 +34,7 @@ class WorldFixStatusTarget:
class WorldFixError(RuntimeError):
"""Raised when an exact client needs a missing or untrusted helper."""
"""Raised when the retired helper is requested."""
def packaged_world_fix_helper() -> Path:
@@ -41,32 +46,10 @@ def resolve_world_fix_helper(
*,
helper: Path | None = None,
) -> Path | None:
"""Return the verified helper only for the exact publisher V21 pair."""
"""Reject the retired helper before it can alter publisher module memory."""
game = game_directory.expanduser().resolve(strict=False)
hashes = {
name: _sha256(game / name)
for name in V21_BINARY_HASHES
if (game / name).is_file()
}
if hashes != V21_BINARY_HASHES:
return None
requested = packaged_world_fix_helper() if helper is None else helper.expanduser()
if requested.is_symlink():
raise WorldFixError(
"the post-login world-fix helper must not be a symbolic link"
)
candidate = requested.resolve()
if not candidate.is_file():
raise WorldFixError(
"the verified post-login world-fix helper is missing; reinstall the launcher"
)
digest = _sha256(candidate)
if digest != WORLD_FIX_HELPER_SHA256:
raise WorldFixError(
"the post-login world-fix helper failed its launcher integrity check"
)
return candidate
_ = game_directory, helper
raise WorldFixError(WORLD_FIX_DISABLED_REASON)
def create_world_fix_status_target(
@@ -206,11 +189,3 @@ def _validated_status_event(value: object) -> dict[str, object] | None:
continue
clean[key] = item
return clean
def _sha256(path: Path) -> str:
digest = hashlib.sha256()
with path.open("rb") as handle:
for chunk in iter(lambda: handle.read(1024 * 1024), b""):
digest.update(chunk)
return digest.hexdigest()