mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-12-25 20:54:15 +08:00
41 lines
1.2 KiB
C++
41 lines
1.2 KiB
C++
|
#include"IronGameSystem.h"
|
|||
|
|
|||
|
|
|||
|
bool InsertIGSDynamicHook(LPVOID addr, uintptr_t frame, uintptr_t stack)
|
|||
|
{
|
|||
|
if (addr != GetGlyphOutlineW)
|
|||
|
return false;
|
|||
|
DWORD i;
|
|||
|
i = *(DWORD *)frame;
|
|||
|
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;
|
|||
|
}
|