Cliel engine hook

This commit is contained in:
Blu3train 2023-08-04 23:39:16 +02:00
parent f3fbe04409
commit d6a01088c6
3 changed files with 54 additions and 0 deletions

View File

@ -21728,6 +21728,55 @@ bool InsertNamcoPS2Hook()
}
#endif // 0
bool CielFilter(LPVOID data, DWORD *size, HookParam *, BYTE)
{
auto text = reinterpret_cast<LPSTR>(data);
auto len = reinterpret_cast<size_t *>(size);
if (*len == 1) return false;
//StringCharReplacer(text, len, "^n", 2, ' ');
return true;
}
bool InsertCielHook()
{
//by Blu3train
/*
* Sample games:
* https://vndb.org/r26480
* https://vndb.org/v1648
* https://vndb.org/v10392
*/
const BYTE bytes[] = {
0x50, // push eax << hook here
0xE8, XX4, // call FaultA.exe+81032
0x83, 0xC4, 0x04, // add esp,04
0x85, 0xC0, // test eax,eax
0x74, 0x32, // je FaultA.exe+41FA6
0x81, 0x7C, 0x24, 0x10, XX4 // cmp [esp+10],000003FE
};
ULONG range = min(processStopAddress - processStartAddress, MAX_REL_ADDR);
ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStartAddress + range);
if (!addr) {
ConsoleOutput("vnreng:Ciel: pattern not found");
return false;
}
HookParam hp = {};
hp.address = addr;
hp.offset = pusha_edi_off -4;
hp.index = 0;
hp.length_offset = 1;
hp.type = DATA_INDIRECT;
hp.filter_fun = CielFilter;
ConsoleOutput("vnreng: INSERT Ciel");
NewHook(hp, "Ciel");
return true;
}
} // namespace Engine
// EOF

View File

@ -165,6 +165,7 @@ void InsertRealliveHook(); // RealLive: RealLive*.exe
void InsertStuffScriptHook(); // Stuff: *.mpk
bool InsertTinkerBellHook(); // TinkerBell: arc00.dat
bool InsertWaffleHook(); // WAFFLE: cg.pak
bool InsertCielHook(); // Ciel: sys/kidoku.dat
// CIRCUS: avdata/
bool InsertCircusHook1();

View File

@ -370,6 +370,10 @@ bool DetermineEngineByFile3()
bool DetermineEngineByFile4()
{
if (Util::CheckFile(L"sys/kidoku.dat")) {
if (InsertCielHook())
return true;
}
if (Util::CheckFile(L"EAGLS.dll")) { // jichi 3/24/2014: E.A.G.L.S
//ConsoleOutput("vnreng: IGNORE EAGLS");
InsertEaglsHook();