2024-11-02 15:49:09 +08:00
|
|
|
|
#include "A98SYS.h"
|
2024-07-05 16:23:02 +08:00
|
|
|
|
|
2024-11-02 15:49:09 +08:00
|
|
|
|
bool A98SYS::attach_function()
|
|
|
|
|
{
|
|
|
|
|
// https://vndb.org/v6447
|
|
|
|
|
// Rainy Blue ~6月の雨~
|
|
|
|
|
|
|
|
|
|
auto addrs = findiatcallormov_all((DWORD)::ExtTextOutA, processStartAddress, processStartAddress, processStopAddress, PAGE_EXECUTE);
|
|
|
|
|
if (addrs.size() != 2)
|
|
|
|
|
return false;
|
|
|
|
|
auto addr = addrs[1];
|
|
|
|
|
addr = MemDbg::findEnclosingAlignedFunction(addr);
|
|
|
|
|
if (!addr)
|
|
|
|
|
return false;
|
|
|
|
|
auto addrs1 = findxref_reverse_checkcallop(addr, processStartAddress, processStopAddress, 0xe8);
|
|
|
|
|
if (!addrs1.size())
|
|
|
|
|
return false;
|
|
|
|
|
addr = addrs1[0];
|
|
|
|
|
addr = MemDbg::findEnclosingAlignedFunction(addr);
|
|
|
|
|
if (!addr)
|
|
|
|
|
return false;
|
2024-07-05 16:23:02 +08:00
|
|
|
|
HookParam hp;
|
|
|
|
|
hp.address = addr;
|
2024-11-02 15:49:09 +08:00
|
|
|
|
hp.offset = get_stack(1);
|
|
|
|
|
hp.type = USING_STRING | EMBED_ABLE | EMBED_AFTER_NEW | EMBED_BEFORE_SIMPLE | EMBED_DYNA_SJIS;
|
|
|
|
|
hp.hook_font = F_ExtTextOutA;
|
|
|
|
|
|
2024-07-05 16:23:02 +08:00
|
|
|
|
return NewHook(hp, "A98SYS");
|
2024-11-02 15:49:09 +08:00
|
|
|
|
}
|