SHARE
TWEET

Untitled

a guest Oct 22nd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <windows.h>
  2. #include <iostream>
  3. #include <psapi.h>
  4. #include <tlhelp32.h>
  5. #include <conio.h>
  6. #include <fstream>
  7.  
  8. using namespace std;
  9.  
  10. enum CSGO_Weapon_ID
  11. {
  12.     weapon_none = 0,
  13.     weapon_deagle,
  14.     weapon_elite,
  15.     weapon_fiveseven,
  16.     weapon_glock,
  17.     weapon_ak47 = 7,
  18.     weapon_aug,
  19.     weapon_awp,
  20.     weapon_famas,
  21.     weapon_g3sg1,
  22.     weapon_galil = 13,
  23.     weapon_m249,
  24.     weapon_m4a4 = 16,
  25.     weapon_mac10,
  26.     weapon_p90 = 19,
  27.     weapon_mp5sd = 23,
  28.     weapon_ump45,
  29.     weapon_xm1014,
  30.     weapon_bizon,
  31.     weapon_mag7,
  32.     weapon_negev,
  33.     weapon_sawedoff,
  34.     weapon_tec9,
  35.     weapon_zeus,
  36.     weapon_p2000,
  37.     weapon_mp7,
  38.     weapon_mp9,
  39.     weapon_nova,
  40.     weapon_p250,
  41.     weapon_shield,
  42.     weapon_scar20,
  43.     weapon_sg553,
  44.     weapon_ssg08,
  45.     weapon_knifegg,
  46.     weapon_knife,
  47.     weapon_flashbang,
  48.     weapon_hegrenade,
  49.     weapon_smokegrenade,
  50.     weapon_molotov,
  51.     weapon_decoy,
  52.     weapon_inc,
  53.     weapon_c4,
  54.     weapon_healthshot = 57,
  55.     weapon_knife_t = 59,
  56.     weapon_m4a1s,
  57.     weapon_usps,
  58.     weapon_cz75 = 63,
  59.     weapon_revolver,
  60. };
  61.  
  62. string weaponClass;
  63.  
  64. //-----------------------------------------------------------------
  65. //GLOBAL VARIABLES:
  66.  
  67. string shootIntervalS, temp, pistols, rifles;
  68. int shootInterval;
  69.  
  70. int weaponId = 0;
  71. int lastWeaponId = 0;
  72. int mainTeam = 0;
  73. int buffer = 0;
  74. int crosshairId = 0;
  75. int scoped = 0;
  76. int moving = 0;
  77. int jumping = 0;
  78. bool toggle = false;
  79. bool hold = false;
  80. bool changedWeapon = false;
  81. bool showGui = true;
  82. bool manualGui = false;
  83.  
  84. bool pistolMode = false;
  85. bool rifleMode = true;
  86. bool sniperMode = false;
  87. bool autoSniperMode = false;
  88. bool shotgunMode = false;
  89. bool noneMode = false;
  90.  
  91. DWORD processId, currentId;
  92.  
  93. string accuracyPenaltyS;
  94. string activeWeaponS;
  95. string moveOffsetS;
  96. string jumpOffsetS;
  97. string scopedOffsetS;
  98. string entityListS;
  99. string localPlayerS;
  100. string nextPlayerS;
  101. string teamS;
  102. string crosshairS;
  103. string playerIdS;
  104.  
  105. LPVOID clientBase;
  106. int accuracyPenalty;
  107. int activeWeapon;
  108. int weaponOffset;
  109. int moveOffset;
  110. int jumpOffset;
  111. int scopedOffset;
  112. int entityList;
  113. int localPlayer;
  114. int nextPlayer;
  115. int team;
  116. int crosshair;
  117. int playerId;
  118.  
  119. fstream interval;
  120. fstream control;
  121. fstream offset;
  122.  
  123. INPUT inputShoot, inputQ;
  124. HWND hWindow, csWindow, drawWindow;
  125. RECT rc;
  126. HDC hDc;
  127. HANDLE hProcess;
  128.  
  129. //PLAYER SCRUCTURE:
  130. struct scanplayer {
  131.     int team;
  132.     int id;
  133. };
  134.  
  135. //INTERVAL STRUCTURE:
  136. struct config {
  137.     string pistolsS;
  138.     string riflesS;
  139.     string snipersS;
  140.     string autosnipersS;
  141.     string shotgunsS;
  142.     int pistols;
  143.     int rifles;
  144.     int snipers;
  145.     int autosnipers;
  146.     int shotguns;
  147.    
  148.     string pistolMovingS;
  149.     string rifleMovingS;
  150.     string shotgunMovingS;
  151.     bool pistolMoving = false;
  152.     bool rifleMoving = false;
  153.     bool shotgunMoving = false;
  154.    
  155.     bool pistolMovingD = true;
  156.     bool rifleMovingD = false;
  157.     bool shotgunMovingD = true;
  158.    
  159.     int pistolsD = 500;
  160.     int riflesD = 150;
  161.     int snipersD = 0;
  162.     int autosnipersD = 100;
  163.     int shotgunsD = 50;
  164. };
  165.  
  166. config intervals;
  167.  
  168. //-----------------------------------------------------------------
  169. //FUNCTIONS:
  170.  
  171. string onOffS, holdOnS, defaultsS, addIS, removeIS, quitS, showHideS, shootMovingS;
  172. int onOff, holdOn, defaults, addI, removeI, quit, showHide, shootMoving;
  173.  
  174. void color(int color)
  175. {
  176.     SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color | FOREGROUND_INTENSITY);
  177. }
  178.  
  179. void LoadOffsets()
  180. {
  181.     offset.open("offsets.ini", ios::in);
  182.    
  183.     if(!offset.good()) //Check if file exists
  184.     {
  185.         MessageBox(hWindow, "Please make sure your offsets.ini file exists!", "Simple Tool", MB_OK | MB_ICONINFORMATION);
  186.         exit(0);
  187.     }
  188.    
  189.     getline(offset, temp);
  190.     getline(offset, accuracyPenaltyS);
  191.     getline(offset, temp);
  192.     getline(offset, activeWeaponS);
  193.     getline(offset, temp);
  194.     getline(offset, moveOffsetS);
  195.     getline(offset, temp);
  196.     getline(offset, jumpOffsetS);
  197.     getline(offset, temp);
  198.     getline(offset, scopedOffsetS);
  199.     getline(offset, temp);
  200.     getline(offset, entityListS);
  201.     getline(offset, temp);
  202.     getline(offset, localPlayerS);
  203.     getline(offset, temp);
  204.     getline(offset, nextPlayerS);
  205.     getline(offset, temp);
  206.     getline(offset, teamS);
  207.     getline(offset, temp);
  208.     getline(offset, crosshairS);
  209.     getline(offset, temp);
  210.     getline(offset, playerIdS);
  211.    
  212.     accuracyPenalty = strtoul(accuracyPenaltyS.c_str(), NULL, 16);
  213.     activeWeapon = strtoul(activeWeaponS.c_str(), NULL, 16);
  214.     moveOffset = strtoul(moveOffsetS.c_str(), NULL, 16);
  215.     jumpOffset = strtoul(jumpOffsetS.c_str(), NULL, 16);
  216.     scopedOffset = strtoul(scopedOffsetS.c_str(), NULL, 16);
  217.     entityList = strtoul(entityListS.c_str(), NULL, 16);
  218.     localPlayer = strtoul(localPlayerS.c_str(), NULL, 16);
  219.     nextPlayer = strtoul(nextPlayerS.c_str(), NULL, 16);
  220.     team = strtoul(teamS.c_str(), NULL, 16);
  221.     crosshair = strtoul(crosshairS.c_str(), NULL, 16);
  222.     playerId = strtoul(playerIdS.c_str(), NULL, 16);
  223.     weaponOffset = 0 ;
  224.    
  225.     offset.close();
  226. }
  227.  
  228. void LoadControls()
  229. {
  230.     control.open("controls.ini", ios::in);
  231.    
  232.     if(!control.good()) //Check if file exists
  233.     {
  234.         MessageBox(hWindow, "Please make sure your controls.ini file exists!", "Simple Toll", MB_OK | MB_ICONINFORMATION);
  235.         exit(0);
  236.     }
  237.    
  238.     getline(control, temp);
  239.     getline(control, temp);
  240.     getline(control, onOffS);
  241.     getline(control, temp);
  242.     getline(control, holdOnS);
  243.     getline(control, temp);
  244.     getline(control, quitS);
  245.     getline(control, temp);
  246.     getline(control, showHideS);
  247.     getline(control, temp);
  248.     getline(control, addIS);
  249.     getline(control, temp);
  250.     getline(control, removeIS);
  251.     getline(control, temp);
  252.     getline(control, shootMovingS);
  253.     getline(control, temp);
  254.     getline(control, defaultsS);
  255.    
  256.     onOff = strtoul(onOffS.c_str(), NULL, 16);
  257.     holdOn = strtoul(holdOnS.c_str(), NULL, 16);
  258.     quit = strtoul(quitS.c_str(), NULL, 16);
  259.     showHide = strtoul(showHideS.c_str(), NULL, 16);
  260.     addI = strtoul(addIS.c_str(), NULL, 16);
  261.     removeI = strtoul(removeIS.c_str(), NULL, 16);
  262.     shootMoving = strtoul(shootMovingS.c_str(), NULL, 16);
  263.     defaults = strtoul(defaultsS.c_str(), NULL, 16);
  264.    
  265.     control.close();
  266. }
  267.  
  268. LPVOID GetModuleAddress(HANDLE hProcess, string toFind)
  269. {
  270.         LPVOID address;
  271.         DWORD cbNeeded;
  272.         HMODULE hModules[1024];
  273.        
  274.         EnumProcessModulesEx(hProcess, hModules, sizeof(hModules), &cbNeeded, LIST_MODULES_ALL);
  275.        
  276.         string stringModuleName;
  277.        
  278.         for(int i=0; i<(cbNeeded / sizeof(HMODULE)); i++)
  279.         {
  280.                 TCHAR moduleName[MAX_PATH];
  281.                
  282.                 GetModuleFileNameEx(hProcess, hModules[i], moduleName, sizeof(moduleName) / sizeof(TCHAR));
  283.                 stringModuleName = moduleName;
  284.                
  285.                 if(stringModuleName.find(toFind) != string::npos)
  286.                 {
  287.                         address = hModules[i];
  288.                 }
  289.         }      
  290.        
  291.         return address;
  292. }
  293.  
  294. DWORD GetPid(char processName[])
  295. {
  296.     DWORD processId = NULL;
  297.     PROCESSENTRY32 pe32;
  298.     pe32.dwSize = sizeof(PROCESSENTRY32);
  299.    
  300.     HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
  301.  
  302.     if(Process32First(hSnapshot, &pe32))
  303.     {
  304.         do
  305.         {
  306.             if(stricmp(pe32.szExeFile, processName) == 0)
  307.             {
  308.                 processId = pe32.th32ProcessID;
  309.                 return processId;
  310.             }  
  311.            
  312.         } while(Process32Next(hSnapshot, &pe32));
  313.     }
  314.    
  315.     return processId;
  316. }
  317.  
  318. void PrintInfo()
  319. {
  320.     system("cls");
  321.     cout << "TOOL!" << endl;
  322.     cout << "Press INSERT to toggle ON/OFF. Hold ALT to toggle ON. Press DEL to exit. \nPress HOME to SHOW/HIDE GUI" << endl;
  323.     cout << "You must have WINDOWED or FULLSCREEN WINDOWED for GUI to work." << endl << endl;
  324.     cout << "Press NUMPAD 5 to ENABLE/DISABLE shoot while moving for current mode." << endl;
  325.     cout << "Press NUMPAD +/- to ADD/SUBTRACT interval for current mode." << endl;
  326.     cout << "Press NUMPAD 0 to reset to defaults." << endl << endl;
  327.     cout << "Status: "; if(toggle) { color(2); cout << "ON"; } else { color(4); cout << "OFF"; } cout << endl; color(15);
  328.     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);
  329.     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);
  330.    
  331.     cout << "Shoot while running: "; color(2);
  332.     if(pistolMode)
  333.     {
  334.         if(intervals.pistolMoving) cout << "TRUE";
  335.         else cout << "FALSE";
  336.     }
  337.     if(rifleMode)
  338.     {
  339.         if(intervals.rifleMoving) cout << "TRUE";
  340.         else cout << "FALSE";
  341.     }
  342.     if(shotgunMode)
  343.     {
  344.         if(intervals.shotgunMoving) cout << "TRUE";
  345.         else cout << "FALSE";
  346.     }
  347.     if(sniperMode) cout << "N/A";
  348.     if(autoSniperMode) cout << "N/A";
  349.     if(noneMode) cout << "N/A";
  350.     cout << endl;
  351.     color(15);
  352. }
  353.  
  354. void LoadIntervals()
  355. {
  356.     interval.open("config.ini", ios::in); //Open file for reading
  357.    
  358.     if(!interval.good()) //Check if file exists
  359.     {
  360.         MessageBox(hWindow, "Please make sure your config.ini file exists!", "SIMPLE TOOL", MB_OK | MB_ICONINFORMATION);
  361.         exit(0);
  362.     }
  363.    
  364.     //Get values from file
  365.     getline(interval, temp);
  366.     getline(interval, temp);
  367.     getline(interval, temp);
  368.     getline(interval, intervals.pistolsS);
  369.     getline(interval, intervals.pistolMovingS);
  370.     getline(interval, temp);
  371.     getline(interval, intervals.riflesS);
  372.     getline(interval, intervals.rifleMovingS);
  373.     getline(interval, temp);
  374.     getline(interval, intervals.snipersS);
  375.     getline(interval, temp);
  376.     getline(interval, intervals.autosnipersS);
  377.     getline(interval, temp);
  378.     getline(interval, intervals.shotgunsS);
  379.     getline(interval, intervals.shotgunMovingS);
  380.    
  381.     if(intervals.pistolMovingS == "TRUE") intervals.pistolMoving = true;
  382.     else intervals.pistolMoving = false;
  383.    
  384.     if(intervals.rifleMovingS == "TRUE") intervals.rifleMoving = true;
  385.     else intervals.rifleMoving = false;
  386.    
  387.     if(intervals.shotgunMovingS == "TRUE") intervals.shotgunMoving = true;
  388.     else intervals.shotgunMoving = false;
  389.    
  390.     intervals.pistols = atoi(intervals.pistolsS.c_str());
  391.     intervals.rifles = atoi(intervals.riflesS.c_str());
  392.     intervals.snipers = atoi(intervals.snipersS.c_str());
  393.     intervals.autosnipers = atoi(intervals.autosnipersS.c_str());
  394.     intervals.shotguns = atoi(intervals.shotgunsS.c_str());
  395.    
  396.     interval.close(); //Close  file
  397. }
  398.  
  399. void SaveConfig()
  400. {
  401.     interval.open("config.ini", ios::out);
  402.    
  403.     if(!interval.good()) //Check if file exists
  404.     {
  405.         MessageBox(hWindow, "Please make sure your config.ini file exists!", "SIMPLE TOOL", MB_OK | MB_ICONINFORMATION);
  406.         exit(0);
  407.     }
  408.    
  409.     interval << "#Time between every shot in milliseconds (minimum 20 for pistols, minimum 0 for other)." << endl;
  410.     interval << "#TRUE/FALSE = shoot while running." << endl;
  411.     interval << "#Pistols:" << endl;
  412.     interval << intervals.pistols << endl;
  413.     if(intervals.pistolMoving) interval << "TRUE" << endl;
  414.     else interval << "FALSE" << endl;
  415.     interval << "#Rifles:" << endl;
  416.     interval << intervals.rifles << endl;
  417.     if(intervals.rifleMoving) interval << "TRUE" << endl;
  418.     else interval << "FALSE" << endl;
  419.     interval << "#Snipers:" << endl;
  420.     interval << intervals.snipers << endl;
  421.     interval << "#Auto-Snipers:" << endl;
  422.     interval << intervals.autosnipers << endl;
  423.     interval << "#Shotguns:" << endl;
  424.     interval << intervals.shotguns << endl;
  425.     if(intervals.shotgunMoving) interval << "TRUE" << endl;
  426.     else interval << "FALSE";
  427.    
  428.     interval.close();
  429. }
  430.  
  431. void CheckKeys()
  432. {
  433.  
  434.     if(GetAsyncKeyState(holdOn))
  435.     {
  436.         hold = true;
  437.     }
  438.     else
  439.     {
  440.         if(!toggle) hold = false;
  441.     }
  442.    
  443.     if(GetAsyncKeyState(onOff) & 1) //Check for INSERT
  444.     {
  445.         toggle = !toggle;
  446.         Beep(200, 100);
  447.         PrintInfo();
  448.     }
  449.     if(GetAsyncKeyState(showHide) & 1) //Check for INSERT
  450.     {
  451.         manualGui = true;
  452.         showGui = !showGui;
  453.         Beep(200, 100);
  454.     }
  455.    
  456.     if(GetAsyncKeyState(quit) & 1)  exit(0); //Check for DELETE
  457.    
  458.     if(weaponClass == "pistol" && changedWeapon) //Check for 1
  459.     {
  460.         pistolMode = true;
  461.         rifleMode = false;
  462.         sniperMode = false;
  463.         autoSniperMode = false;
  464.         shotgunMode = false;
  465.         noneMode = false;
  466.         PrintInfo();
  467.     }
  468.     if(weaponClass == "rifle" && changedWeapon) //Check for 2
  469.     {
  470.         pistolMode = false;
  471.         rifleMode = true;
  472.         sniperMode = false;
  473.         autoSniperMode = false;
  474.         shotgunMode = false;
  475.         noneMode = false;
  476.         PrintInfo();
  477.     }
  478.     if(weaponClass == "sniper" && changedWeapon) //Check for 3
  479.     {
  480.         pistolMode = false;
  481.         rifleMode = false;
  482.         sniperMode = true;
  483.         autoSniperMode = false;
  484.         shotgunMode = false;
  485.         noneMode = false;
  486.         PrintInfo();
  487.     }
  488.     if(weaponClass == "autosniper" && changedWeapon) //Check for 3
  489.     {
  490.         pistolMode = false;
  491.         rifleMode = false;
  492.         sniperMode = false;
  493.         autoSniperMode = true;
  494.         shotgunMode = false;
  495.         noneMode = false;
  496.         PrintInfo();
  497.     }
  498.     if(weaponClass == "shotgun" && changedWeapon) //Check for 3
  499.     {
  500.         pistolMode = false;
  501.         rifleMode = false;
  502.         sniperMode = false;
  503.         autoSniperMode = false;
  504.         shotgunMode = true;
  505.         noneMode = false;
  506.         PrintInfo();
  507.     }
  508.     if(weaponClass == "none" && changedWeapon) //Check for 3
  509.     {
  510.         pistolMode = false;
  511.         rifleMode = false;
  512.         sniperMode = false;
  513.         autoSniperMode = false;
  514.         shotgunMode = false;
  515.         noneMode = true;
  516.         PrintInfo();
  517.     }
  518.     if(GetAsyncKeyState(shootMoving) & 1) //Check for 3
  519.     {
  520.         Beep(200, 100);
  521.         if(pistolMode) intervals.pistolMoving = !intervals.pistolMoving;
  522.         if(rifleMode) intervals.rifleMoving = !intervals.rifleMoving;
  523.         if(shotgunMode) intervals.shotgunMoving = !intervals.shotgunMoving;
  524.        
  525.         SaveConfig();
  526.         PrintInfo();
  527.     }
  528.     if(GetAsyncKeyState(defaults) & 1) //Check for 3
  529.     {
  530.         Beep(200, 100);
  531.         int lastMode;
  532.        
  533.         if(pistolMode) lastMode = 0;
  534.         if(rifleMode) lastMode = 1;
  535.         if(sniperMode) lastMode = 2;
  536.         if(autoSniperMode) lastMode = 3;
  537.         if(shotgunMode) lastMode = 4;
  538.         if(noneMode) lastMode = 5;
  539.        
  540.         pistolMode = false;
  541.         rifleMode = false;
  542.         sniperMode = false;
  543.         autoSniperMode = false;
  544.         shotgunMode = false;
  545.         noneMode = false;
  546.        
  547.         intervals.pistols = intervals.pistolsD;
  548.         intervals.rifles = intervals.riflesD;
  549.         intervals.snipers = intervals.snipersD;
  550.         intervals.autosnipers = intervals.autosnipersD;
  551.         intervals.shotguns = intervals.shotgunsD;
  552.        
  553.         intervals.pistolMoving = intervals.pistolMovingD;
  554.         intervals.rifleMoving = intervals.rifleMovingD;
  555.         intervals.shotgunMoving = intervals.shotgunMovingD;
  556.        
  557.         if(lastMode == 0) pistolMode = true;
  558.         if(lastMode == 1) rifleMode = true;
  559.         if(lastMode == 2) sniperMode = true;
  560.         if(lastMode == 3) autoSniperMode = true;
  561.         if(lastMode == 4) shotgunMode = true;
  562.         if(lastMode == 5) noneMode = true;
  563.        
  564.         SaveConfig();
  565.         PrintInfo();
  566.     }
  567.     if(GetAsyncKeyState(addI) & 1) //Check for +
  568.     {
  569.         Beep(200, 100);
  570.         if(pistolMode) intervals.pistols += 50;
  571.         if(rifleMode) intervals.rifles += 50;
  572.         if(sniperMode) intervals.snipers += 50;
  573.         if(autoSniperMode) intervals.autosnipers += 50;
  574.         if(shotgunMode) intervals.shotguns += 50;
  575.        
  576.         if(intervals.pistols < 20) intervals.pistols = 20;
  577.         if(intervals.rifles < 0) intervals.rifles = 0;
  578.         if(intervals.snipers < 0) intervals.snipers = 0;
  579.         if(intervals.autosnipers < 50) intervals.autosnipers = 50;
  580.         if(intervals.shotguns < 0) intervals.shotguns = 0;
  581.        
  582.         SaveConfig();
  583.         PrintInfo();
  584.     }
  585.     if(GetAsyncKeyState(removeI) & 1) //check for -
  586.     {
  587.         Beep(200, 100);
  588.         if(pistolMode) intervals.pistols -= 50;
  589.         if(rifleMode) intervals.rifles -= 50;
  590.         if(sniperMode) intervals.snipers -= 50;
  591.         if(autoSniperMode) intervals.autosnipers -= 50;
  592.         if(shotgunMode) intervals.shotguns -= 50;
  593.        
  594.         if(intervals.pistols < 20) intervals.pistols = 20;
  595.         if(intervals.rifles < 0) intervals.rifles = 0;
  596.         if(intervals.snipers < 0) intervals.snipers = 0;
  597.         if(intervals.autosnipers < 50) intervals.autosnipers = 50;
  598.         if(intervals.shotguns < 0) intervals.shotguns = 0;
  599.        
  600.         SaveConfig();
  601.         PrintInfo();
  602.     }
  603. }
  604.  
  605. void DefineMouseInput()
  606. {
  607.     inputShoot = {0}; //Set the input variable
  608.     inputShoot.type = INPUT_MOUSE; //Define input type
  609.     inputShoot.mi.dwFlags = MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP; //Define input flags
  610. }
  611.  
  612. void QScript()
  613. {
  614.     Sleep(100);
  615.    
  616.     inputQ.type = INPUT_KEYBOARD;
  617.     inputQ.ki.time = 0;
  618.     inputQ.ki.wVk = 0;
  619.     inputQ.ki.dwExtraInfo = 0;
  620.    
  621.     inputQ.ki.wScan = 0x10;
  622.    
  623.     inputQ.ki.dwFlags = KEYEVENTF_SCANCODE;
  624.     SendInput(1, &inputQ, sizeof(inputQ));
  625.    
  626.     inputQ.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
  627.     SendInput(1, &inputQ, sizeof(inputQ));
  628.    
  629.     Sleep(50);
  630.    
  631.     inputQ.ki.dwFlags = KEYEVENTF_SCANCODE;
  632.     SendInput(1, &inputQ, sizeof(inputQ));
  633.    
  634.     inputQ.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
  635.     SendInput(1, &inputQ, sizeof(inputQ));
  636.    
  637.     Sleep(100);
  638. }
  639.  
  640. DWORD GetEntityForWeaponId(int mIndex)
  641. {
  642.     DWORD dwEntity;
  643.     ReadProcessMemory(hProcess, clientBase + entityList + ((mIndex-1) * 0x10), &dwEntity, sizeof(dwEntity), 0);
  644.     return dwEntity;
  645. }
  646.  
  647. void GetWeaponClass(int weaponId)
  648. {
  649.     if(weaponId == weapon_deagle || weaponId == weapon_elite || weaponId == weapon_fiveseven || weaponId == weapon_glock
  650.                                  || weaponId == weapon_usps || weaponId == weapon_tec9
  651.                                 || weaponId == weapon_zeus || weaponId == weapon_p2000 || weaponId == weapon_p250)
  652.     {
  653.         weaponClass = "pistol";
  654.     }
  655.     else if(weaponId == weapon_ak47 || weaponId == weapon_m4a4 || weaponId == weapon_aug || weaponId == weapon_famas || weaponId == weapon_sg553
  656.                                      || weaponId == weapon_galil || weaponId == weapon_m249
  657.                                        || weaponId == weapon_m4a1s || weaponId == weapon_mac10
  658.                                        || weaponId == weapon_mp5sd || weaponId == weapon_p90
  659.                                          || weaponId == weapon_ump45
  660.                                          || weaponId == weapon_bizon || weaponId == weapon_negev || weaponId == weapon_mp7
  661.                                           || weaponId == weapon_mp9)
  662.     {
  663.         weaponClass = "rifle";
  664.     }
  665.     else if(weaponId == weapon_awp || weaponId == weapon_ssg08 || weaponId == weapon_ssg08)
  666.     {
  667.         weaponClass = "sniper";
  668.     }
  669.     else if(weaponId == weaponId == weapon_scar20 || weaponId == weapon_g3sg1)
  670.     {
  671.         weaponClass = "autosniper";
  672.     }
  673.     else if(weaponId == weapon_xm1014 || weaponId == weapon_mag7 || weaponId == weapon_sawedoff || weaponId == weapon_nova)
  674.     {
  675.         weaponClass = "shotgun";
  676.     }
  677.    
  678.     else if(weaponId == weapon_knifegg || weaponId == weapon_knife || weaponId == weapon_flashbang || weaponId == weapon_hegrenade
  679.                                          || weaponId == weapon_smokegrenade || weaponId == weapon_molotov || weaponId == weapon_decoy
  680.                                           || weaponId == weapon_inc || weaponId == weapon_c4 || weaponId == weapon_knife_t)
  681.     {
  682.         weaponClass = "none";
  683.     }
  684. }
  685.  
  686. void GetWeaponId()
  687. {
  688.     DWORD local;
  689.     ReadProcessMemory(hProcess, clientBase + localPlayer, &local, sizeof(local), 0);
  690.    
  691.     DWORD hActiveWeapon;
  692.     ReadProcessMemory(hProcess, (LPVOID)(local + activeWeapon), &hActiveWeapon, sizeof(hActiveWeapon), 0);
  693.     int mIndex = hActiveWeapon & 0xFFF;
  694.     ReadProcessMemory(hProcess, (LPVOID)(GetEntityForWeaponId(mIndex) + 0x2FAA), &weaponId, sizeof(short), 0); //"DT_BaseCombatWeapon->m_iItemDefinit?ionIndex"?
  695.    
  696.     if(weaponId == lastWeaponId)
  697.     {
  698.         changedWeapon = false;
  699.     }
  700.     else
  701.     {
  702.         lastWeaponId = weaponId;
  703.         changedWeapon = true;
  704.         cout << weaponId << flush << endl << endl;
  705.         GetWeaponClass(weaponId);
  706.     }
  707. }
  708.  
  709. void TriggerbotLoop(scanplayer player)
  710. {
  711.     for(int i=1; i<64; i++)
  712.     {
  713.         buffer = 0; //Reset buffer
  714.            
  715.         ReadProcessMemory(hProcess, clientBase + entityList + i*nextPlayer, &buffer, 4, 0); //Get next player in EntityList
  716.         if(buffer == 0) continue; //If there's none, get the next player
  717.    
  718.         ReadProcessMemory(hProcess, (LPVOID)(buffer + playerId), &player.id, 4, 0); //Get player's id
  719.         ReadProcessMemory(hProcess, (LPVOID)(buffer + team), &player.team, 4, 0); //Get player's team
  720.        
  721.         if(player.id == crosshairId) //Compare player's team and ID with main player's team and crosshair ID
  722.         {              
  723.             if(player.team != mainTeam) //If they're not in the same team
  724.             {
  725.                 if((toggle || hold) && !noneMode) //If trigger is ON
  726.                 {  
  727.                     if(pistolMode)
  728.                     {
  729.                         ReadProcessMemory(hProcess, clientBase + localPlayer, &buffer, 4, 0); //Get localPlayer pointer
  730.                         ReadProcessMemory(hProcess, (LPVOID)(buffer + moveOffset), &moving, 4, 0); //Check if moving
  731.                         ReadProcessMemory(hProcess, (LPVOID)(buffer + jumpOffset), &jumping, 4, 0); //Check if jumping/falling etc.
  732.                         buffer = 0;
  733.                        
  734.                         if(!intervals.pistolMoving)
  735.                         {
  736.                             if(!moving && !jumping)
  737.                             {
  738.                                 SendInput(1, &inputShoot, sizeof(inputShoot)); //Shoot
  739.                                 Sleep(intervals.pistols);
  740.                             }
  741.                         }
  742.                         else
  743.                         {
  744.                             SendInput(1, &inputShoot, sizeof(inputShoot)); //Shoot
  745.                             Sleep(intervals.pistols);
  746.                         }
  747.                     }
  748.                     if(rifleMode)
  749.                     {
  750.                         ReadProcessMemory(hProcess, clientBase + localPlayer, &buffer, 4, 0); //Get localPlayer pointer
  751.                         ReadProcessMemory(hProcess, (LPVOID)(buffer + moveOffset), &moving, 4, 0); //Check if moving
  752.                         ReadProcessMemory(hProcess, (LPVOID)(buffer + jumpOffset), &jumping, 4, 0); //Check if jumping/falling etc.
  753.                         buffer = 0;
  754.                        
  755.                         if(!intervals.rifleMoving)
  756.                         {
  757.                             if(!moving && !jumping)
  758.                             {
  759.                                 SendInput(1, &inputShoot, sizeof(inputShoot)); //Shoot
  760.                                 Sleep(intervals.rifles);
  761.                             }
  762.                         }
  763.                         else
  764.                         {
  765.                             SendInput(1, &inputShoot, sizeof(inputShoot)); //Shoot
  766.                             Sleep(intervals.rifles);
  767.                         }
  768.                     }
  769.                     if(shotgunMode)
  770.                     {
  771.                         ReadProcessMemory(hProcess, clientBase + localPlayer, &buffer, 4, 0); //Get localPlayer pointer
  772.                         ReadProcessMemory(hProcess, (LPVOID)(buffer + moveOffset), &moving, 4, 0); //Check if moving
  773.                         ReadProcessMemory(hProcess, (LPVOID)(buffer + jumpOffset), &jumping, 4, 0); //Check if jumping/falling etc.
  774.                         buffer = 0;
  775.                        
  776.                         if(!intervals.shotgunMoving)
  777.                         {
  778.                             if(!moving && !jumping)
  779.                             {
  780.                                 SendInput(1, &inputShoot, sizeof(inputShoot)); //Shoot
  781.                                 Sleep(intervals.shotguns);
  782.                             }
  783.                         }
  784.                         else
  785.                         {
  786.                             SendInput(1, &inputShoot, sizeof(inputShoot)); //Shoot
  787.                             Sleep(intervals.shotguns);
  788.                         }
  789.                     }
  790.                     if(sniperMode)
  791.                     {
  792.                         ReadProcessMemory(hProcess, clientBase + localPlayer, &buffer, 4, 0); //Get localPlayer pointer
  793.                         ReadProcessMemory(hProcess, (LPVOID)(buffer + scopedOffset), &scoped, 4, 0); //Check if scoped
  794.                         ReadProcessMemory(hProcess, (LPVOID)(buffer + moveOffset), &moving, 4, 0); //Check if moving
  795.                         ReadProcessMemory(hProcess, (LPVOID)(buffer + jumpOffset), &jumping, 4, 0); //Check if jumping/falling etc.
  796.                         buffer = 0;
  797.                        
  798.                         if(scoped && !moving && !jumping)
  799.                         {
  800.                             Sleep(10);
  801.                             SendInput(1, &inputShoot, sizeof(inputShoot)); //Shoot
  802.                             QScript();
  803.                             Sleep(intervals.snipers);
  804.                         }
  805.                     }
  806.                     if(autoSniperMode)
  807.                     {
  808.                         ReadProcessMemory(hProcess, clientBase + localPlayer, &buffer, 4, 0); //Get localPlayer pointer
  809.                         ReadProcessMemory(hProcess, (LPVOID)(buffer + scopedOffset), &scoped, 4, 0); //Check if scoped
  810.                         ReadProcessMemory(hProcess, (LPVOID)(buffer + moveOffset), &moving, 4, 0); //Check if moving
  811.                         ReadProcessMemory(hProcess, (LPVOID)(buffer + jumpOffset), &jumping, 4, 0); //Check if jumping/falling etc.
  812.                         buffer = 0;
  813.                        
  814.                         if(scoped && !moving && !jumping)
  815.                         {
  816.                             Sleep(10);
  817.                             SendInput(1, &inputShoot, sizeof(inputShoot)); //Shoot
  818.                             Sleep(intervals.autosnipers);
  819.                         }
  820.                     }
  821.                 }
  822.             }
  823.         }
  824.     }
  825. }
  826.  
  827. void GetPlayerInfo()
  828. {
  829.     crosshairId = 0; //Reset crosshair ID
  830.     ReadProcessMemory(hProcess, clientBase + localPlayer, &buffer, 4, 0); //Get localPlayer pointer
  831.     ReadProcessMemory(hProcess, (LPVOID)(buffer + team), &mainTeam, 4, 0); //Get player team from localPlayer
  832.     ReadProcessMemory(hProcess, (LPVOID)(buffer + crosshair), &crosshairId, 4, 0); //Get crosshair ID from localPlayer
  833. }
  834.  
  835. void ScreenText()
  836. {
  837.     string info;
  838.     string status = "Status: ";
  839.     string mode = " | Mode: ";
  840.     string shootInterval = " | Interval: ";
  841.     string whileRunning = " | Shoot while running: ";
  842.    
  843.     info += status;
  844.    
  845.     if(toggle) info += "ON";
  846.     else info += "OFF";
  847.    
  848.     info += mode;
  849.    
  850.     if(pistolMode) info += "PISTOLS";
  851.     if(rifleMode) info += "RIFLES";
  852.     if(sniperMode) info += "SNIPERS";
  853.     if(autoSniperMode) info += "AUTO-SNIPERS";
  854.     if(shotgunMode) info += "SHOTGUNS";
  855.     if(noneMode) info += "NONE";
  856.    
  857.     info += shootInterval;
  858.    
  859.     if(pistolMode) info += to_string(intervals.pistols);
  860.     if(rifleMode) info += to_string(intervals.rifles);
  861.     if(sniperMode) info += to_string(intervals.snipers);
  862.     if(autoSniperMode) info += to_string(intervals.autosnipers);
  863.     if(shotgunMode) info += to_string(intervals.shotguns);
  864.     if(noneMode) info += "NONE";
  865.    
  866.     info += whileRunning;
  867.    
  868.     if(pistolMode)
  869.     {
  870.         if(intervals.pistolMoving) info += "TRUE";
  871.         else info += "FALSE";
  872.     }
  873.     if(rifleMode)
  874.     {
  875.         if(intervals.rifleMoving) info += "TRUE";
  876.         else info += "FALSE";
  877.     }
  878.     if(shotgunMode)
  879.     {
  880.         if(intervals.shotgunMoving) info += "TRUE";
  881.         else info += "FALSE";
  882.     }
  883.     if(sniperMode) info += "N/A";
  884.     if(autoSniperMode) info += "N/A";
  885.     if(noneMode) info += "N/A";
  886.    
  887.     const char *message = info.c_str();
  888.    
  889.     //TextOut(hDc, 0, 0, message, info.length());
  890.     GetWindowRect(csWindow, &rc);
  891.     DrawText(hDc, message, info.length(), &rc, DT_LEFT);
  892. }
  893.  
  894. void CheckProcess()
  895. {
  896.     HWND focus = GetForegroundWindow();
  897.     GetWindowThreadProcessId(focus, &currentId);
  898.     if(currentId != processId)
  899.     {
  900.         manualGui = false;
  901.         showGui = false;
  902.     }
  903.     else
  904.     {
  905.         if(manualGui);
  906.         else showGui = true;
  907.     }
  908. }
  909.  
  910. int main()
  911. {  
  912.     SetConsoleTitle("SIMPLE Tool by B3liar"); //Self explanatory
  913.     hWindow = GetConsoleWindow(); //Get handle of console window for MessageBox()
  914.    
  915.     config intervals;
  916.     LoadOffsets();
  917.     LoadControls();
  918.     LoadIntervals(); //Load interval values from a file
  919.    
  920.     DefineMouseInput(); //Define mouse input for auto-shooting
  921.    
  922.     processId = GetPid("csgo.exe"); //Get CS:GO process ID
  923.     if(processId == NULL) //Check if CS:GO is open
  924.     {
  925.         MessageBox(hWindow, "Please run this tool then csgo is running.", "Simple tool", MB_OK | MB_ICONINFORMATION); //Display a message
  926.         exit(0);
  927.     }
  928.    
  929.     csWindow = FindWindow(0, "Counter-Strike: Global Offensive");
  930.     drawWindow = CreateWindowEx(WS_EX_TOPMOST, "WindowClass", "WindowName", WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
  931.                                 CW_USEDEFAULT, csWindow, NULL, NULL, NULL);
  932.     hDc = GetDC(drawWindow);
  933.    
  934.     hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, processId); //Open CS:GO process
  935.     clientBase = GetModuleAddress(hProcess, "client_panorama.dll"); //Get address of client.dll
  936.    
  937.     color(15);
  938.     PrintInfo(); //Self explanatory
  939.    
  940.     scanplayer player; //Create a player structure
  941.     while(true)
  942.     {  
  943.         Sleep(1);
  944.         CheckProcess();
  945.         if(showGui) ScreenText();
  946.         GetWeaponId();
  947.         CheckKeys(); //Check for key presses
  948.         GetPlayerInfo(); //Get main player's team and crosshair ID
  949.         TriggerbotLoop(player); //Get all players' ids and teams, compare with main player's
  950.     }
  951.    
  952.     CloseHandle(hProcess); //close CS:GO process
  953. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top