LunaHook-mirror/LunaHook/engine32/Tomato.cpp

17 lines
465 B
C++
Raw Normal View History

2024-02-07 20:59:24 +08:00
#include"Tomato.h"
bool Tomato::attach_function() {
//姫武者
bool ok=false;
2024-04-25 18:09:46 +08:00
for(auto addr:findiatcallormov_all((DWORD)TextOutA,processStartAddress,processStartAddress,processStopAddress,PAGE_EXECUTE)){
2024-02-07 20:59:24 +08:00
addr = MemDbg::findEnclosingAlignedFunction(addr);
if (!addr) continue;
HookParam hp;
hp.address = addr;
hp.offset=get_reg(regs::edx);
hp.type = DATA_INDIRECT;
hp.index = 0;
ok|=NewHook(hp, "Tomato");
}
return ok;
}