LunaHook-mirror/LunaHook/engine32/Giga.cpp

24 lines
613 B
C++
Raw Normal View History

2024-02-07 20:59:24 +08:00
#include"Giga.h"
bool Giga::attach_function() {
const BYTE bytes[] = {
//ショコラ ~maid cafe curio Re-order~
//https://vndb.org/v682
0xe8,XX4,
0x83,0xC4,0x10,
0xB8,0x01,0x00,0x00,0x00,
0x81,0xC4,0x00,0x10,0x00,0x00,
0xC3
};
ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStopAddress);
if (addr == 0)return false;
addr = MemDbg::findEnclosingAlignedFunction(addr,0x100);
if (addr == 0)return false;
HookParam hp;
hp.address = addr;
hp.offset =get_stack(4);
hp.type = USING_STRING;
return NewHook(hp, "Giga");
}