2024-11-02 15:49:09 +08:00
|
|
|
#include "Ages3ResT.h"
|
2024-02-07 20:59:24 +08:00
|
|
|
|
2024-11-02 15:49:09 +08:00
|
|
|
bool Ages3ResTHook()
|
|
|
|
{
|
2024-02-07 20:59:24 +08:00
|
|
|
const BYTE bytes[] = {
|
2024-11-02 15:49:09 +08:00
|
|
|
0x8d, 0x4f, XX,
|
|
|
|
0xff, 0x15, XX4,
|
|
|
|
XX,
|
|
|
|
0x8d, 0x8f, XX4,
|
|
|
|
0xff, 0x15, XX4,
|
|
|
|
0x8d, XX, XX4,
|
|
|
|
XX,
|
|
|
|
0x8d, 0x8f, XX4,
|
|
|
|
0xff, 0x15, XX4,
|
|
|
|
0x8b, XX,
|
|
|
|
0xff, 0x15, XX4};
|
|
|
|
|
2024-02-07 20:59:24 +08:00
|
|
|
auto addrs = Util::SearchMemory(bytes, sizeof(bytes), PAGE_EXECUTE, processStartAddress, processStopAddress);
|
2024-11-02 15:49:09 +08:00
|
|
|
bool succ = false;
|
|
|
|
for (auto addr : addrs)
|
|
|
|
{
|
2024-02-07 20:59:24 +08:00
|
|
|
ConsoleOutput("Ages3ResT %p", addr);
|
2024-11-02 15:49:09 +08:00
|
|
|
if (addr == 0)
|
|
|
|
return false;
|
2024-02-07 20:59:24 +08:00
|
|
|
addr = findfuncstart(addr);
|
|
|
|
ConsoleOutput("Ages3ResT %p", addr);
|
2024-11-02 15:49:09 +08:00
|
|
|
if (addr == 0)
|
|
|
|
return false;
|
2024-02-07 20:59:24 +08:00
|
|
|
HookParam hp;
|
|
|
|
hp.address = addr;
|
2024-11-02 15:49:09 +08:00
|
|
|
hp.offset = get_stack(3);
|
2024-02-07 20:59:24 +08:00
|
|
|
hp.type = CODEC_UTF16 | USING_STRING;
|
2024-11-02 15:49:09 +08:00
|
|
|
succ |= NewHook(hp, "Ages3ResT");
|
2024-02-07 20:59:24 +08:00
|
|
|
}
|
|
|
|
return succ;
|
|
|
|
}
|
|
|
|
|
2024-11-02 15:49:09 +08:00
|
|
|
bool Ages3ResT::attach_function()
|
|
|
|
{
|
|
|
|
return Ages3ResTHook();
|
|
|
|
}
|