Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions texthook/engine/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21728,6 +21728,42 @@ bool InsertNamcoPS2Hook()
}
#endif // 0

bool InsertSakanaGLHook() {
//by Blu3train
/*
* Sample games:
* https://vndb.org/v46148
*/
const BYTE bytes[] = {
0x89, XX, // mov [ecx],eax <- hook here
0x33, XX, // xor ecx,ecx
0x85, XX // test ebx,ebx
};
HMODULE module = GetModuleHandleW(L"sakanagl.dll");
auto [minAddress, maxAddress] = Util::QueryModuleLimits(module);
ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), minAddress, maxAddress);
if (!addr) {
ConsoleOutput("vnreng:SakanaGL: pattern not found");
return false;
}

HookParam hp = {};
hp.address = addr;
hp.offset = pusha_edx_off -4;
hp.index = 0;
hp.text_fun = [](DWORD esp_base, HookParam*, BYTE, DWORD *data, DWORD*, DWORD *len)
{
if ( regof(edi,esp_base) != 2)
return;
*len = strlen((char*)*data);
};
hp.type = USING_UTF8 | USING_STRING;
ConsoleOutput("vnreng: INSERT SakanaGL");
NewHook(hp, "SakanaGL");

return true;
}

} // namespace Engine

// EOF
Expand Down
1 change: 1 addition & 0 deletions texthook/engine/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ bool InsertWillPlusHook(); // WillPlus: Rio.arc
bool InsertWolfHook(); // Wolf: Data.wolf
bool InsertYukaSystem2Hook(); // YukaSystem2: *.ykc
bool InsertYurisHook(); // YU-RIS: *.ypf
bool InsertSakanaGLHook(); // SakanaGL: sakanagl.dll

void InsertBrunsHook(); // Bruns: bruns.exe
void InsertIronGameSystemHook();// IroneGameSystem: igs_sample.exe
Expand Down
4 changes: 4 additions & 0 deletions texthook/engine/match32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,10 @@ bool DetermineEngineByFile3()

bool DetermineEngineByFile4()
{
if (Util::CheckFile(L"sakanagl.dll")) {
if (InsertSakanaGLHook())
return true;
}
if (Util::CheckFile(L"EAGLS.dll")) { // jichi 3/24/2014: E.A.G.L.S
//ConsoleOutput("vnreng: IGNORE EAGLS");
InsertEaglsHook();
Expand Down