GameMaker engine hook

This commit is contained in:
Blu3train 2023-06-02 00:17:49 +02:00
parent f3fbe04409
commit 80bc1e7b8b
3 changed files with 47 additions and 0 deletions

View File

@ -21728,6 +21728,48 @@ bool InsertNamcoPS2Hook()
} }
#endif // 0 #endif // 0
bool GameMakerFilter(LPVOID data, DWORD *size, HookParam *, BYTE)
{
CharFilter(reinterpret_cast<LPSTR>(data), reinterpret_cast<size_t*>(size), '#');
return true;
}
bool InsertGameMakerHook()
{
//by Blu3train
/*
* Sample games:
* VA-11 Hall A
*/
const BYTE bytes[] = {
0x85, 0xF6, // test esi,esi
0x74, XX, // je "VA-11 Hall A.exe"+D5014
0x85, 0xC0, // test eax,eax
0x74, XX, // je "VA-11 Hall A.exe"+D5014
0x50, // push eax
0x56 // push esi << hook here
};
enum { addr_offset = sizeof(bytes) - 1 };
ULONG range = min(processStopAddress - processStartAddress, MAX_REL_ADDR);
ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStartAddress + range);
if (!addr) {
ConsoleOutput("vnreng:GameMaker: pattern not found");
return false;
}
HookParam hp = {};
hp.address = addr + addr_offset;
hp.offset = pusha_eax_off -4;
hp.index = 0;
hp.type = USING_STRING | NO_CONTEXT;
hp.filter_fun = GameMakerFilter;
ConsoleOutput("vnreng: INSERT GameMaker");
NewHook(hp, "GameMaker");
ConsoleOutput("vnreng:GameMaker: use regex filter .+\\]");
return true;
}
} // namespace Engine } // namespace Engine
// EOF // EOF

View File

@ -156,6 +156,7 @@ bool InsertWillPlusHook(); // WillPlus: Rio.arc
bool InsertWolfHook(); // Wolf: Data.wolf bool InsertWolfHook(); // Wolf: Data.wolf
bool InsertYukaSystem2Hook(); // YukaSystem2: *.ykc bool InsertYukaSystem2Hook(); // YukaSystem2: *.ykc
bool InsertYurisHook(); // YU-RIS: *.ypf bool InsertYurisHook(); // YU-RIS: *.ypf
bool InsertGameMakerHook(); // GameMaker: GMResource.dll
void InsertBrunsHook(); // Bruns: bruns.exe void InsertBrunsHook(); // Bruns: bruns.exe
void InsertIronGameSystemHook();// IroneGameSystem: igs_sample.exe void InsertIronGameSystemHook();// IroneGameSystem: igs_sample.exe

View File

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