diff --git a/tools/fex/patches/0025-open-guest-paths-with-raw-openat.patch b/tools/fex/patches/0025-open-guest-paths-with-raw-openat.patch new file mode 100644 index 0000000000..1b0e875c5f --- /dev/null +++ b/tools/fex/patches/0025-open-guest-paths-with-raw-openat.patch @@ -0,0 +1,33 @@ +From a25384e1eaefad973d02412c757176b627aaf822 Mon Sep 17 00:00:00 2001 +From: maxjivi05 +Date: Wed, 2 Dec 2026 18:51:42 -0500 +Subject: [PATCH] Open guest paths with the raw openat system call so host + preloads cannot replace the file + +Builds on StonkGuy's anti-cheat emulation from https://github.com/StonkGuy/FEX (eac-2611, MIT). +--- + Source/Tools/LinuxEmulation/LinuxSyscalls/FileManagement.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/FileManagement.cpp b/Source/Tools/LinuxEmulation/LinuxSyscalls/FileManagement.cpp +index 62b6a2d27..2b0139ae0 100644 +--- a/Source/Tools/LinuxEmulation/LinuxSyscalls/FileManagement.cpp ++++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/FileManagement.cpp +@@ -838,12 +838,12 @@ uint64_t FileManager::Open(const char* pathname, int flags, uint32_t mode) { + + // Open through RootFS failed (probably nonexistent), so open directly. + if (fd == -1) { +- fd = ::open(SelfPath, flags, mode); ++ fd = ::syscall(SYSCALL_DEF(openat), AT_FDCWD, SelfPath, flags, mode); + } + + ReplaceEmuFd(fd, flags, mode); + } else { +- fd = ::open(SelfPath, flags, mode); ++ fd = ::syscall(SYSCALL_DEF(openat), AT_FDCWD, SelfPath, flags, mode); + } + + return fd; +-- +2.43.0 +