Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "ProcessSpy.h"
- #include <Windows.h>
- const int Processes = 4;
- char* illegalProcesses[Processes] = {"cheatengine", "olly", "winject", "wpe pro"};
- void ProcessSpy::terminate(){
- MessageBox(0,"[BinaryX Shield] Hacking tool detected!", "Terminating..", 0);
- ExitProcess(0);
- }
- void ProcessSpy::checkProcesses(){
- HANDLE hProcessSnap;
- PROCESSENTRY32 pe32;
- char tempChar;
- // Take a snapshot of all processes in the system.
- hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
- pe32.dwSize = sizeof(PROCESSENTRY32);
- // On problems, kill the program
- if( !Process32First( hProcessSnap, &pe32)){
- CloseHandle( hProcessSnap );
- MessageBox(0,"[BinaryX Shield] ProcessSpy error - 1001", "Warning", 0);
- ExitProcess(0);
- }
- // No problems so far? Then let's check for illegal stuff!
- // This do-loop will loop though all processes
- do{
- LPCSTR currentProcess = pe32.szExeFile;
- for(int i=0; i<Processes; i++){
- for(int p=0; p<sizeof(illegalProcesses[i]); p++){
- if(illegalProcesses[i][p] == pe32.szExeFile[p] || toupper(illegalProcesses[i][p]) == pe32.szExeFile[p]){
- if(p == sizeof(illegalProcesses[i])-1){
- //Process is illegal!
- terminate();
- }
- }else{
- //Process not illegal, move on to the next process!
- break;
- }
- }
- }
- }while(Process32Next( hProcessSnap, &pe32));
- CloseHandle( hProcessSnap );
- }
Add Comment
Please, Sign In to add comment