Build a loopback client copy with TypeScript

Add the shared BLK, VROMFS, executable patch, and build packages. Preserve
typed fields and shared name tables when reading BLK data. Rewrite the
service endpoints in place so the original environment names remain
available to the client, then build the client copy.
This commit is contained in:
N0VAN0M4LY committed 2026-11-24 00:35:13 +08:00
1 parent 0117c02677
commit 5421268fbf
44 files changed
+1986 -1

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
/**
* Patch a copy of aces.exe with every definition under exe-patches/. When any patch cannot be
* applied, no executable is produced; the result lists the unavailable patches and the
* features they cover.
*/
import { applyWrites, describePlan, loadPatches, PeImage, planPatches, type PatchPlan } from '@wto/exepatch';
export interface ExecutableResult {
/** The patched executable, or null when some patch was unavailable. */
readonly executable: Uint8Array | null;
readonly plan: PatchPlan;
readonly description: string;
}
export function patchExecutable(stockExecutable: Uint8Array, patchesRoot: string): ExecutableResult {
const plan = planPatches(new PeImage(stockExecutable), loadPatches(patchesRoot));
const executable = plan.failures.length ? null : applyWrites(stockExecutable, plan.writes);
return { executable, plan, description: describePlan(plan) };
}