#define WIN32_LEAN_AND_MEAN
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
#include <Windows.h>
#include <stdio.h>
#include <TlHelp32.h>
#include <shellapi.h>
using namespace std;
DWORD FindProcessId(char* processName)
{
char* p = strrchr(processName, '\\');
if (p) processName = p + 1;
PROCESSENTRY32 processInfo;
processInfo.dwSize = sizeof(processInfo);
HANDLE processesSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
if (processesSnapshot == INVALID_HANDLE_VALUE) return 0;
Process32First(processesSnapshot, &processInfo);
if (!strcmp(processName, processInfo.szExeFile))
{
CloseHandle(processesSnapshot);
return processInfo.th32ProcessID;
}
while (Process32Next(processesSnapshot, &processInfo))
{
if (!strcmp(processName, processInfo.szExeFile))
{
CloseHandle(processesSnapshot);
return processInfo.th32ProcessID;
}
}
CloseHandle(processesSnapshot);
return 0;
}
int main()
{
ShellExecuteA(0, "open", "Connector.exe", 0, 0, SW_SHOW); Sleep(300);
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, FindProcessId((char*)"Connector.exe"));
if (hProc)
{
unsigned char Patch[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
WriteProcessMemory(hProc, (void*)0x458760, &Patch, 6, 0);
CloseHandle(hProc);
}
return 1;
}