From 8da3a64d23812826a42794fcf71db920c8154ee4 Mon Sep 17 00:00:00 2001 From: Shin Jinhyeok <97652090+hakujitsu7@users.noreply.github.com> Date: Sun, 29 Dec 2024 05:48:32 +0900 Subject: [PATCH] Fix: Correct sizeof usage in `DetourTransactionCommitEx` Replaced `sizeof(o->pTrampoline)` with `sizeof(*o->pTrampoline)` to correctly calculate the trampoline size when adjusting thread instruction pointers. --- src/detours.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detours.cpp b/src/detours.cpp index 8db8352..ef2b982 100644 --- a/src/detours.cpp +++ b/src/detours.cpp @@ -1945,7 +1945,7 @@ typedef ULONG_PTR DETOURS_EIP_TYPE; if (o->fIsRemove) { if (cxt.DETOURS_EIP >= (DETOURS_EIP_TYPE)(ULONG_PTR)o->pTrampoline && cxt.DETOURS_EIP < (DETOURS_EIP_TYPE)((ULONG_PTR)o->pTrampoline - + sizeof(o->pTrampoline)) + + sizeof(*o->pTrampoline)) ) { cxt.DETOURS_EIP = (DETOURS_EIP_TYPE)