Загрузка данных
#include <Windows.h>
#include <iostream>
#include <string>
#include <conio.h>
#include <map>
#define CROSSHAIR_ADDR 0x110B5314
HANDLE hProcess = NULL;
bool triggerEnabled = false;
int triggerKey = VK_F1; // клавиша по умолчанию
std::map<int, std::string> keyNames;
void InitKeyNames() {
keyNames[VK_F1] = "F1"; keyNames[VK_F2] = "F2"; keyNames[VK_F3] = "F3";
keyNames[VK_F4] = "F4"; keyNames[VK_F5] = "F5"; keyNames[VK_F6] = "F6";
keyNames[VK_F7] = "F7"; keyNames[VK_F8] = "F8"; keyNames[VK_F9] = "F9";
keyNames[VK_F10] = "F10"; keyNames[VK_F11] = "F11"; keyNames[VK_F12] = "F12";
keyNames[VK_INSERT] = "INSERT"; keyNames[VK_DELETE] = "DELETE";
keyNames[VK_HOME] = "HOME"; keyNames[VK_END] = "END";
keyNames[VK_PRIOR] = "PAGE UP"; keyNames[VK_NEXT] = "PAGE DOWN";
keyNames[0x31] = "1"; keyNames[0x32] = "2"; keyNames[0x33] = "3";
keyNames[0x34] = "4"; keyNames[0x35] = "5"; keyNames[0x36] = "6";
keyNames[0x37] = "7"; keyNames[0x38] = "8"; keyNames[0x39] = "9"; keyNames[0x30] = "0";
}
std::string GetKeyName(int vk) {
if (keyNames.count(vk)) return keyNames[vk];
char buf[10];
sprintf_s(buf, "%d", vk);
return std::string(buf);
}
void Shoot() {
INPUT input = {0};
input.type = INPUT_MOUSE;
input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
SendInput(1, &input, sizeof(INPUT));
Sleep(10);
input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
SendInput(1, &input, sizeof(INPUT));
}
void BindKey() {
std::cout << "Press any key to bind for trigger..." << std::endl;
int key = _getch();
if (key == 224) { // спец. клавиши
key = _getch();
if (key == 71) triggerKey = VK_HOME;
else if (key == 72) triggerKey = VK_UP;
else if (key == 73) triggerKey = VK_PRIOR;
else if (key == 75) triggerKey = VK_LEFT;
else if (key == 77) triggerKey = VK_RIGHT;
else if (key == 79) triggerKey = VK_END;
else if (key == 80) triggerKey = VK_DOWN;
else if (key == 81) triggerKey = VK_NEXT;
else if (key == 82) triggerKey = VK_INSERT;
else if (key == 83) triggerKey = VK_DELETE;
else triggerKey = key;
} else {
triggerKey = key;
}
std::cout << "Trigger bound to: " << GetKeyName(triggerKey) << std::endl;
}
int main() {
InitKeyNames();
system("title Trigger Bot CS 1.6");
system("color 0A");
std::cout << "========================================" << std::endl;
std::cout << "Rutube: https://rutube.ru/channel/43805541" << std::endl;
std::cout << "Telegram: hackeriks" << std::endl;
std::cout << "========================================" << std::endl;
std::cout << std::endl;
while (true) {
std::cout << "Waiting for launch CS 1.6..." << std::endl;
HWND gameWnd = NULL;
while (!gameWnd) {
gameWnd = FindWindowW(NULL, L"Counter-Strike");
Sleep(500);
}
std::cout << "Find CS 1.6!" << std::endl;
DWORD pid;
GetWindowThreadProcessId(gameWnd, &pid);
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
std::cout << std::endl;
std::cout << "=== MENU ===" << std::endl;
std::cout << "1. Bind [" << GetKeyName(triggerKey) << "]" << std::endl;
std::cout << "2. Exit" << std::endl;
std::cout << "===========" << std::endl;
std::cout << "Select option: ";
char choice = _getch();
std::cout << choice << std::endl;
if (choice == '1') {
BindKey();
} else if (choice == '2') {
if (hProcess) CloseHandle(hProcess);
return 0;
}
triggerEnabled = true;
std::cout << "Trigger bot is ACTIVE! Press " << GetKeyName(triggerKey) << " to enable/disable" << std::endl;
std::cout << "Waiting for actions..." << std::endl;
bool localEnabled = true;
while (true) {
if (GetAsyncKeyState(triggerKey) & 1) {
localEnabled = !localEnabled;
std::cout << (localEnabled ? "Trigger ON" : "Trigger OFF") << std::endl;
}
if (localEnabled && hProcess) {
int val = 0;
ReadProcessMemory(hProcess, (LPCVOID)CROSSHAIR_ADDR, &val, sizeof(int), NULL);
if (val == 2) {
static int last = 0;
int now = GetTickCount();
if (now - last > 100) {
Shoot();
last = now;
}
}
}
// Проверка, жива ли игра
DWORD exitCode;
GetExitCodeProcess(hProcess, &exitCode);
if (exitCode != STILL_ACTIVE) {
CloseHandle(hProcess);
hProcess = NULL;
std::cout << "CS 1.6 closed. Returning to menu..." << std::endl;
system("pause");
break;
}
Sleep(10);
}
}
return 0;
}