From 94a48e2e39e533f3549938249273f02b90d037f1 Mon Sep 17 00:00:00 2001 From: Blu3train Date: Mon, 29 Jan 2024 18:47:51 +0100 Subject: [PATCH] DebonosuWorks engine hook --- texthook/engine/engine.cc | 31 +++++++++++++++++++++++++++++++ texthook/engine/engine.h | 1 + texthook/engine/match32.cc | 4 ++++ 3 files changed, 36 insertions(+) diff --git a/texthook/engine/engine.cc b/texthook/engine/engine.cc index c2c7abc..c1378b4 100644 --- a/texthook/engine/engine.cc +++ b/texthook/engine/engine.cc @@ -21728,6 +21728,37 @@ bool InsertNamcoPS2Hook() } #endif // 0 +bool InsertDebonosuWorksHook() { + //by Blu3train + /* + * Sample games: + * https://vndb.org/v47955 + */ + const BYTE bytes[] = { + 0xCC, // int 3 + 0x53, // push ebx <- hook here + 0x56, // push esi + 0x57, // push edi + 0x8B, 0xF9, // mov edi,ecx + 0xC6, 0x05, XX4, 0x00 // mov byte ptr ["Kagura Genesis.exe"+DCB170],00 + }; + ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStopAddress); + if (!addr) { + ConsoleOutput("vnreng:DebonosuWorks: pattern not found"); + return false; + } + + HookParam hp = {}; + hp.address = addr + 1; + hp.offset = pusha_eax_off -4; + hp.index = 0; + hp.type = USING_STRING; + ConsoleOutput("vnreng: INSERT DebonosuWorks"); + NewHook(hp, "DebonosuWorks"); + + return true; +} + } // namespace Engine // EOF diff --git a/texthook/engine/engine.h b/texthook/engine/engine.h index 5e167b2..7d00c4f 100644 --- a/texthook/engine/engine.h +++ b/texthook/engine/engine.h @@ -156,6 +156,7 @@ bool InsertWillPlusHook(); // WillPlus: Rio.arc bool InsertWolfHook(); // Wolf: Data.wolf bool InsertYukaSystem2Hook(); // YukaSystem2: *.ykc bool InsertYurisHook(); // YU-RIS: *.ypf +bool InsertDebonosuWorksHook(); // DebonosuWorks: resource string void InsertBrunsHook(); // Bruns: bruns.exe void InsertIronGameSystemHook();// IroneGameSystem: igs_sample.exe diff --git a/texthook/engine/match32.cc b/texthook/engine/match32.cc index fffc4c7..ed42fa8 100644 --- a/texthook/engine/match32.cc +++ b/texthook/engine/match32.cc @@ -370,6 +370,10 @@ bool DetermineEngineByFile3() bool DetermineEngineByFile4() { + if (Util::SearchResourceString(L"でぼの巣製作所")) { + if (InsertDebonosuWorksHook()) + return true; + } if (Util::CheckFile(L"EAGLS.dll")) { // jichi 3/24/2014: E.A.G.L.S //ConsoleOutput("vnreng: IGNORE EAGLS"); InsertEaglsHook();