From 56a9cf7e53df1a8598ef445471b0bbb070767b2a Mon Sep 17 00:00:00 2001 From: LoveSy Date: Fri, 9 Aug 2024 10:58:09 +0800 Subject: [PATCH] Avoid hook called with unsupported arguments --- lsplant/src/main/jni/include/utils/hook_helper.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lsplant/src/main/jni/include/utils/hook_helper.hpp b/lsplant/src/main/jni/include/utils/hook_helper.hpp index 09f83c6..98da471 100644 --- a/lsplant/src/main/jni/include/utils/hook_helper.hpp +++ b/lsplant/src/main/jni/include/utils/hook_helper.hpp @@ -97,9 +97,9 @@ struct HookHandler { hook(dlsym(), reinterpret_cast(hooker.replace_)))); } - template - [[gnu::always_inline]] bool hook(T &...args) const { - return (hook(args) || ...); + template + [[gnu::always_inline]] bool hook(T1 &arg1, T2 &arg2, U &...args) const { + return ((hook(arg1) || hook(arg2)) || ... || hook(args)); } private: