From 70a67e528fe859d1723f409a1cb7a085f36b94a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <1173718158@qq.com> Date: Fri, 13 Dec 2024 19:28:41 +0800 Subject: [PATCH] . --- .../LunaHook/engine32/littlecheese.cpp | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/cpp/LunaHook/LunaHook/engine32/littlecheese.cpp b/cpp/LunaHook/LunaHook/engine32/littlecheese.cpp index 72565cb4..4a68ce76 100644 --- a/cpp/LunaHook/LunaHook/engine32/littlecheese.cpp +++ b/cpp/LunaHook/LunaHook/engine32/littlecheese.cpp @@ -14,10 +14,21 @@ bool littlecheese::attach_function() addr = reverseFindBytes(align, sizeof(align), addr - 0x100, addr); if (addr == 0) return false; - HookParam hp; - hp.address = addr; - hp.offset = regoffset(ecx); - hp.split = regoffset(edx); - hp.type = USING_CHAR | CODEC_ANSI_BE | USING_SPLIT; - return NewHook(hp, "littlecheese"); + if (*(DWORD *)(addr - 4) == 0x55575653) + { + HookParam hp; + hp.address = addr - 4; + hp.offset = regoffset(ecx); + hp.type = USING_CHAR | CODEC_ANSI_BE; + return NewHook(hp, "littlecheese"); + } + else + { + HookParam hp; + hp.address = addr; + hp.offset = regoffset(ecx); + hp.split = regoffset(edx); + hp.type = USING_CHAR | CODEC_ANSI_BE | NO_CONTEXT | USING_SPLIT; + return NewHook(hp, "littlecheese"); + } } \ No newline at end of file