This is the exact method from RapeGuard.
Thread Wrapper Class:Code:__forceinline void KillGunz() { _asm { XOR EAX,EAX XOR ECX,ECX mov dword ptr ds: [esp+4],0 mov eax, dword ptr ds: [0x6272B0] jmp eax SHL ECX,9 SHR EAX,7 OR EAX,ECX NOT ECX AND EAX,1 DIV EAX retn } } bool IsAddressHooked(unsigned long address) { BYTE* offsetValue = (BYTE*)address; return (*offsetValue == 0xE8 || *offsetValue == 0xE9 || *offsetValue == 0x7E || *offsetValue == 0x74 || *offsetValue == 0xFF); } void UnderclockThread() { SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_LOWEST); SetThreadPriority(GetCurrentThread(), THREAD_MODE_BACKGROUND_BEGIN); DWORD getTickCount = (DWORD)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetTickCount"); DWORD queryPerformanceCounter = (DWORD)GetProcAddress(GetModuleHandleA("kernel32.dll"), "QueryPerformanceCounter"); while(true) { if (IsAddressHooked(getTickCount) || IsAddressHooked(queryPerformanceCounter) || GetModuleHandleA ("SpeedHack.dll") != NULL || GetModuleHandleA ("MyHookDll.dll") != NULL) { HackDetected(Underclocking); Sleep(5000); KillGunz(); } Sleep (5000); } }
Code:#pragma once #ifndef _THREAD_H_ #define _THREAD_H_ #include <Windows.h> typedef void ThreadFunction(); class Thread { public: enum ThreadState { TS_NONE, TS_RUNNING, TS_SUSPENDED }; public: Thread(ThreadFunction _thread) { threadHandle = CreateThread (NULL, NULL, (LPTHREAD_START_ROUTINE)_thread, NULL, NULL, &threadId); } DWORD GetThreadId() { return threadId; } HANDLE GetHandle() { return threadHandle; } int GetState() { DWORD status = 0; BOOL exitCode = GetExitCodeThread (threadHandle, &status); if (!exitCode) return TS_NONE; if (status != STILL_ACTIVE) return TS_SUSPENDED; return TS_RUNNING; } private: DWORD threadId; HANDLE threadHandle; }; #endif
Usage:
Global Vars:
OnAttach / DllMain:Code:Thread* underclockThread = NULL;
Code:underclockThread = new Thread(UnderclockThread);
Credits: Me



Reply With Quote


