diff --git a/src/Launcher.cs b/src/Launcher.cs index cbc3f34..1d679cc 100644 --- a/src/Launcher.cs +++ b/src/Launcher.cs @@ -179,11 +179,15 @@ class Launcher memory.QueuePatch(Patterns.Windows.CertBundle, Patches.Windows.CertBundle, "CertBundle"), memory.QueuePatch(Patterns.Windows.CertCommonName, Patches.Windows.CertCommonName, "CertCommonName", 5) }, Program.CancellationTokenSource.Token); -#if CUSTOM_FILES + #if CUSTOM_FILES Task.WaitAll(new[] { memory.QueuePatch(Patterns.Windows.LoadByFileId, Patches.Windows.NoJump, "LoadByFileId", 6), - memory.QueuePatch(Patterns.Windows.LoadByFilePath, Patches.Windows.NoJump, "LoadByFilePath", 3) + + // 10.0.0 (Prepatch) changed a pattern. + (clientVersion is (10, _, _, _)) + ? memory.QueuePatch(Patterns.Windows.LoadByFilePathAlternate, Patches.Windows.NoJump, "LoadByFilePath", 3) + : memory.QueuePatch(Patterns.Windows.LoadByFilePath, Patches.Windows.NoJump, "LoadByFilePath", 3) }, Program.CancellationTokenSource.Token); var (idAlloc, stringAlloc) = ModLoader.LoadFileMappings(processInfo.ProcessHandle); @@ -193,7 +197,7 @@ class Launcher if (!ModLoader.HookClient(memory, processInfo.ProcessHandle, idAlloc, stringAlloc)) return false; } -#endif + #endif #elif ARM64 Task.WaitAll(new[] diff --git a/src/Patterns/Windows.cs b/src/Patterns/Windows.cs index ca7005f..7efce46 100644 --- a/src/Patterns/Windows.cs +++ b/src/Patterns/Windows.cs @@ -20,6 +20,7 @@ static class Windows // Custom files (mods). public static short[] LoadByFileId = { 0x41, -1, -1, 0x01, 0x0F, 0x84, -1, 0x00, 0x00, 0x00, 0x48, 0x8B, -1, -1, -1, -1, -1, 0x8B }; public static short[] LoadByFilePath = { 0x01, 0x0F, 0x84, -1, -1, -1, -1, 0x48, 0x8B, -1, -1, -1, -1, -1, 0x44, 0x89, -1, -1, -1, 0x48, 0x85, 0xC9 }; + public static short[] LoadByFilePathAlternate = { 0x01, 0x0F, 0x84, -1, -1, -1, -1, 0x48, 0x8B, -1, -1, -1, -1, -1, 0x44, 0x89, -1, -1, -1, 0x00, 0x00, 0x00, 0x48, 0x85, 0xC9 }; public static short[] CustomFileIdHook = { 0x48, 0x89, 0x5C, 0x24, 0x08, 0x57, 0x48, 0x83, 0xEC, 0x20, 0x48, 0x8B, -1, 0x48, -1, -1, 0x48, -1, -1, -1, -1, -1, -1, 0xE8, -1, -1, -1, -1, 0x48, -1, -1, -1, -1, -1, -1, 0x48, -1, -1, 0x74, -1, 0x48, -1, 0xCD }; #elif ARM64 // Anti Crash.