mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-11-25 06:45:36 +08:00
24 lines
613 B
C++
24 lines
613 B
C++
|
#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");
|
||
|
}
|