LunaHook-mirror/LunaHook/engine32/IronGameSystem.cpp

41 lines
1.2 KiB
C++
Raw Normal View History

2024-02-07 20:59:24 +08:00
#include"IronGameSystem.h"
2024-05-13 18:28:08 +08:00
bool InsertIGSDynamicHook(LPVOID addr, hook_stack* stack)
2024-02-07 20:59:24 +08:00
{
if (addr != GetGlyphOutlineW)
return false;
DWORD i;
2024-05-13 18:28:08 +08:00
i = *(DWORD *)stack->ebp;
2024-02-07 20:59:24 +08:00
i = *(DWORD *)(i+4);
//if (SafeFillRange(L"mscorlib.ni.dll", &j, &k)) { // Artikash 6/30/2018: Dunno why addresses are needed
while (*(BYTE *)i != 0xe8)
i++;
DWORD t = *(DWORD *)(i + 1) + i + 5;
//if (t>j && t<k) {
HookParam hp;
hp.address = t;
hp.offset=get_reg(regs::edx);
hp.split = get_reg(regs::esp);
hp.type = CODEC_UTF16|USING_SPLIT;
ConsoleOutput("INSERT IronGameSystem");
//ConsoleOutput("IGS - Please set text(ヂ<><EFBFBD> display speed(表示速度) to fastest(瞬<>");
//RegisterEngineType(ENGINE_IGS);
return NewHook(hp, "IronGameSystem");
//}
//}
ConsoleOutput("IGS: failed");
return true; // jichi 12/25/2013: return true
}
void InsertIronGameSystemHook()
{
//ConsoleOutput("Probably IronGameSystem. Wait for text.");
trigger_fun = InsertIGSDynamicHook;
ConsoleOutput("TRIGGER IronGameSystem");
}
bool IronGameSystem::attach_function() {
InsertIronGameSystemHook();
return true;
}