Stuff
public text v1 · immutable#include "hook.h"
#include <iostream>
#include <windows.h>
using namespace std;
typedef void (*BAR)();
RITZ::HOOK<BAR> hook;
void bar()
{
cout << "bar" << endl;
}
void foo()
{
cout << "foo" << endl;
}
DWORD WINAPI Hookinator(LPVOID p)
{
for(;;)
{
hook.Unhook();
hook.Rehook();
}
}
int main()
{
hook.Hook(foo, bar);
CreateThread(0, 0, Hookinator, 0, 0, 0);
for(;;)
{
foo();
}
}