feat: add MetalSharp Wine EAC Linux substrate - #397
Merged
Conversation
added 9 commits
August 10, 2026 04:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add the requested per-game EAC launch surface without changing the proven MetalSharp Wine 11.5 substrate contract. The card toggle remains explicit, per-game, and opt-in; it affects only the next MetalSharp Wine launch.
Changes
src/anticheat/linux_substrate.c; its per-launch maps path follows the app-specific substrate log directory./eac/statusand/eac/toggleroutes with atomic per-app state at~/.metalsharp/sharp-library/eac/<appid>.json.eac_exe_namesalongside normalexe_namesso the toggle selects each game's existing protected launcher only when enabled. Turning the toggle off emits no EAC environment and uses the normal rule path.Game/start_protected_game.exewhen EAC is enabled; all launch-time protected-executable rename/copy/restore bypass code is removed.~/.metalsharp/runtime/eac/with an atomic pair replacement and idempotent SHA refresh.sharp-library.PR Readiness (MANDATORY)
/Users/...paths introducedconfigs/mtsp-rules.tomlor DLL maps changedCMakeLists.txt,Cargo.toml,package.json,package-lock.json) in sync if version bumpedLocal toolchain
cargo fmt --all -- --checkcargo clippy --all-targets -- -D warningscargo build --releasecargo test— 762 passedpython3 tools/ci/validate-rules-toml.py— 734 overrides validBUILD_TESTS=ON; EAC substrate and ELF symbol-image targets builttools/bundles/verify-native-shims.sh --eac-only app/native— clean-build EAC contract passed (real x86_64 Mach-O substrate and x86-64 ELF image)ctest --test-dir build-native --output-on-failure -E '^(metal_device|dxbc|format_translation|phase17)$'— 27/27 passedtools/package/prepare-native-placeholders.sh— EAC artifacts are never replaced by placeholdersmetalsharp-scripts-tools.tar.zstpassedtools/bundles/verify-bundles.sh, including EAC type/architecture checkspython3 -B tools/ci/verify-dmg-workflow.pypython3 -B -m py_compilefor updater/bundle/workflow helperstools/ci/shellcheck.shnpm run buildgit diff --checkTest notes
Real test subject: Elden Ring on the external Steam library, launched explicitly from its real
Game/Start_protected_game.exepath. The proof used only the exact installed MetalSharp Wine 11.5 executable, not GPTK, VKMT, another Wine build, Steam auto-run, or a vendor-module replacement.Proof command:
python3 tools/anticheat/run_eac_proof.py --game-dir '/Volumes/AverySSD/SteamLibrary/steamapps/common/ELDEN RING/Game' --timeout 30Latest direct proof after rebuilding the substrate:
ok: true, proof levelreal_eac_linux_module_relocated_initialized_exported.4fdb6412....linux64, received CDN response 200, and logged Wine 11.5.a,b,c, anddresolved;EAC_PROOF export_a_success=1recorded.e621bf88dd07872b391198aee50bf1503fe18d43b7a9c0183fa23075efc61395.6a75af0317120099d0dd5a88e1d6d0be55f030e48d104015b7763261b3184276.d8c1008d0ddf70287023c9d4b16840fb0dd4039ae055bff0a10a400f1ebb9886.residualWineProcesses: []after the enforced 30-second termination and exact wineserver/helper cleanup.The launch proof intentionally reports
protectedGameTransitionObserved: falseandonlineSessionObserved: false: it proves the real EAC module load/relocation/constructor/export surface through MetalSharp Wine 11.5 -> macOS, but does not claim an online session or protected-game handoff without a live Steam user.Card-toggle integration probe (no game launch):
/eac/statusreportedavailable: true,enabled: falsebefore the toggle./eac/togglechanged one temporary app id toactive: true; disabling it restoredactive: false.pipeline=d3dmetalresolved topipeline: m12, reportedEAC_SUBSTRATE: true, and includedDYLD_INSERT_LIBRARIES,METALSHARP_EAC_SUBSTRATE_LIBC,METALSHARP_EAC_SUBSTRATE_LOG,METALSHARP_EAC_SUBSTRATE_MAPS, andMETALSHARP_EAC_MODULE_DUMP.Install/update/migration checks (no game launch):
EAC SubstrateafterScripts and Tools; the installer requires both archive entries and rejects invalid/ARM-only artifacts.Risk and rollback
The EAC substrate is opt-in and not attached to ordinary launches or Steam auto-run. It does not modify the protected EAC binary, rename/copy game executables, spoof identity exports, or use GPTK. The updater keeps the old app at a temporary rollback path until the new bundle verifies; migration retains user settings and EAC toggle JSON while rebuilding the deleted runtime tree. Revert
4ca8aa44to remove the per-game rule/launcher-selection surface,775e00ddandf5b5580cto remove install/update/migration hardening,dd9dfb28to remove the card toggle and launch integration, and7217f8fcto remove the substrate implementation.