From 0dc2de60505dabb7156aeb5915677d9436f8b3c3 Mon Sep 17 00:00:00 2001 From: somewhatlurker <52014015+somewhatlurker@users.noreply.github.com> Date: Sun, 26 Jan 2020 13:55:50 +0000 Subject: [PATCH] ShaderPatch: fix stack alignment in thunk --- source-code/source/plugins/ShaderPatch/src/dllmain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source-code/source/plugins/ShaderPatch/src/dllmain.cpp b/source-code/source/plugins/ShaderPatch/src/dllmain.cpp index 1db129d..24ab6a6 100644 --- a/source-code/source/plugins/ShaderPatch/src/dllmain.cpp +++ b/source-code/source/plugins/ShaderPatch/src/dllmain.cpp @@ -295,9 +295,9 @@ BOOL APIENTRY DllMain(HMODULE hModule, if (ul_reason_for_call == DLL_PROCESS_ATTACH) { // install a thunk to hook - InjectCode((void*)0x1405e5991, { 0x48, 0x83, 0xec, 0x20 }); // SUB RSP, 0x20 + InjectCode((void*)0x1405e5991, { 0x48, 0x83, 0xec, 0x28 }); // SUB RSP, 0x28 InjectCode((void*)0x1405e5995, { 0xe8, 0x56, 0xe8, 0xb9, 0xff }); // CALL 0x1401841f0 - InjectCode((void*)0x1405e599a, { 0x48, 0x83, 0xc4, 0x20 }); // ADD RSP, 0x20 + InjectCode((void*)0x1405e599a, { 0x48, 0x83, 0xc4, 0x28 }); // ADD RSP, 0x28 InjectCode((void*)0x1405e599e, { 0xc3 }); // RET InjectCode((void*)0x1405e534a, { 0xe8, 0x42, 0x06, 0x00, 0x00 }); // CALL 0x1405e5991