Atelier Kaguya GAME_SYS engine hook

This commit is contained in:
Blu3train 2023-08-09 20:41:15 +02:00
parent f3fbe04409
commit 8d56974075
3 changed files with 41 additions and 0 deletions

View File

@ -5583,6 +5583,42 @@ bool InsertAtelierHook()
return false;
//ConsoleOutput("Unknown Atelier KAGUYA engine.");
}
bool InsertAtelierGSHook()
{
//by Blu3train
/*
* Sample games:
* https://vndb.org/v403
*/
const BYTE bytes[] = {
0xC7, 0x44, 0x24, 0x34, XX4, // mov [esp+34],0000000F << hook here
0x89, 0x5C, 0x24, 0x30, // mov [esp+30],ebx
0x88, 0x5C, 0x24, 0x20, // mov [esp+20],bl
0x8D, 0x48, 0x01, // lea ecx,[eax+01]
0x8A, 0x10, // mov dl,[eax]
0x40, // inc eax
0x3A, 0xD3, // cmp dl,bl
0x75, 0xF9 // jne GAME_SYS.EXE+F0B5
};
ULONG range = min(processStopAddress - processStartAddress, MAX_REL_ADDR);
ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStartAddress + range);
if (!addr) {
ConsoleOutput("vnreng:Atelier KAGUYA GAME_SYS: pattern not found");
return false;
}
HookParam hp = {};
hp.address = addr;
hp.offset = pusha_eax_off -4;
hp.index = 0;
hp.type = USING_STRING | NO_CONTEXT;
ConsoleOutput("vnreng: INSERT Atelier KAGUYA GAME_SYS");
NewHook(hp, "Atelier KAGUYA GS");
return true;
}
/********************************************************************************************
CIRCUS hook:
Game folder contains advdata folder. Used by CIRCUS games.

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 InsertAtelierGSHook(); // Atelier GAME_SYS: game_sys.exe, resource string
// CIRCUS: avdata/
bool InsertCircusHook1();

View File

@ -199,6 +199,10 @@ bool DetermineEngineByFile1()
InsertAtelierHook();
return true;
}
if (Util::CheckFile(L"game_sys.exe") && Util::SearchResourceString(L"KaGuYa")) {
if (InsertAtelierGSHook() )
return true;
}
if (Util::CheckFile(L"Check.mdx")) { // jichi 4/1/2014: AUGame
InsertTencoHook();
return true;