Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <iostream>
- #include <psapi.h>
- #include <tlhelp32.h>
- #include <conio.h>
- #include <fstream>
- using namespace std;
- enum CSGO_Weapon_ID
- {
- weapon_none = 0,
- weapon_deagle,
- weapon_elite,
- weapon_fiveseven,
- weapon_glock,
- weapon_ak47 = 7,
- weapon_aug,
- weapon_awp,
- weapon_famas,
- weapon_g3sg1,
- weapon_galil = 13,
- weapon_m249,
- weapon_m4a4 = 16,
- weapon_mac10,
- weapon_p90 = 19,
- weapon_mp5sd = 23,
- weapon_ump45,
- weapon_xm1014,
- weapon_bizon,
- weapon_mag7,
- weapon_negev,
- weapon_sawedoff,
- weapon_tec9,
- weapon_zeus,
- weapon_p2000,
- weapon_mp7,
- weapon_mp9,
- weapon_nova,
- weapon_p250,
- weapon_shield,
- weapon_scar20,
- weapon_sg553,
- weapon_ssg08,
- weapon_knifegg,
- weapon_knife,
- weapon_flashbang,
- weapon_hegrenade,
- weapon_smokegrenade,
- weapon_molotov,
- weapon_decoy,
- weapon_inc,
- weapon_c4,
- weapon_healthshot = 57,
- weapon_knife_t = 59,
- weapon_m4a1s,
- weapon_usps,
- weapon_cz75 = 63,
- weapon_revolver,
- };
- string weaponClass;
- //-----------------------------------------------------------------
- //GLOBAL VARIABLES:
- string shootIntervalS, temp, pistols, rifles;
- int shootInterval;
- int weaponId = 0;
- int lastWeaponId = 0;
- int mainTeam = 0;
- int buffer = 0;
- int crosshairId = 0;
- int scoped = 0;
- int moving = 0;
- int jumping = 0;
- bool toggle = false;
- bool hold = false;
- bool changedWeapon = false;
- bool showGui = true;
- bool manualGui = false;
- bool pistolMode = false;
- bool rifleMode = true;
- bool sniperMode = false;
- bool autoSniperMode = false;
- bool shotgunMode = false;
- bool noneMode = false;
- DWORD processId, currentId;
- string accuracyPenaltyS;
- string activeWeaponS;
- string moveOffsetS;
- string jumpOffsetS;
- string scopedOffsetS;
- string entityListS;
- string localPlayerS;
- string nextPlayerS;
- string teamS;
- string crosshairS;
- string playerIdS;
- LPVOID clientBase;
- int accuracyPenalty;
- int activeWeapon;
- int weaponOffset;
- int moveOffset;
- int jumpOffset;
- int scopedOffset;
- int entityList;
- int localPlayer;
- int nextPlayer;
- int team;
- int crosshair;
- int playerId;
- fstream interval;
- fstream control;
- fstream offset;
- INPUT inputShoot, inputQ;
- HWND hWindow, csWindow, drawWindow;
- RECT rc;
- HDC hDc;
- HANDLE hProcess;
- //PLAYER SCRUCTURE:
- struct scanplayer {
- int team;
- int id;
- };
- //INTERVAL STRUCTURE:
- struct config {
- string pistolsS;
- string riflesS;
- string snipersS;
- string autosnipersS;
- string shotgunsS;
- int pistols;
- int rifles;
- int snipers;
- int autosnipers;
- int shotguns;
- string pistolMovingS;
- string rifleMovingS;
- string shotgunMovingS;
- bool pistolMoving = false;
- bool rifleMoving = false;
- bool shotgunMoving = false;
- bool pistolMovingD = true;
- bool rifleMovingD = false;
- bool shotgunMovingD = true;
- int pistolsD = 500;
- int riflesD = 150;
- int snipersD = 0;
- int autosnipersD = 100;
- int shotgunsD = 50;
- };
- config intervals;
- //-----------------------------------------------------------------
- //FUNCTIONS:
- string onOffS, holdOnS, defaultsS, addIS, removeIS, quitS, showHideS, shootMovingS;
- int onOff, holdOn, defaults, addI, removeI, quit, showHide, shootMoving;
- void color(int color)
- {
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color | FOREGROUND_INTENSITY);
- }
- void LoadOffsets()
- {
- offset.open("offsets.ini", ios::in);
- if(!offset.good()) //Check if file exists
- {
- MessageBox(hWindow, "Please make sure your offsets.ini file exists!", "Simple Tool", MB_OK | MB_ICONINFORMATION);
- exit(0);
- }
- getline(offset, temp);
- getline(offset, accuracyPenaltyS);
- getline(offset, temp);
- getline(offset, activeWeaponS);
- getline(offset, temp);
- getline(offset, moveOffsetS);
- getline(offset, temp);
- getline(offset, jumpOffsetS);
- getline(offset, temp);
- getline(offset, scopedOffsetS);
- getline(offset, temp);
- getline(offset, entityListS);
- getline(offset, temp);
- getline(offset, localPlayerS);
- getline(offset, temp);
- getline(offset, nextPlayerS);
- getline(offset, temp);
- getline(offset, teamS);
- getline(offset, temp);
- getline(offset, crosshairS);
- getline(offset, temp);
- getline(offset, playerIdS);
- accuracyPenalty = strtoul(accuracyPenaltyS.c_str(), NULL, 16);
- activeWeapon = strtoul(activeWeaponS.c_str(), NULL, 16);
- moveOffset = strtoul(moveOffsetS.c_str(), NULL, 16);
- jumpOffset = strtoul(jumpOffsetS.c_str(), NULL, 16);
- scopedOffset = strtoul(scopedOffsetS.c_str(), NULL, 16);
- entityList = strtoul(entityListS.c_str(), NULL, 16);
- localPlayer = strtoul(localPlayerS.c_str(), NULL, 16);
- nextPlayer = strtoul(nextPlayerS.c_str(), NULL, 16);
- team = strtoul(teamS.c_str(), NULL, 16);
- crosshair = strtoul(crosshairS.c_str(), NULL, 16);
- playerId = strtoul(playerIdS.c_str(), NULL, 16);
- weaponOffset = 0 ;
- offset.close();
- }
- void LoadControls()
- {
- control.open("controls.ini", ios::in);
- if(!control.good()) //Check if file exists
- {
- MessageBox(hWindow, "Please make sure your controls.ini file exists!", "Simple Toll", MB_OK | MB_ICONINFORMATION);
- exit(0);
- }
- getline(control, temp);
- getline(control, temp);
- getline(control, onOffS);
- getline(control, temp);
- getline(control, holdOnS);
- getline(control, temp);
- getline(control, quitS);
- getline(control, temp);
- getline(control, showHideS);
- getline(control, temp);
- getline(control, addIS);
- getline(control, temp);
- getline(control, removeIS);
- getline(control, temp);
- getline(control, shootMovingS);
- getline(control, temp);
- getline(control, defaultsS);
- onOff = strtoul(onOffS.c_str(), NULL, 16);
- holdOn = strtoul(holdOnS.c_str(), NULL, 16);
- quit = strtoul(quitS.c_str(), NULL, 16);
- showHide = strtoul(showHideS.c_str(), NULL, 16);
- addI = strtoul(addIS.c_str(), NULL, 16);
- removeI = strtoul(removeIS.c_str(), NULL, 16);
- shootMoving = strtoul(shootMovingS.c_str(), NULL, 16);
- defaults = strtoul(defaultsS.c_str(), NULL, 16);
- control.close();
- }
- LPVOID GetModuleAddress(HANDLE hProcess, string toFind)
- {
- LPVOID address;
- DWORD cbNeeded;
- HMODULE hModules[1024];
- EnumProcessModulesEx(hProcess, hModules, sizeof(hModules), &cbNeeded, LIST_MODULES_ALL);
- string stringModuleName;
- for(int i=0; i<(cbNeeded / sizeof(HMODULE)); i++)
- {
- TCHAR moduleName[MAX_PATH];
- GetModuleFileNameEx(hProcess, hModules[i], moduleName, sizeof(moduleName) / sizeof(TCHAR));
- stringModuleName = moduleName;
- if(stringModuleName.find(toFind) != string::npos)
- {
- address = hModules[i];
- }
- }
- return address;
- }
- DWORD GetPid(char processName[])
- {
- DWORD processId = NULL;
- PROCESSENTRY32 pe32;
- pe32.dwSize = sizeof(PROCESSENTRY32);
- HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
- if(Process32First(hSnapshot, &pe32))
- {
- do
- {
- if(stricmp(pe32.szExeFile, processName) == 0)
- {
- processId = pe32.th32ProcessID;
- return processId;
- }
- } while(Process32Next(hSnapshot, &pe32));
- }
- return processId;
- }
- void PrintInfo()
- {
- system("cls");
- cout << "TOOL!" << endl;
- cout << "Press INSERT to toggle ON/OFF. Hold ALT to toggle ON. Press DEL to exit. \nPress HOME to SHOW/HIDE GUI" << endl;
- cout << "You must have WINDOWED or FULLSCREEN WINDOWED for GUI to work." << endl << endl;
- cout << "Press NUMPAD 5 to ENABLE/DISABLE shoot while moving for current mode." << endl;
- cout << "Press NUMPAD +/- to ADD/SUBTRACT interval for current mode." << endl;
- cout << "Press NUMPAD 0 to reset to defaults." << endl << endl;
- cout << "Status: "; if(toggle) { color(2); cout << "ON"; } else { color(4); cout << "OFF"; } cout << endl; color(15);
- cout << "Active mode: "; color(2); if(shotgunMode) cout << "SHOTGUNS"; if(autoSniperMode) cout << "AUTO-SNIPERS"; if(noneMode) cout << "NONE"; if(pistolMode) cout << "PISTOLS"; if(rifleMode) cout << "RIFLES"; if(sniperMode) cout << "SNIPERS"; cout << endl; color(15);
- cout << "Shoot interval: "; color(2); if(shotgunMode) cout << intervals.shotguns; if(autoSniperMode) cout << intervals.autosnipers; if(noneMode) cout << "NONE"; if(pistolMode) cout << intervals.pistols; if(rifleMode) cout << intervals.rifles; if(sniperMode) cout << intervals.snipers; cout << endl; color(15);
- cout << "Shoot while running: "; color(2);
- if(pistolMode)
- {
- if(intervals.pistolMoving) cout << "TRUE";
- else cout << "FALSE";
- }
- if(rifleMode)
- {
- if(intervals.rifleMoving) cout << "TRUE";
- else cout << "FALSE";
- }
- if(shotgunMode)
- {
- if(intervals.shotgunMoving) cout << "TRUE";
- else cout << "FALSE";
- }
- if(sniperMode) cout << "N/A";
- if(autoSniperMode) cout << "N/A";
- if(noneMode) cout << "N/A";
- cout << endl;
- color(15);
- }
- void LoadIntervals()
- {
- interval.open("config.ini", ios::in); //Open file for reading
- if(!interval.good()) //Check if file exists
- {
- MessageBox(hWindow, "Please make sure your config.ini file exists!", "SIMPLE TOOL", MB_OK | MB_ICONINFORMATION);
- exit(0);
- }
- //Get values from file
- getline(interval, temp);
- getline(interval, temp);
- getline(interval, temp);
- getline(interval, intervals.pistolsS);
- getline(interval, intervals.pistolMovingS);
- getline(interval, temp);
- getline(interval, intervals.riflesS);
- getline(interval, intervals.rifleMovingS);
- getline(interval, temp);
- getline(interval, intervals.snipersS);
- getline(interval, temp);
- getline(interval, intervals.autosnipersS);
- getline(interval, temp);
- getline(interval, intervals.shotgunsS);
- getline(interval, intervals.shotgunMovingS);
- if(intervals.pistolMovingS == "TRUE") intervals.pistolMoving = true;
- else intervals.pistolMoving = false;
- if(intervals.rifleMovingS == "TRUE") intervals.rifleMoving = true;
- else intervals.rifleMoving = false;
- if(intervals.shotgunMovingS == "TRUE") intervals.shotgunMoving = true;
- else intervals.shotgunMoving = false;
- intervals.pistols = atoi(intervals.pistolsS.c_str());
- intervals.rifles = atoi(intervals.riflesS.c_str());
- intervals.snipers = atoi(intervals.snipersS.c_str());
- intervals.autosnipers = atoi(intervals.autosnipersS.c_str());
- intervals.shotguns = atoi(intervals.shotgunsS.c_str());
- interval.close(); //Close file
- }
- void SaveConfig()
- {
- interval.open("config.ini", ios::out);
- if(!interval.good()) //Check if file exists
- {
- MessageBox(hWindow, "Please make sure your config.ini file exists!", "SIMPLE TOOL", MB_OK | MB_ICONINFORMATION);
- exit(0);
- }
- interval << "#Time between every shot in milliseconds (minimum 20 for pistols, minimum 0 for other)." << endl;
- interval << "#TRUE/FALSE = shoot while running." << endl;
- interval << "#Pistols:" << endl;
- interval << intervals.pistols << endl;
- if(intervals.pistolMoving) interval << "TRUE" << endl;
- else interval << "FALSE" << endl;
- interval << "#Rifles:" << endl;
- interval << intervals.rifles << endl;
- if(intervals.rifleMoving) interval << "TRUE" << endl;
- else interval << "FALSE" << endl;
- interval << "#Snipers:" << endl;
- interval << intervals.snipers << endl;
- interval << "#Auto-Snipers:" << endl;
- interval << intervals.autosnipers << endl;
- interval << "#Shotguns:" << endl;
- interval << intervals.shotguns << endl;
- if(intervals.shotgunMoving) interval << "TRUE" << endl;
- else interval << "FALSE";
- interval.close();
- }
- void CheckKeys()
- {
- if(GetAsyncKeyState(holdOn))
- {
- hold = true;
- }
- else
- {
- if(!toggle) hold = false;
- }
- if(GetAsyncKeyState(onOff) & 1) //Check for INSERT
- {
- toggle = !toggle;
- Beep(200, 100);
- PrintInfo();
- }
- if(GetAsyncKeyState(showHide) & 1) //Check for INSERT
- {
- manualGui = true;
- showGui = !showGui;
- Beep(200, 100);
- }
- if(GetAsyncKeyState(quit) & 1) exit(0); //Check for DELETE
- if(weaponClass == "pistol" && changedWeapon) //Check for 1
- {
- pistolMode = true;
- rifleMode = false;
- sniperMode = false;
- autoSniperMode = false;
- shotgunMode = false;
- noneMode = false;
- PrintInfo();
- }
- if(weaponClass == "rifle" && changedWeapon) //Check for 2
- {
- pistolMode = false;
- rifleMode = true;
- sniperMode = false;
- autoSniperMode = false;
- shotgunMode = false;
- noneMode = false;
- PrintInfo();
- }
- if(weaponClass == "sniper" && changedWeapon) //Check for 3
- {
- pistolMode = false;
- rifleMode = false;
- sniperMode = true;
- autoSniperMode = false;
- shotgunMode = false;
- noneMode = false;
- PrintInfo();
- }
- if(weaponClass == "autosniper" && changedWeapon) //Check for 3
- {
- pistolMode = false;
- rifleMode = false;
- sniperMode = false;
- autoSniperMode = true;
- shotgunMode = false;
- noneMode = false;
- PrintInfo();
- }
- if(weaponClass == "shotgun" && changedWeapon) //Check for 3
- {
- pistolMode = false;
- rifleMode = false;
- sniperMode = false;
- autoSniperMode = false;
- shotgunMode = true;
- noneMode = false;
- PrintInfo();
- }
- if(weaponClass == "none" && changedWeapon) //Check for 3
- {
- pistolMode = false;
- rifleMode = false;
- sniperMode = false;
- autoSniperMode = false;
- shotgunMode = false;
- noneMode = true;
- PrintInfo();
- }
- if(GetAsyncKeyState(shootMoving) & 1) //Check for 3
- {
- Beep(200, 100);
- if(pistolMode) intervals.pistolMoving = !intervals.pistolMoving;
- if(rifleMode) intervals.rifleMoving = !intervals.rifleMoving;
- if(shotgunMode) intervals.shotgunMoving = !intervals.shotgunMoving;
- SaveConfig();
- PrintInfo();
- }
- if(GetAsyncKeyState(defaults) & 1) //Check for 3
- {
- Beep(200, 100);
- int lastMode;
- if(pistolMode) lastMode = 0;
- if(rifleMode) lastMode = 1;
- if(sniperMode) lastMode = 2;
- if(autoSniperMode) lastMode = 3;
- if(shotgunMode) lastMode = 4;
- if(noneMode) lastMode = 5;
- pistolMode = false;
- rifleMode = false;
- sniperMode = false;
- autoSniperMode = false;
- shotgunMode = false;
- noneMode = false;
- intervals.pistols = intervals.pistolsD;
- intervals.rifles = intervals.riflesD;
- intervals.snipers = intervals.snipersD;
- intervals.autosnipers = intervals.autosnipersD;
- intervals.shotguns = intervals.shotgunsD;
- intervals.pistolMoving = intervals.pistolMovingD;
- intervals.rifleMoving = intervals.rifleMovingD;
- intervals.shotgunMoving = intervals.shotgunMovingD;
- if(lastMode == 0) pistolMode = true;
- if(lastMode == 1) rifleMode = true;
- if(lastMode == 2) sniperMode = true;
- if(lastMode == 3) autoSniperMode = true;
- if(lastMode == 4) shotgunMode = true;
- if(lastMode == 5) noneMode = true;
- SaveConfig();
- PrintInfo();
- }
- if(GetAsyncKeyState(addI) & 1) //Check for +
- {
- Beep(200, 100);
- if(pistolMode) intervals.pistols += 50;
- if(rifleMode) intervals.rifles += 50;
- if(sniperMode) intervals.snipers += 50;
- if(autoSniperMode) intervals.autosnipers += 50;
- if(shotgunMode) intervals.shotguns += 50;
- if(intervals.pistols < 20) intervals.pistols = 20;
- if(intervals.rifles < 0) intervals.rifles = 0;
- if(intervals.snipers < 0) intervals.snipers = 0;
- if(intervals.autosnipers < 50) intervals.autosnipers = 50;
- if(intervals.shotguns < 0) intervals.shotguns = 0;
- SaveConfig();
- PrintInfo();
- }
- if(GetAsyncKeyState(removeI) & 1) //check for -
- {
- Beep(200, 100);
- if(pistolMode) intervals.pistols -= 50;
- if(rifleMode) intervals.rifles -= 50;
- if(sniperMode) intervals.snipers -= 50;
- if(autoSniperMode) intervals.autosnipers -= 50;
- if(shotgunMode) intervals.shotguns -= 50;
- if(intervals.pistols < 20) intervals.pistols = 20;
- if(intervals.rifles < 0) intervals.rifles = 0;
- if(intervals.snipers < 0) intervals.snipers = 0;
- if(intervals.autosnipers < 50) intervals.autosnipers = 50;
- if(intervals.shotguns < 0) intervals.shotguns = 0;
- SaveConfig();
- PrintInfo();
- }
- }
- void DefineMouseInput()
- {
- inputShoot = {0}; //Set the input variable
- inputShoot.type = INPUT_MOUSE; //Define input type
- inputShoot.mi.dwFlags = MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP; //Define input flags
- }
- void QScript()
- {
- Sleep(100);
- inputQ.type = INPUT_KEYBOARD;
- inputQ.ki.time = 0;
- inputQ.ki.wVk = 0;
- inputQ.ki.dwExtraInfo = 0;
- inputQ.ki.wScan = 0x10;
- inputQ.ki.dwFlags = KEYEVENTF_SCANCODE;
- SendInput(1, &inputQ, sizeof(inputQ));
- inputQ.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
- SendInput(1, &inputQ, sizeof(inputQ));
- Sleep(50);
- inputQ.ki.dwFlags = KEYEVENTF_SCANCODE;
- SendInput(1, &inputQ, sizeof(inputQ));
- inputQ.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
- SendInput(1, &inputQ, sizeof(inputQ));
- Sleep(100);
- }
- DWORD GetEntityForWeaponId(int mIndex)
- {
- DWORD dwEntity;
- ReadProcessMemory(hProcess, clientBase + entityList + ((mIndex-1) * 0x10), &dwEntity, sizeof(dwEntity), 0);
- return dwEntity;
- }
- void GetWeaponClass(int weaponId)
- {
- if(weaponId == weapon_deagle || weaponId == weapon_elite || weaponId == weapon_fiveseven || weaponId == weapon_glock
- || weaponId == weapon_usps || weaponId == weapon_tec9
- || weaponId == weapon_zeus || weaponId == weapon_p2000 || weaponId == weapon_p250)
- {
- weaponClass = "pistol";
- }
- else if(weaponId == weapon_ak47 || weaponId == weapon_m4a4 || weaponId == weapon_aug || weaponId == weapon_famas || weaponId == weapon_sg553
- || weaponId == weapon_galil || weaponId == weapon_m249
- || weaponId == weapon_m4a1s || weaponId == weapon_mac10
- || weaponId == weapon_mp5sd || weaponId == weapon_p90
- || weaponId == weapon_ump45
- || weaponId == weapon_bizon || weaponId == weapon_negev || weaponId == weapon_mp7
- || weaponId == weapon_mp9)
- {
- weaponClass = "rifle";
- }
- else if(weaponId == weapon_awp || weaponId == weapon_ssg08 || weaponId == weapon_ssg08)
- {
- weaponClass = "sniper";
- }
- else if(weaponId == weaponId == weapon_scar20 || weaponId == weapon_g3sg1)
- {
- weaponClass = "autosniper";
- }
- else if(weaponId == weapon_xm1014 || weaponId == weapon_mag7 || weaponId == weapon_sawedoff || weaponId == weapon_nova)
- {
- weaponClass = "shotgun";
- }
- else if(weaponId == weapon_knifegg || weaponId == weapon_knife || weaponId == weapon_flashbang || weaponId == weapon_hegrenade
- || weaponId == weapon_smokegrenade || weaponId == weapon_molotov || weaponId == weapon_decoy
- || weaponId == weapon_inc || weaponId == weapon_c4 || weaponId == weapon_knife_t)
- {
- weaponClass = "none";
- }
- }
- void GetWeaponId()
- {
- DWORD local;
- ReadProcessMemory(hProcess, clientBase + localPlayer, &local, sizeof(local), 0);
- DWORD hActiveWeapon;
- ReadProcessMemory(hProcess, (LPVOID)(local + activeWeapon), &hActiveWeapon, sizeof(hActiveWeapon), 0);
- int mIndex = hActiveWeapon & 0xFFF;
- ReadProcessMemory(hProcess, (LPVOID)(GetEntityForWeaponId(mIndex) + 0x2FAA), &weaponId, sizeof(short), 0); //"DT_BaseCombatWeapon->m_iItemDefinit?ionIndex"?
- if(weaponId == lastWeaponId)
- {
- changedWeapon = false;
- }
- else
- {
- lastWeaponId = weaponId;
- changedWeapon = true;
- cout << weaponId << flush << endl << endl;
- GetWeaponClass(weaponId);
- }
- }
- void TriggerbotLoop(scanplayer player)
- {
- for(int i=1; i<64; i++)
- {
- buffer = 0; //Reset buffer
- ReadProcessMemory(hProcess, clientBase + entityList + i*nextPlayer, &buffer, 4, 0); //Get next player in EntityList
- if(buffer == 0) continue; //If there's none, get the next player
- ReadProcessMemory(hProcess, (LPVOID)(buffer + playerId), &player.id, 4, 0); //Get player's id
- ReadProcessMemory(hProcess, (LPVOID)(buffer + team), &player.team, 4, 0); //Get player's team
- if(player.id == crosshairId) //Compare player's team and ID with main player's team and crosshair ID
- {
- if(player.team != mainTeam) //If they're not in the same team
- {
- if((toggle || hold) && !noneMode) //If trigger is ON
- {
- if(pistolMode)
- {
- ReadProcessMemory(hProcess, clientBase + localPlayer, &buffer, 4, 0); //Get localPlayer pointer
- ReadProcessMemory(hProcess, (LPVOID)(buffer + moveOffset), &moving, 4, 0); //Check if moving
- ReadProcessMemory(hProcess, (LPVOID)(buffer + jumpOffset), &jumping, 4, 0); //Check if jumping/falling etc.
- buffer = 0;
- if(!intervals.pistolMoving)
- {
- if(!moving && !jumping)
- {
- SendInput(1, &inputShoot, sizeof(inputShoot)); //Shoot
- Sleep(intervals.pistols);
- }
- }
- else
- {
- SendInput(1, &inputShoot, sizeof(inputShoot)); //Shoot
- Sleep(intervals.pistols);
- }
- }
- if(rifleMode)
- {
- ReadProcessMemory(hProcess, clientBase + localPlayer, &buffer, 4, 0); //Get localPlayer pointer
- ReadProcessMemory(hProcess, (LPVOID)(buffer + moveOffset), &moving, 4, 0); //Check if moving
- ReadProcessMemory(hProcess, (LPVOID)(buffer + jumpOffset), &jumping, 4, 0); //Check if jumping/falling etc.
- buffer = 0;
- if(!intervals.rifleMoving)
- {
- if(!moving && !jumping)
- {
- SendInput(1, &inputShoot, sizeof(inputShoot)); //Shoot
- Sleep(intervals.rifles);
- }
- }
- else
- {
- SendInput(1, &inputShoot, sizeof(inputShoot)); //Shoot
- Sleep(intervals.rifles);
- }
- }
- if(shotgunMode)
- {
- ReadProcessMemory(hProcess, clientBase + localPlayer, &buffer, 4, 0); //Get localPlayer pointer
- ReadProcessMemory(hProcess, (LPVOID)(buffer + moveOffset), &moving, 4, 0); //Check if moving
- ReadProcessMemory(hProcess, (LPVOID)(buffer + jumpOffset), &jumping, 4, 0); //Check if jumping/falling etc.
- buffer = 0;
- if(!intervals.shotgunMoving)
- {
- if(!moving && !jumping)
- {
- SendInput(1, &inputShoot, sizeof(inputShoot)); //Shoot
- Sleep(intervals.shotguns);
- }
- }
- else
- {
- SendInput(1, &inputShoot, sizeof(inputShoot)); //Shoot
- Sleep(intervals.shotguns);
- }
- }
- if(sniperMode)
- {
- ReadProcessMemory(hProcess, clientBase + localPlayer, &buffer, 4, 0); //Get localPlayer pointer
- ReadProcessMemory(hProcess, (LPVOID)(buffer + scopedOffset), &scoped, 4, 0); //Check if scoped
- ReadProcessMemory(hProcess, (LPVOID)(buffer + moveOffset), &moving, 4, 0); //Check if moving
- ReadProcessMemory(hProcess, (LPVOID)(buffer + jumpOffset), &jumping, 4, 0); //Check if jumping/falling etc.
- buffer = 0;
- if(scoped && !moving && !jumping)
- {
- Sleep(10);
- SendInput(1, &inputShoot, sizeof(inputShoot)); //Shoot
- QScript();
- Sleep(intervals.snipers);
- }
- }
- if(autoSniperMode)
- {
- ReadProcessMemory(hProcess, clientBase + localPlayer, &buffer, 4, 0); //Get localPlayer pointer
- ReadProcessMemory(hProcess, (LPVOID)(buffer + scopedOffset), &scoped, 4, 0); //Check if scoped
- ReadProcessMemory(hProcess, (LPVOID)(buffer + moveOffset), &moving, 4, 0); //Check if moving
- ReadProcessMemory(hProcess, (LPVOID)(buffer + jumpOffset), &jumping, 4, 0); //Check if jumping/falling etc.
- buffer = 0;
- if(scoped && !moving && !jumping)
- {
- Sleep(10);
- SendInput(1, &inputShoot, sizeof(inputShoot)); //Shoot
- Sleep(intervals.autosnipers);
- }
- }
- }
- }
- }
- }
- }
- void GetPlayerInfo()
- {
- crosshairId = 0; //Reset crosshair ID
- ReadProcessMemory(hProcess, clientBase + localPlayer, &buffer, 4, 0); //Get localPlayer pointer
- ReadProcessMemory(hProcess, (LPVOID)(buffer + team), &mainTeam, 4, 0); //Get player team from localPlayer
- ReadProcessMemory(hProcess, (LPVOID)(buffer + crosshair), &crosshairId, 4, 0); //Get crosshair ID from localPlayer
- }
- void ScreenText()
- {
- string info;
- string status = "Status: ";
- string mode = " | Mode: ";
- string shootInterval = " | Interval: ";
- string whileRunning = " | Shoot while running: ";
- info += status;
- if(toggle) info += "ON";
- else info += "OFF";
- info += mode;
- if(pistolMode) info += "PISTOLS";
- if(rifleMode) info += "RIFLES";
- if(sniperMode) info += "SNIPERS";
- if(autoSniperMode) info += "AUTO-SNIPERS";
- if(shotgunMode) info += "SHOTGUNS";
- if(noneMode) info += "NONE";
- info += shootInterval;
- if(pistolMode) info += to_string(intervals.pistols);
- if(rifleMode) info += to_string(intervals.rifles);
- if(sniperMode) info += to_string(intervals.snipers);
- if(autoSniperMode) info += to_string(intervals.autosnipers);
- if(shotgunMode) info += to_string(intervals.shotguns);
- if(noneMode) info += "NONE";
- info += whileRunning;
- if(pistolMode)
- {
- if(intervals.pistolMoving) info += "TRUE";
- else info += "FALSE";
- }
- if(rifleMode)
- {
- if(intervals.rifleMoving) info += "TRUE";
- else info += "FALSE";
- }
- if(shotgunMode)
- {
- if(intervals.shotgunMoving) info += "TRUE";
- else info += "FALSE";
- }
- if(sniperMode) info += "N/A";
- if(autoSniperMode) info += "N/A";
- if(noneMode) info += "N/A";
- const char *message = info.c_str();
- //TextOut(hDc, 0, 0, message, info.length());
- GetWindowRect(csWindow, &rc);
- DrawText(hDc, message, info.length(), &rc, DT_LEFT);
- }
- void CheckProcess()
- {
- HWND focus = GetForegroundWindow();
- GetWindowThreadProcessId(focus, ¤tId);
- if(currentId != processId)
- {
- manualGui = false;
- showGui = false;
- }
- else
- {
- if(manualGui);
- else showGui = true;
- }
- }
- int main()
- {
- SetConsoleTitle("SIMPLE Tool by B3liar"); //Self explanatory
- hWindow = GetConsoleWindow(); //Get handle of console window for MessageBox()
- config intervals;
- LoadOffsets();
- LoadControls();
- LoadIntervals(); //Load interval values from a file
- DefineMouseInput(); //Define mouse input for auto-shooting
- processId = GetPid("csgo.exe"); //Get CS:GO process ID
- if(processId == NULL) //Check if CS:GO is open
- {
- MessageBox(hWindow, "Please run this tool then csgo is running.", "Simple tool", MB_OK | MB_ICONINFORMATION); //Display a message
- exit(0);
- }
- csWindow = FindWindow(0, "Counter-Strike: Global Offensive");
- drawWindow = CreateWindowEx(WS_EX_TOPMOST, "WindowClass", "WindowName", WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
- CW_USEDEFAULT, csWindow, NULL, NULL, NULL);
- hDc = GetDC(drawWindow);
- hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, processId); //Open CS:GO process
- clientBase = GetModuleAddress(hProcess, "client_panorama.dll"); //Get address of client.dll
- color(15);
- PrintInfo(); //Self explanatory
- scanplayer player; //Create a player structure
- while(true)
- {
- Sleep(1);
- CheckProcess();
- if(showGui) ScreenText();
- GetWeaponId();
- CheckKeys(); //Check for key presses
- GetPlayerInfo(); //Get main player's team and crosshair ID
- TriggerbotLoop(player); //Get all players' ids and teams, compare with main player's
- }
- CloseHandle(hProcess); //close CS:GO process
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement