Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <Psapi.h>
- #include <iostream>
- #include <mutex>
- #define in_range(x, a, b) (x >= a && x <= b)
- #define get_bits(x) (in_range((x & (~0x20)), 'A', 'F') ? ((x & (~0x20)) - 'A' + 0xA): (in_range(x, '0', '9') ? x - '0': 0))
- #define get_byte(x) (get_bits(x[0]) << 4 | get_bits(x[1]))
- uintptr_t find_pattern(const char* module, const char* pattern){//probably not fastest but its decent a decent pattern scan
- MODULEINFO mod;
- K32GetModuleInformation(GetCurrentProcess(), GetModuleHandleA(module), &mod, sizeof(MODULEINFO));
- uintptr_t start = (uintptr_t)mod.lpBaseOfDll;
- uintptr_t end = (uintptr_t)mod.lpBaseOfDll + (uintptr_t)mod.SizeOfImage;
- uintptr_t match = (uintptr_t)nullptr;
- const char* current = pattern;
- for (uintptr_t pCur = start; pCur < end; pCur++) {
- if (!*current)
- return match;
- if (*(PBYTE)current == ('\?') || *(BYTE*)pCur == get_byte(current)) {
- if (!match)
- match = pCur;
- if (!current[2])
- return match;
- if (*(PWORD)current == ('\?\?') || *(PBYTE)current != ('\?'))
- current += 3;
- else
- current += 2;
- }
- else {
- current = pattern;
- match = 0;
- }
- }
- return (uintptr_t)nullptr;
- }
- std::once_flag nametags_flag, triggerbot_flag;
- HMODULE module_instance;
- int ac_thread()
- {
- HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
- DWORD dwMode = 0;
- GetConsoleMode(hOut, &dwMode);
- dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
- SetConsoleMode(hOut, dwMode);//not needed, it was just to fix colors on some operating systems for printf
- printf("\x1B[35m[%s]\033[0m \x1B[33m%s\033[0m %s", __TIME__, "[AntiCheat]", "Successfully loaded.\n");
- while (true)
- {
- auto nametags = find_pattern("ToyHeroes.exe", "0f 85 ? ? ? ? e8 ? ? ? ? 8b c8 e8 ? ? ? ? 89 85 94 fc");//searching for nametags
- auto triggerbot = find_pattern("ToyHeroes.exe", "e9 ? ? ? ? 90 89 ? 08");//searching for all public hooks/ce script triggerbot
- if (nametags)//checkin' if found nametags patch
- std::call_once(nametags_flag, [&] {printf("\x1B[35m[%s]\033[0m \x1B[33m%s\033[0m \x1B[31m%s\033[0m", __TIME__, "[AntiCheat]", "Nametags patch detected.\n"); });
- if (triggerbot)//checkin' if found triggerbot hook/script
- std::call_once(triggerbot_flag, [&] {printf("\x1B[35m[%s]\033[0m \x1B[33m%s\033[0m \x1B[31m%s\033[0m", __TIME__, "[AntiCheat]", "Triggerbot detected.\n"); });
- }
- }
- BOOL WINAPI DllMain(HMODULE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
- {
- if (fdwReason == DLL_PROCESS_ATTACH)
- {
- module_instance = hinstDLL;
- AllocConsole();
- freopen("CONOUT$", "wb", stdout);
- freopen("CONIN$", "rb", stdin);
- SetConsoleTitle("fdp ac framework");
- CreateThread(0, 0, (LPTHREAD_START_ROUTINE)ac_thread, 0, 0, 0);
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement