Add the executable patch engine and local archive compatibility

Keep patch definitions and dependencies separate from the patch engine.
Resolve all patches before writing, verify expected bytes, and refuse to
overwrite the input executable. Include a read-only check command for
comparing definitions with their assembly source.

Allow locally rebuilt script archives to load in the offline client.
Verify the patch against the 2.61.0.37 executable and confirm that the
patched copy remains readable as PE.
This commit is contained in:
N0VAN0M4LY committed 2026-11-23 13:32:36 +08:00
1 parent c9e10b0db7
commit 8fa50b7804
12 files changed
+701

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
"""Locate and apply the declared changes to aces.exe.
The patches themselves live as data under exe-patches/; this package is only the engine.
Order of work, and the reason for it: find every site and verify every original byte first
(plan), then write (apply). A site that is missing or ambiguous is reported, never guessed,
so a game update produces a list of unavailable patches and the features they cover rather
than a broken executable.
`authoring` and `assemble` are development-side only: they need a disassembler and an
assembler, and are imported explicitly rather than from here.
"""
from .apply import apply_writes, changed_ranges
from .definition import PatchDefinition, PatchEdit, load_patches
from .errors import DefinitionError, LocateError, PatchError, VerifyError
from .plan import PatchFailure, PatchPlan, PlannedWrite, plan_patches
__all__ = [
"DefinitionError",
"LocateError",
"PatchDefinition",
"PatchEdit",
"PatchError",
"PatchFailure",
"PatchPlan",
"PlannedWrite",
"VerifyError",
"apply_writes",
"changed_ranges",
"load_patches",
"plan_patches",
]