From 3aee03a244dc4411e021aa423dbabc2f5d5d5c54 Mon Sep 17 00:00:00 2001 From: k1mlka Date: Fri, 16 Oct 2020 20:43:53 +0800 Subject: [PATCH] update specific game hook --- texthook/engine/engine.cc | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/texthook/engine/engine.cc b/texthook/engine/engine.cc index 12713c8..7683c9c 100644 --- a/texthook/engine/engine.cc +++ b/texthook/engine/engine.cc @@ -16397,18 +16397,28 @@ bool InsertShinyDaysGameHook() 0xc6,0x84,0x24,0x90,0x02,0x00,0x00,0x02 }; LPVOID addr = (LPVOID)0x42ad94; - if (::memcmp(addr, bytes, sizeof(bytes)) != 0) { - ConsoleOutput("vnreng:ShinyDays: only work for 1.00"); - return false; + if (::memcmp(addr, bytes, sizeof(bytes)) == 0) { + HookParam hp = {}; + hp.address = 0x42ad9c; + hp.text_fun = SpecialGameHookShinyDays; + hp.type = USING_UNICODE | USING_STRING | NO_CONTEXT; + ConsoleOutput("vnreng: INSERT ShinyDays"); + NewHook(hp, "ShinyDays 1.00"); + return true; + } + addr = (LPVOID)0x42b7f4; + if (::memcmp(addr, bytes, sizeof(bytes)) == 0) { + HookParam hp = {}; + hp.address = 0x42b7fc; + hp.text_fun = SpecialGameHookShinyDays; + hp.type = USING_UNICODE | USING_STRING | NO_CONTEXT; + ConsoleOutput("vnreng: INSERT ShinyDays"); + NewHook(hp, "ShinyDays 1.00d"); + return true; } - HookParam hp = {}; - hp.address = 0x42ad9c; - hp.text_fun = SpecialGameHookShinyDays; - hp.type = USING_UNICODE|USING_STRING|NO_CONTEXT; - ConsoleOutput("vnreng: INSERT ShinyDays"); - NewHook(hp, "ShinyDays 1.00"); - return true; + ConsoleOutput("vnreng:ShinyDays: only work for 1.00 and 1.00d"); + return false; } #if 0 // disabled as lova does not allow module from being modified