mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-15 08:53:53 +08:00
28 lines
739 B
C++
28 lines
739 B
C++
#include "Diskdream.h"
|
|
|
|
bool Diskdream::attach_function()
|
|
{
|
|
// https://vndb.org/v3143
|
|
// Endless Serenade
|
|
char skip[] = "FrameSkip = ";
|
|
ULONG addr = MemDbg::findBytes(skip, sizeof(skip), processStartAddress, processStopAddress);
|
|
if (!addr)
|
|
return false;
|
|
addr = MemDbg::findPushAddress(addr, processStartAddress, processStopAddress);
|
|
if (!addr)
|
|
return false;
|
|
addr = findfuncstart(addr);
|
|
if (!addr)
|
|
return false;
|
|
HookParam hp;
|
|
hp.address = addr;
|
|
hp.offset = get_reg(regs::edx);
|
|
hp.type = USING_STRING;
|
|
hp.codepage = 932;
|
|
hp.filter_fun = [](TextBuffer *buffer, HookParam *)
|
|
{
|
|
if (!(bool)IsShiftjisLeadByte(*(BYTE *)buffer->buff))
|
|
buffer->clear();
|
|
};
|
|
return NewHook(hp, "Diskdream");
|
|
} |