diff --git a/texthook/engine/engine.cc b/texthook/engine/engine.cc index f1270bf..6457e2f 100644 --- a/texthook/engine/engine.cc +++ b/texthook/engine/engine.cc @@ -23655,6 +23655,42 @@ bool InsertNamcoPS2Hook() } #endif // 0 +bool InsertTrianglePixHook() +{ + //by Blu3train + /* + * Sample games: + * https://vndb.org/v38070 + * https://vndb.org/v42090 + * https://vndb.org/v41025 + */ + const BYTE bytes[] = { + 0x50, // push eax << hook here + 0xE8, XX4, // call FinalIgnition.exe+4DE10 + 0x8B, 0x83, XX4, // mov eax,[ebx+0000DCA0] + 0x8D, 0x8D, XX4, // lea ecx,[ebp-0000022C] + 0x83, 0x7D, 0x44, 0x10, // cmp dword ptr [ebp+44],10 + 0xFF, 0x75, 0x40 // push [ebp+40] + }; + + ULONG range = min(processStopAddress - processStartAddress, MAX_REL_ADDR); + ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStartAddress + range); + if (!addr) { + ConsoleOutput("vnreng:TrianglePix: pattern not found"); + return false; + } + + HookParam hp = {}; + hp.address = addr; + hp.offset = pusha_eax_off -4; + hp.index = 0; + hp.type = USING_UTF8 | USING_STRING | NO_CONTEXT; + hp.filter_fun = NewLineCharToSpaceFilter; + ConsoleOutput("vnreng: INSERT TrianglePix"); + NewHook(hp, "TrianglePix"); + return true; +} + bool InsertSekaiProject1Hook() { //by Blu3train diff --git a/texthook/engine/engine.h b/texthook/engine/engine.h index cab623f..24f3b29 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 InsertTrianglePixHook(); // Triangle Pix: pix.bin bool InsertOtomeHook(); // Otome: fsroot* bool InsertYaneSDKHook(); // YaneSDK: arc/evimage.dat bool InsertBishopHook(); // Bishop: *.bsa diff --git a/texthook/engine/match32.cc b/texthook/engine/match32.cc index 375b22f..7403b8d 100644 --- a/texthook/engine/match32.cc +++ b/texthook/engine/match32.cc @@ -380,6 +380,10 @@ bool DetermineEngineByFile3() bool DetermineEngineByFile4() { + if (Util::CheckFile(L"pix.bin")) { + if (InsertTrianglePixHook()) + return true; + } if (Util::CheckFile(L"Packs/*.GPK")) { if (InsertSekaiProjectHooks()) return true;