Files
hook_tests/tester/main.cpp
2018-01-08 20:20:43 +01:00

41 lines
836 B
C++

#include <cstdint>
#include <iostream>
#include <iomanip>
#include <Windows.h>
#include <memory>
#include "../test_cases/test_cases.h"
#include "abstracthook.h"
extern AbstractHookEngine* g_mhook,
*g_PolyHook,
*g_MinHook;
int main(int argc, char** argv) {
AbstractHookEngine* engines[] = {
g_PolyHook,
g_MinHook,
g_mhook,
};
SelfTest();
for(auto&& x : engines) {
if (!x->hook_all()) {
std::cerr << x->name() << " can't hook\n";
x->unhook_all();
continue;
}
SelfTest();
x->unhook_all();
}
std::cout << "+----------+-+-+-+-+-+-+-+" << std::endl <<
'|' << std::setw(10) << "Name" << std::setw(1) << "|S|B|R|A|?|L|T|" << std::endl <<
"+----------+-+-+-+-+-+-+-+" << std::endl;
for (auto&& x : engines) {
std::cout << *x << std::endl;
}
std::cout << "+----------+-+-+-+-+-+-+-+" << std::endl;
}