50 lines
1.1 KiB
C++
Raw Normal View History

2024-11-02 15:49:09 +08:00
#include "AXL.h"
bool InsertAXLHook()
{
// キミの声がきこえる
2024-02-07 20:59:24 +08:00
BYTE bytes[] = {
2024-11-02 15:49:09 +08:00
0x0f, 0x95, 0xc2, 0x33, 0xc0, 0xB9, 0x41, 0x00, 0x00, 0x00};
2024-02-07 20:59:24 +08:00
auto addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStopAddress);
2024-11-02 15:49:09 +08:00
if (addr == 0)
return false;
addr = findfuncstart(addr, 0x1000);
if (addr == 0)
return false;
2024-02-07 20:59:24 +08:00
HookParam hp;
2024-11-02 15:49:09 +08:00
hp.address = addr;
2024-02-07 20:59:24 +08:00
hp.offset = get_stack(4);
hp.type = USING_STRING;
2024-11-02 15:49:09 +08:00
return NewHook(hp, "AXL");
2024-02-07 20:59:24 +08:00
}
2024-11-02 15:49:09 +08:00
namespace
{
bool hook2()
{
// 剣乙女ノア
// Maria天使のキスと悪魔の花嫁
2024-02-07 20:59:24 +08:00
BYTE bytes[] = {
2024-11-02 15:49:09 +08:00
0x55, 0x8b, 0xec,
0x56,
0x8b, 0xf0,
0x3b, 0x9e, 0x8c, 0xf8, 0x00, 0x00,
0x57};
2024-02-07 20:59:24 +08:00
auto addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStopAddress);
2024-11-02 15:49:09 +08:00
if (addr == 0)
return false;
2024-02-07 20:59:24 +08:00
HookParam hp;
2024-11-02 15:49:09 +08:00
hp.address = addr;
hp.offset = get_stack(1);
hp.split = get_reg(regs::eax);
hp.type = USING_SPLIT;
2024-02-07 20:59:24 +08:00
return NewHook(hp, "TAILWIND");
}
}
2024-11-02 15:49:09 +08:00
bool AXL::attach_function()
{
return InsertAXLHook() || hook2();
}