mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-11-27 07:44:02 +08:00
27 lines
692 B
C++
27 lines
692 B
C++
#include"Jisatu101.h"
|
|
|
|
|
|
bool Jisatu101::attach_function() {
|
|
const BYTE bytes[] = {
|
|
//ジサツのための101の方法
|
|
//https://vndb.org/v6475
|
|
0x8b,0x44,0x24,0x10,
|
|
0x66,0x0f,0xb6,0x08,
|
|
0x66,0x0f,0xb6,0x50,0x01,
|
|
|
|
0xC1 ,0xE1 ,0x08 ,
|
|
0x03 ,0xCA,
|
|
0x66 ,0x81 ,0xF9 ,0x0A ,0x0D ,
|
|
0x74
|
|
};
|
|
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 = DATA_INDIRECT;
|
|
hp.index = 0;
|
|
return NewHook(hp, "Jisatu101");
|
|
}
|