Merge remote-tracking branch 'Blu3train/MajiroHook'

This commit is contained in:
Chenx221 2024-09-05 12:07:41 +08:00
commit 52988926eb
3 changed files with 45 additions and 2 deletions

View File

@ -4781,6 +4781,49 @@ bool InsertMajiroHook()
return true; return true;
} }
bool InsertMajiro3Hook()
{
//by Blu3train
/*
* Sample games:
* Narcissu 10th Anniversary Anthology Project
* https://vndb.org/v10
* https://vndb.org/v70
* https://vndb.org/v18738
* https://vndb.org/v18739
* https://vndb.org/v18736
*/
const BYTE bytes[] = {
0xC1, 0xE9, 0x02, // shr ecx,02 << hook here
0xF3, 0xA5, // repe movsd
0x8B, 0xCA, // mov ecx,edx
0x8D, 0x95, XX4 // lea edx,[ebp-00000404]
};
ULONG range = min(processStopAddress - processStartAddress, MAX_REL_ADDR);
ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStartAddress + range);
if (!addr) {
ConsoleOutput("vnreng:Majiro3: pattern not found");
return false;
}
HookParam hp = {};
hp.address = addr;
hp.offset = pusha_esi_off - 4;
hp.index = 0;
hp.type = USING_STRING;
ConsoleOutput("vnreng: INSERT Majiro3");
ConsoleOutput("vnreng:Majiro3: To separate the text between lines flag the \"Flush delay string spacing\" option");
NewHook(hp, "Majiro3");
return true;
}
bool InsertMajiroHooks()
{
bool ok = InsertMajiroHook();
return InsertMajiro3Hook() || ok;
}
/******************************************************************************************** /********************************************************************************************
CMVS hook: CMVS hook:
Process name is cmvs.exe or cnvs.exe or cmvs*.exe. Used by PurpleSoftware games. Process name is cmvs.exe or cnvs.exe or cmvs*.exe. Used by PurpleSoftware games.

View File

@ -114,7 +114,7 @@ bool InsertLiveHook(); // Live: live.dll
bool InsertLightvnHook(); // Light.vn: Engine.dll & BugTrapU.dll bool InsertLightvnHook(); // Light.vn: Engine.dll & BugTrapU.dll
bool InsertLunaSoftHook(); // LunaSoft: Pac/*.pac bool InsertLunaSoftHook(); // LunaSoft: Pac/*.pac
bool InsertMalieHook(); // Malie@light: malie.ini bool InsertMalieHook(); // Malie@light: malie.ini
bool InsertMajiroHook(); // Majiro: *.arc bool InsertMajiroHooks(); // Majiro: *.arc
bool InsertMarineHeartHook(); // Marine Heart: SAISYS.exe bool InsertMarineHeartHook(); // Marine Heart: SAISYS.exe
bool InsertMBLHook(); // MBL: *.mbl bool InsertMBLHook(); // MBL: *.mbl
bool InsertMEDHook(); // MED: *.med bool InsertMEDHook(); // MED: *.med

View File

@ -151,7 +151,7 @@ bool DetermineEngineByFile1()
return true; return true;
} }
if (Util::CheckFile(L"data*.arc") && Util::CheckFile(L"stream*.arc")) { if (Util::CheckFile(L"data*.arc") && Util::CheckFile(L"stream*.arc")) {
InsertMajiroHook(); InsertMajiroHooks();
return true; return true;
} }
// jichi 5/31/2014 // jichi 5/31/2014