Files
libradhook/tests/test_memory_integrity.cpp
nexusverypro 3192afe07d initial commit
2026-07-03 02:00:27 +01:00

21 lines
394 B
C++

#include <cassert>
#include "radhook/radhook.h"
static int fn() { return 42; }
static int detour() { return 1337; }
int main() {
RadHookHandle h = nullptr;
RadHookCreate((void*)fn, (void*)detour, &h);
for (int i = 0; i < 10000; i++) {
RadHookEnable(h);
assert(fn() == 1337);
RadHookDisable(h);
assert(fn() == 42);
}
RadHookDestroy(h);
}