LunaHook-mirror/LunaHook/engine32/TSSystem.cpp
2024-02-07 20:59:24 +08:00

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;
}