Merge remote-tracking branch 'Blu3train/DebonosuWorksEngineHook'

This commit is contained in:
Chenx221 2024-09-05 12:19:48 +08:00
commit ad4b5888d6
3 changed files with 36 additions and 0 deletions

View File

@ -23758,6 +23758,37 @@ bool InsertNamcoPS2Hook()
} }
#endif // 0 #endif // 0
bool InsertDebonosuWorksHook() {
//by Blu3train
/*
* Sample games:
* https://vndb.org/v47955
*/
const BYTE bytes[] = {
0xCC, // int 3
0x53, // push ebx <- hook here
0x56, // push esi
0x57, // push edi
0x8B, 0xF9, // mov edi,ecx
0xC6, 0x05, XX4, 0x00 // mov byte ptr ["Kagura Genesis.exe"+DCB170],00
};
ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStopAddress);
if (!addr) {
ConsoleOutput("vnreng:DebonosuWorks: pattern not found");
return false;
}
HookParam hp = {};
hp.address = addr + 1;
hp.offset = pusha_eax_off -4;
hp.index = 0;
hp.type = USING_STRING;
ConsoleOutput("vnreng: INSERT DebonosuWorks");
NewHook(hp, "DebonosuWorks");
return true;
}
bool LucaSystemFilter(LPVOID data, DWORD *size, HookParam *, BYTE) bool LucaSystemFilter(LPVOID data, DWORD *size, HookParam *, BYTE)
{ {
auto text = reinterpret_cast<LPSTR>(data); auto text = reinterpret_cast<LPSTR>(data);

View File

@ -156,6 +156,7 @@ bool InsertWillPlusHook(); // WillPlus: Rio.arc
bool InsertWolfHook(); // Wolf: Data.wolf bool InsertWolfHook(); // Wolf: Data.wolf
bool InsertYukaSystemHooks(); // YukaSystem2: *.ykc bool InsertYukaSystemHooks(); // YukaSystem2: *.ykc
bool InsertYurisHook(); // YU-RIS: *.ypf bool InsertYurisHook(); // YU-RIS: *.ypf
bool InsertDebonosuWorksHook(); // DebonosuWorks: resource string
bool InsertLucaSystemHook(); // LucaSystem: *.iga bool InsertLucaSystemHook(); // LucaSystem: *.iga
bool InsertKogadoHook(); // Kogado: *.pak bool InsertKogadoHook(); // Kogado: *.pak
bool InsertSysdHook(); // Sysd: sysd.ini bool InsertSysdHook(); // Sysd: sysd.ini

View File

@ -380,6 +380,10 @@ bool DetermineEngineByFile3()
bool DetermineEngineByFile4() bool DetermineEngineByFile4()
{ {
if (Util::SearchResourceString(L"でぼの巣製作所")) {
if (InsertDebonosuWorksHook())
return true;
}
if (Util::CheckFile(L"*.iga")) { if (Util::CheckFile(L"*.iga")) {
if (InsertLucaSystemHook()) if (InsertLucaSystemHook())
return true; return true;