CatSystem2 engine hook

This commit is contained in:
Blu3train 2023-07-30 11:45:18 +02:00
parent f3fbe04409
commit 8fb762e2bc
3 changed files with 41 additions and 2 deletions

View File

@ -6586,6 +6586,45 @@ bool InsertCatSystemHook()
return true; return true;
} }
bool InsertCatSystem2Hook()
{
//by Blu3train
/*
* Sample games:
* https://vndb.org/v26987
*/
const BYTE bytes[] = {
0x38, 0x08, // cmp [eax],cl
0x0F, 0x84, XX4, // je cs2.exe+23E490
0x66, 0x66, 0x0F, 0x1F, 0x84, 0x00, XX4, // nop word ptr [eax+eax+00000000]
0x4F, // dec edi
0xC7, 0x85, XX4, XX4, // mov [ebp-000005A0],00000000
0x33, 0xF6, // xor esi,esi
0xC7, 0x85, XX4, XX4, // mov [ebp-0000057C],00000000
0x85, 0xFF // test edi,edi
};
ULONG range = min(processStopAddress - processStartAddress, MAX_REL_ADDR);
ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStartAddress + range);
if (!addr) {
ConsoleOutput("vnreng:CatSystem2new: pattern not found");
return false;
}
HookParam hp = {};
hp.address = addr;
hp.offset = pusha_eax_off -4;
hp.index = 0;
hp.codepage = 65001;
hp.type = USING_STRING;
ConsoleOutput("vnreng: INSERT CatSystem2new");
NewHook(hp, "CatSystem2new");
return true;
}
bool InsertCatSystemHooks()
{return InsertCatSystemHook() || InsertCatSystem2Hook();}
bool InsertNitroplusHook() bool InsertNitroplusHook()
{ {
const BYTE bytes[] = {0xb0, 0x74, 0x53}; const BYTE bytes[] = {0xb0, 0x74, 0x53};

View File

@ -93,7 +93,7 @@ bool InsertBootupHook(); // Bootup: Bootup.dat
bool InsertC4Hook(); // C4: C4.EXE or XEX.EXE bool InsertC4Hook(); // C4: C4.EXE or XEX.EXE
bool InsertCaramelBoxHook(); // Caramel: *.bin bool InsertCaramelBoxHook(); // Caramel: *.bin
bool InsertCandyHook(); // SystemC@CandySoft: *.fpk bool InsertCandyHook(); // SystemC@CandySoft: *.fpk
bool InsertCatSystemHook(); // CatSystem2: *.int bool InsertCatSystemHooks(); // CatSystem2: *.int
bool InsertCMVSHook(); // CMVS: data/pack/*.cpz; do not support the latest cmvs32.exe and cmvs64.exe bool InsertCMVSHook(); // CMVS: data/pack/*.cpz; do not support the latest cmvs32.exe and cmvs64.exe
bool InsertCotophaHook(); // Cotopha: *.noa bool InsertCotophaHook(); // Cotopha: *.noa
bool InsertDebonosuHook(); // Debonosu: bmp.bak and dsetup.dll bool InsertDebonosuHook(); // Debonosu: bmp.bak and dsetup.dll

View File

@ -192,7 +192,7 @@ bool DetermineEngineByFile1()
InsertArtemisHook(); InsertArtemisHook();
return true; return true;
} }
if (Util::CheckFile(L"*.int") && InsertCatSystemHook()) { if (Util::CheckFile(L"*.int") && InsertCatSystemHooks()) {
return true; return true;
} }
if (Util::CheckFile(L"message.dat")) { if (Util::CheckFile(L"message.dat")) {