LunaHook-mirror/LunaHook/engine64/TYPEMOON.cpp

30 lines
802 B
C++
Raw Permalink Normal View History

2024-10-03 14:53:59 +08:00
#include "TYPEMOON.h"
namespace
{
bool _h()
{
// TYPE-MOON 魔法使いの夜 多国語版 中文-英文-日文
BYTE bytes[] = {
0xBA, 0x08, 0xFF, 0x00, 0x00,
0x41, 0xB8, 0x1C, 0x20, 0x00, 0x00,
0x66, 0x90};
auto addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStopAddress);
ConsoleOutput("%p", addr);
if (addr == 0)
return false;
addr = MemDbg::findEnclosingAlignedFunction(addr);
ConsoleOutput("%p", addr);
if (addr == 0)
return false;
HookParam hp;
hp.address = addr;
hp.type = CODEC_UTF16 | USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_BEFORE_SIMPLE;
hp.offset = get_reg(regs::r8);
return NewHook(hp, "typemoon");
}
2024-02-07 20:59:24 +08:00
}
2024-10-03 14:53:59 +08:00
bool TYPEMOON::attach_function()
{
2024-02-07 20:59:24 +08:00
return _h();
2024-10-03 14:53:59 +08:00
}