Skip to content

Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit

Add Support for CrossOver Preview 27.0.0.41069/20261006

NotProtonNot9580362e0f4e
diff --git a/app/Package.swift b/app/Package.swift
index 7721f66..bdbadb5 100644
--- a/app/Package.swift
+++ b/app/Package.swift
@@ -33,6 +33,11 @@ let package = Package(
.copy("Resources/detour64-fex.bin"),
.copy("Resources/detour2-cx26.bin"),
.copy("Resources/detour32-cx26.bin"),
+ .copy("Resources/detour2-41069.bin"),
+ .copy("Resources/detour32-41069.bin"),
+ .copy("Resources/detour2-fex-41069.bin"),
+ .copy("Resources/detour32-fex-41069.bin"),
+ .copy("Resources/detour64-fex-41069.bin"),
],
swiftSettings: [.swiftLanguageMode(.v6)]
),
diff --git a/app/Sources/NotProtonApp/Model/NtdllPatcher.swift b/app/Sources/NotProtonApp/Model/NtdllPatcher.swift
index a0ca5aa..f9477b4 100644
--- a/app/Sources/NotProtonApp/Model/NtdllPatcher.swift
+++ b/app/Sources/NotProtonApp/Model/NtdllPatcher.swift
@@ -169,6 +169,89 @@ enum NtdllPatcher {
imageBase: 0x1_8000_0000
),
],
+ "27.0.0.41069": [
+ NtdllPatch(
+ arch: .x86_64Windows,
+ payloadResource: "detour2-41069",
+ payloadSHA256: "660ea7c935620e620a45a46e552c0a3de9292e031bf93ef676968154d45e78d5",
+ caveRVA: 0x815e0,
+ payloadRVA: 0x815e0,
+ hooks: [
+ NtdllHook(rva: 0x52055,
+ stolen: [0x48, 0x83, 0xbc, 0x24, 0xf0, 0x00, 0x00, 0x00, 0x00]),
+ ],
+ caveSize: 2592,
+ cavePad: 0x00,
+ machine: 0x8664,
+ magic: 0x20b,
+ imageBase: 0x1_7000_0000
+ ),
+ NtdllPatch(
+ arch: .i386Windows,
+ payloadResource: "detour32-41069",
+ payloadSHA256: "3eaa5021add0c8e30e324d6b1a6392a32720f5f73596418a2086b7f8081eb1bd",
+ caveRVA: 0x7d1f0,
+ payloadRVA: 0x7d1f0,
+ hooks: [
+ NtdllHook(rva: 0x4d848, stolen: [0xf6, 0x45, 0xbc, 0x02, 0x75, 0x26]),
+ ],
+ caveSize: 3600,
+ cavePad: 0x00,
+ machine: 0x14c,
+ magic: 0x10b,
+ imageBase: 0x7bc0_0000
+ ),
+ ],
+ "27.0.0.41069-fex": [
+ NtdllPatch(
+ arch: .x86_64Windows,
+ payloadResource: "detour2-fex-41069",
+ payloadSHA256: "0084bba1d7399e749d918dba4f313f1dc1825d2a487f3169b469b57c5b161ca5",
+ caveRVA: 0xb5000,
+ payloadRVA: 0xb5000,
+ hooks: [
+ NtdllHook(rva: 0x34aae, stolen: [0x48, 0x8b, 0x84, 0x24, 0x10, 0x01, 0x00, 0x00]),
+ ],
+ caveSize: 0x1000,
+ cavePad: 0x00,
+ machine: 0x8664,
+ magic: 0x20b,
+ imageBase: 0x1_7000_0000,
+ placement: .section
+ ),
+ NtdllPatch(
+ arch: .i386Windows,
+ payloadResource: "detour32-fex-41069",
+ payloadSHA256: "6ff6c7289e639c4caad85c2670bfa849d9f36baa24152b6979896caede5e249b",
+ caveRVA: 0xa4000,
+ payloadRVA: 0xa4000,
+ hooks: [
+ NtdllHook(rva: 0x2ede2, stolen: [0x8b, 0x45, 0x14, 0xa8, 0x02]),
+ ],
+ caveSize: 0x1000,
+ cavePad: 0x00,
+ machine: 0x14c,
+ magic: 0x10b,
+ imageBase: 0x7bc0_0000,
+ placement: .section
+ ),
+ NtdllPatch(
+ arch: .aarch64Windows,
+ payloadResource: "detour64-fex-41069",
+ payloadSHA256: "b27484eaed592366ddd3a5b3c565c2dc05e8fa255fbd7e19d9d8eb619ff57c23",
+ caveRVA: 0xf3185,
+ payloadRVA: 0xf3190,
+ hooks: [
+ NtdllHook(rva: 0x48738, stolen: [0x1f, 0x20, 0x03, 0xd5]),
+ NtdllHook(rva: 0xa883c, stolen: [0x1f, 0x20, 0x03, 0xd5]),
+ ],
+ caveSize: 52859,
+ cavePad: 0xcc,
+ machine: 0xaa64,
+ magic: 0x20b,
+ imageBase: 0x1_8000_0000
+ ),
+ ],
]
static func patches(for build: RunnerBuild) -> [NtdllPatch] {
diff --git a/app/Sources/NotProtonApp/Model/PrefixTools.swift b/app/Sources/NotProtonApp/Model/PrefixTools.swift
index 1a4e4f2..5d15e5c 100644
--- a/app/Sources/NotProtonApp/Model/PrefixTools.swift
+++ b/app/Sources/NotProtonApp/Model/PrefixTools.swift
@@ -132,23 +132,23 @@ enum PrefixTools {
static func layout(runner: URL, flavor: CompatTool.Flavor = .fex) -> WineLayout {
let fm = FileManager.default
- let hosted = runner.appending(path: "CrossOver-Hosted Application")
+ let bin = runner.appending(path: "bin")
func executable(_ url: URL) -> Bool {
fm.isExecutableFile(atPath: url.path(percentEncoded: false))
}
let arm = runner.appending(path: "lib/wine/aarch64-unix")
let armLoader = arm.appending(path: "wine.app/Contents/MacOS/wine")
- let armServer = hosted.appending(path: "wineserver-arm64")
+ let armServer = bin.appending(path: "wineserver-arm64")
if flavor == .fex, executable(armLoader), executable(armServer) {
return WineLayout(loader: armLoader, server: armServer, unixDir: arm)
}
let unix = runner.appending(path: "lib/wine/x86_64-unix")
- let server = hosted.appending(path: "wineserver")
+ let server = bin.appending(path: "wineserver")
return WineLayout(
loader: unix.appending(path: "wine"),
- server: executable(server) ? server : hosted.appending(path: "wineserver-x86"),
+ server: executable(server) ? server : bin.appending(path: "wineserver-x86"),
unixDir: unix
)
}
diff --git a/app/Sources/NotProtonApp/Model/SupportedRunner.swift b/app/Sources/NotProtonApp/Model/SupportedRunner.swift
index 22b6a8e..7ad77ca 100644
--- a/app/Sources/NotProtonApp/Model/SupportedRunner.swift
+++ b/app/Sources/NotProtonApp/Model/SupportedRunner.swift
@@ -71,13 +71,14 @@ enum SupportedRunners {
// First entry is what windows-only games get when Steam has no mapping.
static let toolPreference = [
- legacyToolName, "notproton-fex", "notproton-fex-rosetta", "notproton-preview", "notproton-26.3",
+ legacyToolName, "notproton-fex", "notproton-fex-rosetta", "notproton-preview",
+ "notproton-fex-41069", "notproton-fex-rosetta-41069", "notproton-preview-41069", "notproton-26.3",
]
static let legacyToolName = "notproton"
// The only builds that can own the 'notproton' tool name.
- static let legacyHolders = ["27.0.0.40921-fex", "27.0.0.40921"]
+ static let legacyHolders = ["27.0.0.40921-fex", "27.0.0.40921", "27.0.0.41069-fex", "27.0.0.41069"]
enum LegacyHolder: Equatable, Sendable {
case preferred
@@ -140,7 +141,7 @@ enum SupportedRunners {
.i386Windows: "25bfde1f50ee96485763968ef10b9d9ad35e38214232f17ebdc009b098af44a0",
],
tools: [
- CompatTool(name: "notproton-preview", flavor: .rosetta, display: "CrossOver Preview - X86 Build (Rosetta)", short: "x86 Preview (Rosetta)"),
+ CompatTool(name: "notproton-preview", flavor: .rosetta, display: "CrossOver 20260821 (X86) - Rosetta", short: "20260821 (X86) - Rosetta"),
]
),
RunnerBuild(
@@ -159,8 +160,45 @@ enum SupportedRunners {
.aarch64Windows: "f40810193a5ef2520774288f354a8604f5ba91828315f643b3ee6688b873dc3f",
],
tools: [
- CompatTool(name: "notproton-fex", flavor: .fex, display: "CrossOver Preview - ARM64 Build (FEX)", short: "ARM64 Preview (FEX)"),
- CompatTool(name: "notproton-fex-rosetta", flavor: .rosetta, display: "CrossOver Preview - ARM64 Build (Rosetta)", short: "ARM64 Preview (Rosetta)"),
+ CompatTool(name: "notproton-fex", flavor: .fex, display: "CrossOver 20260821 (ARM64) - FEX", short: "20260821 (ARM64) - FEX"),
+ CompatTool(name: "notproton-fex-rosetta", flavor: .rosetta, display: "CrossOver 20260821 (ARM64) - Rosetta", short: "20260821 (ARM64) - Rosetta"),
+ ]
+ ),
+ RunnerBuild(
+ bundleVersion: "27.0.0.41069",
+ releaseVersion: "20261006",
+ flavor: nil,
+ loaderSHA256: "8286bfd0c6d2ae337e11784926d371a9f7ed7e8da870bd2f435c2bce8eb3c148",
+ cleanNtdll: [
+ .x86_64Windows: "5b388fd48823e905616432fba627eb48f68dc14383963bb213d55db3f691b1b9",
+ .i386Windows: "e7da2a712870222942ef27a80b3bf4fa70fc8545dd1a64bdc7f2fa24a38debc3",
+ ],
+ patchedNtdll: [
+ .x86_64Windows: "9569625387cf179d306b004c556273e2ec15811b2cfd51f21d078e2a0aa06f7f",
+ .i386Windows: "0d8e3ebb57b3173f675eef5e3a0950052c592efa10a7a10193b0beb811b55ea5",
+ ],
+ tools: [
+ CompatTool(name: "notproton-preview-41069", flavor: .rosetta, display: "CrossOver 20261006 (X86) - Rosetta", short: "20261006 (X86) - Rosetta"),
+ ]
+ ),
+ RunnerBuild(
+ bundleVersion: "27.0.0.41069",
+ releaseVersion: "20261006",
+ flavor: "fex",
+ loaderSHA256: "ef2b9a0ad185d8caa2960a97c135a75b8b85ca62425599e35cf672f787fba64c",
+ cleanNtdll: [
+ .x86_64Windows: "1b02dcf6ad9d9490870f1127a421c4c0d1471c65ec1574e1e84c05d69801ac7e",
+ .i386Windows: "66b1a244a611795c59a93a9491d17f36c98cd8db9be495004a37864e0e5ed4a5",
+ .aarch64Windows: "77ca83b2e1a3a1242f9d2d8868328262b2bcfc3f59bacf8b9389ea7e797ea852",
+ ],
+ patchedNtdll: [
+ .x86_64Windows: "7548abd874656f6a6455e7fac659020ed755d92f4e1929a33097bbde964699f5",
+ .i386Windows: "e16b0199db721a08201b1512476b9eff255624d2faf3696fa57ff74b1a54be5c",
+ .aarch64Windows: "7623c0b33350f511b431d39c7ec0c0d4f5def4183acef0eee5d4a5c694898956",
+ ],
+ tools: [
+ CompatTool(name: "notproton-fex-41069", flavor: .fex, display: "CrossOver 20261006 (ARM64) - FEX", short: "20261006 (ARM64) - FEX"),
+ CompatTool(name: "notproton-fex-rosetta-41069", flavor: .rosetta, display: "CrossOver 20261006 (ARM64) - Rosetta", short: "20261006 (ARM64) - Rosetta"),
]
),
]
diff --git a/app/Sources/NotProtonApp/Resources/detour2-41069.bin b/app/Sources/NotProtonApp/Resources/detour2-41069.bin
new file mode 100755
index 0000000..4727e9a
Binary files /dev/null and b/app/Sources/NotProtonApp/Resources/detour2-41069.bin differ
diff --git a/app/Sources/NotProtonApp/Resources/detour2-fex-41069.bin b/app/Sources/NotProtonApp/Resources/detour2-fex-41069.bin
new file mode 100755
index 0000000..7d21f63
Binary files /dev/null and b/app/Sources/NotProtonApp/Resources/detour2-fex-41069.bin differ
diff --git a/app/Sources/NotProtonApp/Resources/detour32-41069.bin b/app/Sources/NotProtonApp/Resources/detour32-41069.bin
new file mode 100755
index 0000000..7f4b541
Binary files /dev/null and b/app/Sources/NotProtonApp/Resources/detour32-41069.bin differ
diff --git a/app/Sources/NotProtonApp/Resources/detour32-fex-41069.bin b/app/Sources/NotProtonApp/Resources/detour32-fex-41069.bin
new file mode 100755
index 0000000..c64a262
Binary files /dev/null and b/app/Sources/NotProtonApp/Resources/detour32-fex-41069.bin differ
diff --git a/app/Sources/NotProtonApp/Resources/detour64-fex-41069.bin b/app/Sources/NotProtonApp/Resources/detour64-fex-41069.bin
new file mode 100755
index 0000000..ec84646
Binary files /dev/null and b/app/Sources/NotProtonApp/Resources/detour64-fex-41069.bin differ
diff --git a/app/Tests/NotProtonAppTests/PrefixToolsTests.swift b/app/Tests/NotProtonAppTests/PrefixToolsTests.swift
index b083830..d2a4a1b 100644
--- a/app/Tests/NotProtonAppTests/PrefixToolsTests.swift
+++ b/app/Tests/NotProtonAppTests/PrefixToolsTests.swift
@@ -56,7 +56,7 @@ struct PrefixToolsTests {
.appending(path: "notproton-layout-\(UUID().uuidString)")
defer { try? fm.removeItem(at: runner) }
- for path in ["lib/wine/\(arch)/\(loaderTail)", "CrossOver-Hosted Application/\(serverName)"] {
+ for path in ["lib/wine/\(arch)/\(loaderTail)", "bin/\(serverName)"] {
let file = runner.appending(path: path)
try fm.createDirectory(
at: file.deletingLastPathComponent(), withIntermediateDirectories: true)
@@ -67,7 +67,7 @@ struct PrefixToolsTests {
let layout = PrefixTools.layout(runner: runner)
#expect(layout.loader == runner.appending(path: "lib/wine/\(arch)/\(loaderTail)"))
- #expect(layout.server == runner.appending(path: "CrossOver-Hosted Application/\(serverName)"))
+ #expect(layout.server == runner.appending(path: "bin/\(serverName)"))
// The shapes the script reaches for, which is what would drift independently.
#expect(source.contains("$wine_unix/\(loaderTail)"))
@@ -296,7 +296,7 @@ struct PrefixToolsTests {
defer { try? fm.removeItem(at: runner) }
for path in [
"lib/wine/aarch64-unix/wine.app/Contents/MacOS/wine", "lib/wine/x86_64-unix/wine",
- "CrossOver-Hosted Application/wineserver-arm64", "CrossOver-Hosted Application/wineserver",
+ "bin/wineserver-arm64", "bin/wineserver",
] {
let file = runner.appending(path: path)
try fm.createDirectory(at: file.deletingLastPathComponent(), withIntermediateDirectories: true)
diff --git a/app/Tests/NotProtonAppTests/PrefixesModelTests.swift b/app/Tests/NotProtonAppTests/PrefixesModelTests.swift
index defb517..600d696 100644
--- a/app/Tests/NotProtonAppTests/PrefixesModelTests.swift
+++ b/app/Tests/NotProtonAppTests/PrefixesModelTests.swift
@@ -156,8 +156,8 @@ struct PrefixesModelTests {
func shown(_ appID: String) throws -> String? {
model.lastTool(try #require(model.prefixes.first { $0.appID == appID }))
}
- #expect(try shown("1574480") == "ARM64 Preview (FEX)")
- #expect(try shown("253750") == "ARM64 Preview (Rosetta)")
+ #expect(try shown("1574480") == "20260821 (ARM64) - FEX")
+ #expect(try shown("253750") == "20260821 (ARM64) - Rosetta")
}
@Test("A load lists the prefixes and measures each one")
diff --git a/dylib/feats/compat_run.sh b/dylib/feats/compat_run.sh
index 4461529..927518f 100755
--- a/dylib/feats/compat_run.sh
+++ b/dylib/feats/compat_run.sh
@@ -40,12 +40,12 @@ export CX_ROOT
wine_unix="$CX_ROOT/lib/wine/aarch64-unix"
WINELOADER="$wine_unix/wine.app/Contents/MacOS/wine"
-WINESERVER="$CX_ROOT/CrossOver-Hosted Application/wineserver-arm64"
+WINESERVER="$CX_ROOT/bin/wineserver-arm64"
if [ "$np_flavor" = rosetta ] || [ ! -x "$WINELOADER" ] || [ ! -x "$WINESERVER" ]; then
wine_unix="$CX_ROOT/lib/wine/x86_64-unix"
WINELOADER="$wine_unix/wine"
- WINESERVER="$CX_ROOT/CrossOver-Hosted Application/wineserver"
- [ -x "$WINESERVER" ] || WINESERVER="$CX_ROOT/CrossOver-Hosted Application/wineserver-x86"
+ WINESERVER="$CX_ROOT/bin/wineserver"
+ [ -x "$WINESERVER" ] || WINESERVER="$CX_ROOT/bin/wineserver-x86"
fi
export WINELOADER WINESERVER
@@ -891,13 +891,17 @@ install_legacycompat() {
}
bridge_files="steamclient64.dll steamclient.dll tier0_s64.dll vstdlib_s64.dll"
-bridge_files="$bridge_files lsteamclient.dll steam.exe"
+bridge_files="$bridge_files lsteamclient.dll lsteamclient.so steam.exe"
if [ -d "$bridge_src" ] && [ -n "$WINEPREFIX" ]; then
stage_step="bridge staging"
mkdir -p "$prefix_steam"
bridge_matches=1
for f in $bridge_files; do
- if ! cmp -s "$bridge_src/$f" "$prefix_steam/$f"; then
+ src="$bridge_src/$f"
+ if [ "$f" = lsteamclient.so ]; then
+ src="$bridge_src/${wine_unix##*/}/$f"
+ fi
+ if ! cmp -s "$src" "$prefix_steam/$f"; then
bridge_matches=0
break
fi
@@ -907,6 +911,9 @@ if [ -d "$bridge_src" ] && [ -n "$WINEPREFIX" ]; then
else
for f in $bridge_files; do
src="$bridge_src/$f"
+ if [ "$f" = lsteamclient.so ]; then
+ src="$bridge_src/${wine_unix##*/}/$f"
+ fi
if [ ! -f "$src" ]; then
echo "=== bridge missing $f ===" >> "$log" 2>&1 || true
continue
diff --git a/dylib/tests/bridgecheck.sh b/dylib/tests/bridgecheck.sh
index 8bf37e3..02c3d0a 100644
--- a/dylib/tests/bridgecheck.sh
+++ b/dylib/tests/bridgecheck.sh
@@ -20,6 +20,11 @@ trap 'rm -rf "$work"' EXIT
files="steamclient64.dll steamclient.dll tier0_s64.dll vstdlib_s64.dll lsteamclient.dll steam.exe"
mkdir -p "$work/bridge"
for f in $files; do printf 'bridge %s\n' "$f" > "$work/bridge/$f"; done
+for arch in aarch64-unix x86_64-unix; do
+ mkdir -p "$work/bridge/$arch"
+ printf '%s bridge\n' "$arch" > "$work/bridge/$arch/lsteamclient.so"
+done
+wine_unix="$work/runner/aarch64-unix"
fails=0
ok() { printf ' ok %s\n' "$1"; }
@@ -34,7 +39,7 @@ steam="$prefix/drive_c/Program Files (x86)/Steam"
stage() {
: > "$work/log"
env bridge_src="$work/bridge" WINEPREFIX="$prefix" prefix_steam="$steam" \
- log="$work/log" body="$body" \
+ log="$work/log" body="$body" wine_unix="$wine_unix" \
sh -ec 'eval "$body"; echo reached' > "$work/out" 2>&1 || true
}
staged() {
@@ -47,12 +52,28 @@ echo "== a fresh prefix gets the whole bridge"
stage
is "the launch goes on past staging" reached "$(cat "$work/out")"
is "every file is copied" 6 "$(staged)"
+is "the ARM64 unix library is staged beside the DLL" "aarch64-unix bridge" "$(cat "$steam/lsteamclient.so" 2>/dev/null)"
unlogged "nothing claims to be staged already" "=== bridge already staged ==="
echo "== a second launch copies nothing"
stage
is "the launch goes on" reached "$(cat "$work/out")"
logged "the copy is recognised" "=== bridge already staged ==="
+is "the unix library survives pruning" "aarch64-unix bridge" "$(cat "$steam/lsteamclient.so" 2>/dev/null)"
+
+echo "== a different Wine architecture replaces the unix library"
+wine_unix="$work/runner/x86_64-unix"
+stage
+unlogged "the old architecture is not taken as current" "=== bridge already staged ==="
+is "the x86_64 unix library replaces the ARM64 copy" "x86_64-unix bridge" "$(cat "$steam/lsteamclient.so" 2>/dev/null)"
+stage
+logged "the x86_64 copy is recognised" "=== bridge already staged ==="
+
+echo "== a changed unix library is copied again"
+printf 'updated x86_64 bridge\n' > "$work/bridge/x86_64-unix/lsteamclient.so"
+stage
+unlogged "the old unix library is not taken as current" "=== bridge already staged ==="
+is "the prefix receives the updated unix library" "updated x86_64 bridge" "$(cat "$steam/lsteamclient.so" 2>/dev/null)"
echo "== changed bytes with the same size and timestamp"
cp -p "$work/bridge/steam.exe" "$work/stamp"
diff --git a/ntdll-patch/apply.py b/ntdll-patch/apply.py
index 770037c..2b0030b 100644
--- a/ntdll-patch/apply.py
+++ b/ntdll-patch/apply.py
@@ -18,22 +18,23 @@ PAYLOAD_BY_CLEAN_SHA = {
"7823d71fbce6c9947163bf8b96beb299eabb02878245bcaf6759f2a22e81f071": "detour64-fex.bin",
"6dff64c00793ce92124f1316985c63783f539f26b392975c70f57637458d2387": "detour2-cx26.bin",
"2c60ee6b00dd13b7f6cb11017778a041ba6a321eaea194f1fa0dca7eab8403e2": "detour32-cx26.bin",
+ "5b388fd48823e905616432fba627eb48f68dc14383963bb213d55db3f691b1b9": "detour2-41069.bin",
+ "e7da2a712870222942ef27a80b3bf4fa70fc8545dd1a64bdc7f2fa24a38debc3": "detour32-41069.bin",
+ "1b02dcf6ad9d9490870f1127a421c4c0d1471c65ec1574e1e84c05d69801ac7e": "detour2-fex-41069.bin",
+ "66b1a244a611795c59a93a9491d17f36c98cd8db9be495004a37864e0e5ed4a5": "detour32-fex-41069.bin",
+ "77ca83b2e1a3a1242f9d2d8868328262b2bcfc3f59bacf8b9389ea7e797ea852": "detour64-fex-41069.bin",
}
-UNAMBIGUOUS_PAYLOAD = {0xaa64: "detour64-fex.bin"}
KNOWN_MACHINES = (0x8664, 0x14c, 0xaa64)
-def default_payload(src, machine):
+def default_payload(src):
with open(src, "rb") as f:
digest = hashlib.sha256(f.read()).hexdigest()
if digest in PAYLOAD_BY_CLEAN_SHA:
return PAYLOAD_BY_CLEAN_SHA[digest]
- if machine in UNAMBIGUOUS_PAYLOAD:
- return UNAMBIGUOUS_PAYLOAD[machine]
- raise SystemExit(f"{src}: sha256 {digest} matches no known clean ntdll, and machine "
- f"{machine:#x} has more than one detour, pass payload.bin as the "
- f"third argument")
+ raise SystemExit(f"{src}: sha256 {digest} matches no known clean ntdll, "
+ f"pass payload.bin as the third argument")
def append_section(pe, d, r):
@@ -62,7 +63,7 @@ def main():
if r['machine'] not in KNOWN_MACHINES:
raise SystemExit(f"{src}: machine {r['machine']:#x} carries no detour")
payload_path = sys.argv[3] if len(sys.argv) > 3 \
- else os.path.join(here, default_payload(src, r['machine']))
+ else os.path.join(here, default_payload(src))
detour = open(payload_path, "rb").read()
payload_rva = int(v['NP_PAYLOAD_RVA'], 16)
fill = r['fill']
diff --git a/ntdll-patch/build-ntdll.sh b/ntdll-patch/build-ntdll.sh
index db022b5..9b3b83d 100755
--- a/ntdll-patch/build-ntdll.sh
+++ b/ntdll-patch/build-ntdll.sh
@@ -30,6 +30,18 @@ FEX_PATCHED_X86_64=fa8cd8fe7c4c19effade92d55b00fa946b630ab13cbb6721076848238c1dc
FEX_PATCHED_I386=e799ea02418294588ee353a90b967358be316a3044ff9515b28aa1ce07e63981
FEX_PATCHED_AARCH64=f40810193a5ef2520774288f354a8604f5ba91828315f643b3ee6688b873dc3f
+ROSETTA41069_CLEAN_X86_64=5b388fd48823e905616432fba627eb48f68dc14383963bb213d55db3f691b1b9
+ROSETTA41069_CLEAN_I386=e7da2a712870222942ef27a80b3bf4fa70fc8545dd1a64bdc7f2fa24a38debc3
+ROSETTA41069_PATCHED_X86_64=9569625387cf179d306b004c556273e2ec15811b2cfd51f21d078e2a0aa06f7f
+ROSETTA41069_PATCHED_I386=0d8e3ebb57b3173f675eef5e3a0950052c592efa10a7a10193b0beb811b55ea5
+
+FEX41069_CLEAN_X86_64=1b02dcf6ad9d9490870f1127a421c4c0d1471c65ec1574e1e84c05d69801ac7e
+FEX41069_CLEAN_I386=66b1a244a611795c59a93a9491d17f36c98cd8db9be495004a37864e0e5ed4a5
+FEX41069_CLEAN_AARCH64=77ca83b2e1a3a1242f9d2d8868328262b2bcfc3f59bacf8b9389ea7e797ea852
+FEX41069_PATCHED_X86_64=7548abd874656f6a6455e7fac659020ed755d92f4e1929a33097bbde964699f5
+FEX41069_PATCHED_I386=e16b0199db721a08201b1512476b9eff255624d2faf3696fa57ff74b1a54be5c
+FEX41069_PATCHED_AARCH64=7623c0b33350f511b431d39c7ec0c0d4f5def4183acef0eee5d4a5c694898956
+
install=0
[ "${1:-}" = "--install" ] && install=1
@@ -44,18 +56,22 @@ flavor_of() {
for cand in "$CX_ROOT/lib/wine/aarch64-windows/ntdll.dll.notproton-orig" \
"$CX_ROOT/lib/wine/aarch64-windows/ntdll.dll"; do
[ -f "$cand" ] || continue
- if [ "$(sha "$cand")" = "$FEX_CLEAN_AARCH64" ]; then echo fex; return 0; fi
+ case "$(sha "$cand")" in
+ "$FEX_CLEAN_AARCH64") echo fex; return 0 ;;
+ "$FEX41069_CLEAN_AARCH64") echo fex-41069; return 0 ;;
+ esac
done
for cand in "$CX_ROOT/lib/wine/x86_64-windows/ntdll.dll.notproton-orig" \
"$CX_ROOT/lib/wine/x86_64-windows/ntdll.dll"; do
[ -f "$cand" ] || continue
case "$(sha "$cand")" in
- "$ROSETTA_CLEAN_X86_64") echo rosetta; return 0 ;;
- "$CX26_CLEAN_X86_64") echo cx26; return 0 ;;
+ "$ROSETTA_CLEAN_X86_64") echo rosetta; return 0 ;;
+ "$ROSETTA41069_CLEAN_X86_64") echo rosetta-41069; return 0 ;;
+ "$CX26_CLEAN_X86_64") echo cx26; return 0 ;;
esac
done
die "no ntdll under $CX_ROOT/lib/wine matches a pinned build
- pass FLAVOR=rosetta, FLAVOR=cx26 or FLAVOR=fex to choose the pins anyway"
+ pass FLAVOR=rosetta, rosetta-41069, cx26, fex or fex-41069 to choose the pins anyway"
}
if [ -z "${FLAVOR:-}" ]; then
@@ -63,18 +79,21 @@ if [ -z "${FLAVOR:-}" ]; then
fi
case "$FLAVOR" in
- rosetta) tools="x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc"; BUILD=27.0.0.40921 ;;
- cx26) tools="x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc"; BUILD=26.3.0.39832 ;;
- fex) tools="x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc clang ld.lld"
- BUILD=27.0.0.40921-fex ;;
- *) die "unknown flavor $FLAVOR, expected rosetta, cx26 or fex" ;;
+ rosetta) tools="x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc"; BUILD=27.0.0.40921 ;;
+ rosetta-41069) tools="x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc"; BUILD=27.0.0.41069 ;;
+ cx26) tools="x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc"; BUILD=26.3.0.39832 ;;
+ fex) tools="x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc clang ld.lld"
+ BUILD=27.0.0.40921-fex ;;
+ fex-41069) tools="x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc clang ld.lld"
+ BUILD=27.0.0.41069-fex ;;
+ *) die "unknown flavor $FLAVOR, expected rosetta, rosetta-41069, cx26, fex or fex-41069" ;;
esac
for t in $tools; do
command -v "$t" >/dev/null || die "$t not found (brew install mingw-w64 llvm)"
done
-if [ "$FLAVOR" = fex ] && [ ! -x "$OBJCOPY" ]; then
+if [ "${FLAVOR%-41069}" = fex ] && [ ! -x "$OBJCOPY" ]; then
die "$OBJCOPY not found (brew install llvm)"
fi
@@ -137,6 +156,22 @@ case "$FLAVOR" in
patch_one aarch64-windows build64.sh fex detour64-fex.bin \
"$FEX_CLEAN_AARCH64" "$FEX_PATCHED_AARCH64"
;;
+ rosetta-41069)
+ ARCHES="x86_64-windows i386-windows"
+ patch_one x86_64-windows build.sh 41069 detour2-41069.bin \
+ "$ROSETTA41069_CLEAN_X86_64" "$ROSETTA41069_PATCHED_X86_64"
+ patch_one i386-windows build32.sh 41069 detour32-41069.bin \
+ "$ROSETTA41069_CLEAN_I386" "$ROSETTA41069_PATCHED_I386"
+ ;;
+ fex-41069)
+ ARCHES="x86_64-windows i386-windows aarch64-windows"
+ patch_one x86_64-windows build.sh fex-41069 detour2-fex-41069.bin \
+ "$FEX41069_CLEAN_X86_64" "$FEX41069_PATCHED_X86_64"
+ patch_one i386-windows build32.sh fex-41069 detour32-fex-41069.bin \
+ "$FEX41069_CLEAN_I386" "$FEX41069_PATCHED_I386"
+ patch_one aarch64-windows build64.sh fex-41069 detour64-fex-41069.bin \
+ "$FEX41069_CLEAN_AARCH64" "$FEX41069_PATCHED_AARCH64"
+ ;;
esac
if [ "$install" -eq 0 ]; then
diff --git a/ntdll-patch/resolve.py b/ntdll-patch/resolve.py
index 9928f6a..819af25 100755
--- a/ntdll-patch/resolve.py
+++ b/ntdll-patch/resolve.py
@@ -66,6 +66,46 @@ PINNED = {
'payload': '68a458ec9c32041c79fdd622d18e91cfbe825a5292cae362d310930e34dd598e',
'exports': {'LdrGetDllHandle': 0x180043328, 'LdrLoadDll': 0x180040e94,
'NtProtectVirtualMemory': 0x180065db0}},
+ '5b388fd48823e905616432fba627eb48f68dc14383963bb213d55db3f691b1b9':
+ {'hookRVA': 0x52055, 'stolen': '4883bc24f000000000', 'caveRVA': 0x815e0, 'caveSize': 2592,
+ 'resume': 0x5205e, 'wm': 'rsi', 'load_path': 0xd0,
+ 'payload': '660ea7c935620e620a45a46e552c0a3de9292e031bf93ef676968154d45e78d5',
+ 'exports': {'LdrGetDllHandle': 0x170017710, 'LdrLoadDll': 0x170018230,
+ 'NtProtectVirtualMemory': 0x17000f690, 'NtOpenFile': 0x17000f2f0,
+ 'NtReadFile': 0x17000ed50, 'NtClose': 0x17000ee70}},
+ 'e7da2a712870222942ef27a80b3bf4fa70fc8545dd1a64bdc7f2fa24a38debc3':
+ {'hookRVA': 0x4d848, 'stolen': 'f645bc027526', 'caveRVA': 0x7d1f0, 'caveSize': 3600,
+ 'resume': 0x4d84e, 'wm': 'edi', 'load_path': -0x54,
+ 'payload': '3eaa5021add0c8e30e324d6b1a6392a32720f5f73596418a2086b7f8081eb1bd',
+ 'exports': {'LdrGetDllHandle': 0x7bc125f0, 'LdrLoadDll': 0x7bc130e0,
+ 'NtProtectVirtualMemory': 0x7bc0d7a4, 'NtOpenFile': 0x7bc0d5d4,
+ 'NtReadFile': 0x7bc0d304, 'NtClose': 0x7bc0d394}},
+ '1b02dcf6ad9d9490870f1127a421c4c0d1471c65ec1574e1e84c05d69801ac7e':
+ {'hookRVA': 0x34aae, 'stolen': '488b842410010000', 'caveRVA': 0xb5000, 'caveSize': 4096,
+ 'resume': 0x34ab6, 'wm': 'rbx', 'load_path': 0x98,
+ 'payload': '0084bba1d7399e749d918dba4f313f1dc1825d2a487f3169b469b57c5b161ca5',
+ 'exports': {'LdrGetDllHandle': 0x17002f4e0, 'LdrLoadDll': 0x17002ce20,
+ 'NtProtectVirtualMemory': 0x170055dbc, 'NtOpenFile': 0x170055a1c,
+ 'NtReadFile': 0x17005547c, 'NtClose': 0x17005559c}},
+ '66b1a244a611795c59a93a9491d17f36c98cd8db9be495004a37864e0e5ed4a5':
+ {'hookRVA': 0x2ede2, 'stolen': '8b4514a802', 'caveRVA': 0xa4000, 'caveSize': 4096,
+ 'resume': 0x2ede7, 'wm': 'esi', 'load_path': -0x3c,
+ 'payload': '6ff6c7289e639c4caad85c2670bfa849d9f36baa24152b6979896caede5e249b',
+ 'exports': {'LdrGetDllHandle': 0x7bc2a670, 'LdrLoadDll': 0x7bc28660,
+ 'NtProtectVirtualMemory': 0x7bc4d800, 'NtOpenFile': 0x7bc4d630,
+ 'NtReadFile': 0x7bc4d360, 'NtClose': 0x7bc4d3f0}},
+ '77ca83b2e1a3a1242f9d2d8868328262b2bcfc3f59bacf8b9389ea7e797ea852':
+ {'caveRVA': 0xf3185, 'caveSize': 52859,
+ 'sites': [{'hookRVA': 0x48738, 'stolen': '1f2003d5', 'resume': 0x4873c,
+ 'wm': 'x27', 'load_path': -0x98},
+ {'hookRVA': 0xa883c, 'stolen': '1f2003d5', 'resume': 0xa8840,
+ 'wm': 'x22', 'load_path': -0x88}],
+ 'guest': {'LdrLoadDll': 0xa0aa0, 'LdrGetDllHandle': 0xa0aa0,
+ 'NtProtectVirtualMemory': 0xecf9c},
+ 'payload': 'b27484eaed592366ddd3a5b3c565c2dc05e8fa255fbd7e19d9d8eb619ff57c23',
+ 'exports': {'LdrGetDllHandle': 0x18004390c, 'LdrLoadDll': 0x180041344,
+ 'NtProtectVirtualMemory': 0x180067050, 'NtOpenFile': 0x180066cb0,
+ 'NtReadFile': 0x180066710, 'NtClose': 0x180066830}},
}
EXPORTS = ['LdrGetDllHandle', 'LdrLoadDll', 'NtProtectVirtualMemory',
'NtOpenFile', 'NtReadFile', 'NtClose']