diff --git a/texthook/engine/engine.cc b/texthook/engine/engine.cc index 842d20c..34a8f6f 100644 --- a/texthook/engine/engine.cc +++ b/texthook/engine/engine.cc @@ -23758,6 +23758,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; +} + bool LucaSystemFilter(LPVOID data, DWORD *size, HookParam *, BYTE) { auto text = reinterpret_cast(data); diff --git a/texthook/engine/engine.h b/texthook/engine/engine.h index 818741c..0741985 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 InsertYukaSystemHooks(); // YukaSystem2: *.ykc bool InsertYurisHook(); // YU-RIS: *.ypf +bool InsertDebonosuWorksHook(); // DebonosuWorks: resource string bool InsertLucaSystemHook(); // LucaSystem: *.iga bool InsertKogadoHook(); // Kogado: *.pak bool InsertSysdHook(); // Sysd: sysd.ini diff --git a/texthook/engine/match32.cc b/texthook/engine/match32.cc index f927d92..73e01d9 100644 --- a/texthook/engine/match32.cc +++ b/texthook/engine/match32.cc @@ -380,6 +380,10 @@ bool DetermineEngineByFile3() bool DetermineEngineByFile4() { + if (Util::SearchResourceString(L"でぼの巣製作所")) { + if (InsertDebonosuWorksHook()) + return true; + } if (Util::CheckFile(L"*.iga")) { if (InsertLucaSystemHook()) return true;