added hook for VN v1193

This commit is contained in:
Blu3train 2023-09-24 11:54:07 +02:00
parent 733a61a3bc
commit c19e1d0b24

View File

@ -21729,6 +21729,40 @@ bool InsertNamcoPS2Hook()
#endif // 0 #endif // 0
bool InsertSekaiProject1Hook() bool InsertSekaiProject1Hook()
{
//by Blu3train
/*
* Sample games:
* https://vndb.org/v1193
*/
const BYTE bytes[] = {
0xCC, // int 3
0x83, 0xEC, 0x10, // sub esp,10 << hook here
0x8B, 0x44, 0x24, 0x14, // mov eax,[esp+14]
0x53, // push ebx
0x56, // push esi
0x50, // push eax
0x8B, 0xD9 // mov ebx,ecx
};
ULONG range = min(processStopAddress - processStartAddress, MAX_REL_ADDR);
ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStartAddress + range);
if (!addr) {
ConsoleOutput("vnreng:SekaiProject1: pattern not found");
return false;
}
HookParam hp = {};
hp.address = addr + 1;
hp.offset = 0x4 * 1; //arg1
hp.index = 0;
hp.type = USING_UNICODE | USING_STRING | NO_CONTEXT;
ConsoleOutput("vnreng: INSERT SekaiProject1");
NewHook(hp, "SekaiProject1");
return true;
}
bool InsertSekaiProject2Hook()
{ {
//by Blu3train //by Blu3train
/* /*
@ -21746,7 +21780,7 @@ bool InsertSekaiProject1Hook()
ULONG range = min(processStopAddress - processStartAddress, MAX_REL_ADDR); ULONG range = min(processStopAddress - processStartAddress, MAX_REL_ADDR);
ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStartAddress + range); ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStartAddress + range);
if (!addr) { if (!addr) {
ConsoleOutput("vnreng:SekaiProject1: pattern not found"); ConsoleOutput("vnreng:SekaiProject2: pattern not found");
return false; return false;
} }
@ -21755,12 +21789,12 @@ bool InsertSekaiProject1Hook()
hp.offset = 0x4 * 21; //arg21 hp.offset = 0x4 * 21; //arg21
hp.index = 0; hp.index = 0;
hp.type = USING_UNICODE | USING_STRING | NO_CONTEXT; hp.type = USING_UNICODE | USING_STRING | NO_CONTEXT;
ConsoleOutput("vnreng: INSERT SekaiProject1"); ConsoleOutput("vnreng: INSERT SekaiProject2");
NewHook(hp, "SekaiProject1"); NewHook(hp, "SekaiProject2");
return true; return true;
} }
bool InsertSekaiProject2Hook() bool InsertSekaiProject3Hook()
{ {
//by Blu3train //by Blu3train
/* /*
@ -21780,7 +21814,7 @@ bool InsertSekaiProject2Hook()
ULONG range = min(processStopAddress - processStartAddress, MAX_REL_ADDR); ULONG range = min(processStopAddress - processStartAddress, MAX_REL_ADDR);
ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStartAddress + range); ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStartAddress + range);
if (!addr) { if (!addr) {
ConsoleOutput("vnreng:SekaiProject2: pattern not found"); ConsoleOutput("vnreng:SekaiProject3: pattern not found");
return false; return false;
} }
@ -21789,13 +21823,13 @@ bool InsertSekaiProject2Hook()
hp.offset = 0x4 * 1; //arg1 hp.offset = 0x4 * 1; //arg1
hp.index = 0; hp.index = 0;
hp.type = USING_UNICODE | USING_STRING | NO_CONTEXT; hp.type = USING_UNICODE | USING_STRING | NO_CONTEXT;
ConsoleOutput("vnreng: INSERT SekaiProject2"); ConsoleOutput("vnreng: INSERT SekaiProject3");
NewHook(hp, "SekaiProject2"); NewHook(hp, "SekaiProject3");
return true; return true;
} }
bool InsertSekaiProjectHooks() bool InsertSekaiProjectHooks()
{ return InsertSekaiProject1Hook() || InsertSekaiProject2Hook();} { return InsertSekaiProject1Hook() || InsertSekaiProject2Hook() || InsertSekaiProject3Hook();}
} // namespace Engine } // namespace Engine