From dc79d354372eeafd05d7632b763675eed7923ecb 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: Mon, 9 Dec 2024 02:57:11 +0800 Subject: [PATCH] . --- cpp/LunaHook/LunaHook/engine32/Debonosu.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cpp/LunaHook/LunaHook/engine32/Debonosu.cpp b/cpp/LunaHook/LunaHook/engine32/Debonosu.cpp index 894827d8..70f00310 100644 --- a/cpp/LunaHook/LunaHook/engine32/Debonosu.cpp +++ b/cpp/LunaHook/LunaHook/engine32/Debonosu.cpp @@ -182,13 +182,16 @@ namespace hp.address = addr + 6; hp.type = USING_STRING | NO_CONTEXT; hp.offset = get_reg(regs::eax); - hp.filter_fun = [](TextBuffer *buffer, HookParam *) + hp.filter_fun = [](TextBuffer *buffer, HookParam *hp) { auto text = reinterpret_cast(buffer->buff); if (all_ascii(text, buffer->size)) return buffer->clear(); - std::string str = buffer->strA(); + if (WideStringToString(StringToWideString(str)) == str) + hp->type |= CODEC_UTF8; + else + hp->type &= ~CODEC_UTF8; std::string result1 = std::regex_replace(str, std::regex("\\{(.*?)/(.*?)\\}"), "$1"); buffer->from(result1); };