From a4d5cd43b84ad28b309f565b9581afc272a47445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Tue, 9 Apr 2024 15:33:37 +0800 Subject: [PATCH] Update KiriKiri.cpp --- LunaHook/engine32/KiriKiri.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/LunaHook/engine32/KiriKiri.cpp b/LunaHook/engine32/KiriKiri.cpp index 2335439..3bd444d 100644 --- a/LunaHook/engine32/KiriKiri.cpp +++ b/LunaHook/engine32/KiriKiri.cpp @@ -94,8 +94,29 @@ bool FindKiriKiriHook(DWORD fun, DWORD size, DWORD pt, DWORD flag) // jichi 10/2 hp.split = get_reg(regs::ecx); hp.type = CODEC_UTF16|NO_CONTEXT|USING_SPLIT|DATA_INDIRECT; ConsoleOutput("INSERT KiriKiri2"); + auto succ=NewHook(hp, "KiriKiri2"); + { + //https://vndb.org/v5127 + //蝶の毒 華の鎖 + //KiriKiri2被注音的汉字数量若>=2,则会少字。 + auto addr=pt+k+0x14-5; + BYTE check[]={0x66,0x85,0xC0,0x75};//mov ax,[ebx]; test ax,ax; jnz + if(memcmp(check,(void*)addr,sizeof(check))==0){ + HookParam hp_1; + hp_1.address = addr; + hp_1.type = CODEC_UTF16|NO_CONTEXT|USING_CHAR; + hp_1.text_fun=[](hook_stack* stack, HookParam* hp, uintptr_t* data, uintptr_t* split, size_t* len){ + *split=stack->ecx; + if(*split!=0x16)return; + *data=*(WORD*)(stack->ebx-2); + *len=2; + }; + succ|=NewHook(hp_1, "KiriKiri2X"); + } + } - return NewHook(hp, "KiriKiri2"); + + return succ; } } } else {