mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-12-27 13:44:11 +08:00
22 lines
563 B
C++
22 lines
563 B
C++
#include"TSSystem.h"
|
|
bool TSSystem::attach_function() {
|
|
//D-EVE in you
|
|
//トロピカルKISS
|
|
const BYTE bytes[] = {
|
|
0xB9,0x42,0x00,0x00,0x00,
|
|
0xF3,0xA5
|
|
} ;
|
|
bool ok=false;
|
|
auto addrs = Util::SearchMemory(bytes, sizeof(bytes), PAGE_EXECUTE, processStartAddress, processStopAddress);
|
|
for (auto addr : addrs) {
|
|
addr=MemDbg::findEnclosingAlignedFunction(addr);
|
|
if(addr==0)continue;
|
|
HookParam hp;
|
|
hp.address = addr;
|
|
hp.offset=get_stack(1);
|
|
hp.type = USING_STRING;
|
|
ok|=NewHook(hp, "TSSystem");
|
|
}
|
|
return ok;
|
|
}
|
|
|