Advertisement
Guest User

fuck your mom

a guest
Aug 29th, 2016
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 37.35 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <cstdlib>
  3. #include <iostream>
  4. #include <cstdlib>
  5. #include <fstream>
  6. #include <string>
  7. #include <windows.h>
  8. #include <tlhelp32.h>
  9. #include <stdlib.h>
  10. #include <stdio.h>
  11. #include <psapi.h>
  12. #include <cstdio>
  13. #include <shlobj.h>
  14. #include <direct.h>
  15. #include <WinUser.h>
  16. #include <dirent.h>
  17. #include <tchar.h>
  18. //#include <thread>
  19. #include <urlmon.h>
  20. /*#include <lua.hpp>*/
  21. #pragma comment(lib,"wininet.lib")
  22. #pragma comment(lib, "urlmon.lib")
  23. #pragma comment(lib, "winmm.lib")
  24. #pragma comment(lib, "Dnsapi.lib")
  25.  
  26.  
  27.  
  28. using namespace std;
  29.  
  30. const char* Commands[] = {
  31. "!help - Shows general help for Project X",
  32. "!helpcommand - Enter a command you want to know what does",
  33. "commands, cmds - List commands",
  34. "aprojects - Shows all projects made by Alis",
  35. "removefile - Removes a selected file",
  36. "removedir - Removes a selected directory",
  37. "cpu - Prints the current CPU",
  38. "checkdir - Checks if the selected directory exists",
  39. "checkfile - Check if the selected file exists",
  40. "shutdown - Shutdowns the computer instantly",
  41. "restart - Restarts the computer instantly",
  42. "tshutdown - Shutdowns the computer after the selected time",
  43. "checkstatus - Checks project x status",
  44. "playsound - Plays the selected MP3 or Wav file",
  45. "adminpanel - Shows admin panel",
  46. "cfile - Create file",
  47. "ofile - Shows the content of a file",
  48. "slock - Shutdown locks the pc",
  49. "update - Checks for updates",
  50. };
  51.  
  52. static float CalculateCPULoad(unsigned long long idleTicks, unsigned long long totalTicks)
  53. {
  54. static unsigned long long _previousTotalTicks = 0;
  55. static unsigned long long _previousIdleTicks = 0;
  56.  
  57. unsigned long long totalTicksSinceLastTime = totalTicks - _previousTotalTicks;
  58. unsigned long long idleTicksSinceLastTime = idleTicks - _previousIdleTicks;
  59.  
  60. float ret = 1.0f - ((totalTicksSinceLastTime > 0) ? ((float)idleTicksSinceLastTime) / totalTicksSinceLastTime : 0);
  61.  
  62. _previousTotalTicks = totalTicks;
  63. _previousIdleTicks = idleTicks;
  64. return ret;
  65. }
  66.  
  67. static unsigned long long FileTimeToInt64(const FILETIME & ft) { return (((unsigned long long)(ft.dwHighDateTime)) << 32) | ((unsigned long long)ft.dwLowDateTime); }
  68.  
  69. float GetCPULoad()
  70. {
  71. FILETIME idleTime, kernelTime, userTime;
  72. return GetSystemTimes(&idleTime, &kernelTime, &userTime) ? CalculateCPULoad(FileTimeToInt64(idleTime), FileTimeToInt64(kernelTime) + FileTimeToInt64(userTime)) : -1.0f;
  73. }
  74.  
  75. char Startmenu[10][50] = {
  76. "+-------------------------------------------+",
  77. "| Project X : PC Remastered |",
  78. "| |",
  79. "| |",
  80. "| -Login |",
  81. "| -Update |",
  82. "| -Exit |",
  83. "| |",
  84. "| Made By Gamer::Lover |",
  85. "+-------------------------------------------+" };
  86.  
  87. char Mainmenu[17][70] = {
  88. "+-----------------------------------------------------+",
  89. "| +-------------------------------------------------+ |",
  90. "| | Project X : PC Remastered | |",
  91. "| +-------------------------------------------------+ |",
  92. "| |",
  93. "| +-------------------------------------------------+ |",
  94. "| | basic : Basic Tools Menu | |",
  95. "| +-------------------------------------------------+ |",
  96. "| |",
  97. "| +-------------------------------------------------+ |",
  98. "| | adv : Advanced Tools Menu | |",
  99. "| +-------------------------------------------------+ |",
  100. "| |",
  101. "| +-------------------------------------------------+ |",
  102. "| | master : Master Tools / Admin Menu | |",
  103. "| +-------------------------------------------------+ |",
  104. "+-----------------------------------------------------+" };
  105.  
  106.  
  107. char Basicmenu[17][60] = {
  108. "+-----------------------------------------------------+",
  109. "| +-------------------------------------------------+ |",
  110. "| | Project X : PC Remastered | |",
  111. "| +-------------------------------------------------+ |",
  112. "| | | |",
  113. "| | info : store or load information ex webs,notes | |",
  114. "| | | |",
  115. "| | cleandesk : clears the desktop | |",
  116. "| | | |",
  117. "| | lockmouse : locks the mouse to a position | |",
  118. "| | | |",
  119. "| | settings : edit settings | |",
  120. "| | | |",
  121. "| | more : moves to next page | |",
  122. "| | | |",
  123. "| +-------------------------------------------------+ |",
  124. "+-----------------------------------------------------+" };
  125.  
  126. char Advmenu[17][60] = {
  127. "+-----------------------------------------------------+",
  128. "| +-------------------------------------------------+ |",
  129. "| | Project X : PC Remastered | |",
  130. "| +-------------------------------------------------+ |",
  131. "| | | |",
  132. "| | lock : lock the pc inputs | |",
  133. "| | | |",
  134. "| | tshut : timed shutdown | |",
  135. "| | | |",
  136. "| | mvirus : make a spammer/virus | |",
  137. "| | | |",
  138. "| | autoc : auto clicker | |",
  139. "| | | |",
  140. "| | | |",
  141. "| | | |",
  142. "| +-------------------------------------------------+ |",
  143. "+-----------------------------------------------------+" };
  144.  
  145. char Mastermenu[17][60] = {
  146. "+-----------------------------------------------------+",
  147. "| +-------------------------------------------------+ |",
  148. "| | Project X : PC Remastered | |",
  149. "| +-------------------------------------------------+ |",
  150. "| | | |",
  151. "| | loadlua : loads a custom lua file | |",
  152. "| | | |",
  153. "| | debug : opens debug menu | |",
  154. "| | | |",
  155. "| | | |",
  156. "| | | |",
  157. "| | | |",
  158. "| | | |",
  159. "| | | |",
  160. "| | Master menu | |",
  161. "| +-------------------------------------------------+ |",
  162. "+-----------------------------------------------------+" };
  163.  
  164. char Settingsmenu[17][60] = {
  165. "+-----------------------------------------------------+",
  166. "| +-------------------------------------------------+ |",
  167. "| | Project X : PC Remastered | |",
  168. "| +-------------------------------------------------+ |",
  169. "| | | |",
  170. "| | Skipp : skips the pauses on login and - | |",
  171. "| | - initializing | |",
  172. "| | logs : enable logs | |",
  173. "| | | |",
  174. "| | | |",
  175. "| | | |",
  176. "| | | |",
  177. "| | | |",
  178. "| | save : saves settings | |",
  179. "| | | |",
  180. "| +-------------------------------------------------+ |",
  181. "+-----------------------------------------------------+" };
  182.  
  183.  
  184. char Loginmenu[3][28] = {
  185. "+------------------------+",
  186. "| Login |",
  187. "+------------------------+" };
  188.  
  189. std::string input;
  190. std::string input2;
  191. std::string username;
  192. std::string password;
  193. const char* curversion = "0.6";
  194. const char* ProgramVersion = "0.1";
  195. std::string soundsOnOff;
  196. char menu = 'a';
  197. bool autostart;
  198. bool CommandOn = false;
  199. std::string OpenOnPcStarUp = "false";
  200. std::string EnableLogs = "false";
  201. std::string SkipPauses = "false";
  202. std::string CheckSLoop = "false";
  203. std::string BackgroundColor = "Default";
  204. std::string TextColor = "Default";
  205. std::string ProgramStatus;
  206.  
  207. bool dirExists(const std::string& dirName_in)
  208. {
  209. DWORD ftyp = GetFileAttributesA(dirName_in.c_str());
  210. if (ftyp == INVALID_FILE_ATTRIBUTES)
  211. return false;
  212.  
  213. if (ftyp & FILE_ATTRIBUTE_DIRECTORY)
  214. return true;
  215.  
  216. return false;
  217. }
  218.  
  219. bool fexists(const char *filename)
  220. {
  221. ifstream ifile(filename);
  222. return static_cast<bool>(ifile);
  223. }
  224. /*
  225. int Loadlua(const char* File)
  226. {
  227. lua_State *L = luaL_newstate();
  228. luaL_openlibs(L);
  229.  
  230. if (luaL_dofile(L, File)) {
  231. const char* err = lua_tostring(L, -1);
  232. printf(err);
  233. }
  234.  
  235. lua_close(L);
  236. return 0;
  237. }
  238. */
  239.  
  240. int rebuild(const char* sounds)
  241. {
  242. std::string MainDir = "c:/Project-Pc";
  243. std::string CustomDir = "c:/Project-Pc/Custom-Files";
  244. std::string DataDir = "c:/Project-Pc/Data";
  245. std::string IncludedDir = "c:/Project-Pc/Data/Included";
  246. std::string SourceDir = "c:/Project-Pc/Data/Source";
  247. std::string SavedInfoDir = "c:/Project-Pc/Data/Saved-Information";
  248. std::string SoundDir = "c:/Project-Pc/Data/Sounds";
  249.  
  250.  
  251. system("cls");
  252. cout << "Rebuilding missing files" << endl;
  253. CreateDirectoryA(MainDir.c_str(), NULL);
  254. CreateDirectoryA(CustomDir.c_str(), NULL);
  255. CreateDirectoryA(DataDir.c_str(), NULL);
  256. CreateDirectoryA(IncludedDir.c_str(), NULL);
  257. CreateDirectoryA(SourceDir.c_str(), NULL);
  258. CreateDirectoryA(SavedInfoDir.c_str(), NULL);
  259. CreateDirectoryA(SoundDir.c_str(), NULL);
  260. if (fexists("c:/Project-Pc/Data/storeddata.ini"))
  261. {
  262. cout << "storeddata.ini found will not rebuild" << endl;
  263. }
  264. else
  265. {
  266. ofstream storeddata;
  267. storeddata.open("c:/Project-Pc/Data/storeddata.ini");
  268. storeddata << "[Saved Program Settings]\n";
  269. storeddata << "[Open-On-PC-Startup]==false\n";
  270. storeddata << "[Enable-Logs]==false\n";
  271. storeddata << "[Skip-Pauses]==false\n";
  272. storeddata << "[BackgroundColor]==default\n";
  273. storeddata << "[TextColor]==default\n";
  274. storeddata << "[Check-Status-Loop]==false\n";
  275. storeddata.close();
  276. }
  277.  
  278. if (fexists("c:/Project-Pc/version.txt"))
  279. {
  280. remove("c:/Project-Pc/version.txt");
  281. }
  282.  
  283. ofstream version;
  284. version.open("c:/Project-Pc/version.txt");
  285. version << "[Current-Version] = " << curversion;
  286. version.close();
  287.  
  288.  
  289. if (fexists("c:/Project-Pc/logs.txt"))
  290. {
  291. cout << "logs.txt found will not rebuild" << endl;
  292. }
  293. else
  294. {
  295. ofstream logs;
  296. logs.open("c:/Project-Pc/logs.txt");
  297. logs << "DO NOT EDIT";
  298. logs.close();
  299. }
  300.  
  301.  
  302. HRESULT hr;
  303. LPCTSTR Url7 = _T("http://project-x.site88.net/shuttingdown.wav"), File7 = _T("c:\\Project-Pc\\Data\\Sounds\\shuttingdown.wav");
  304. LPCTSTR Url8 = _T("http://project-x.site88.net/sysoffline.wav"), File8 = _T("c:\\Project-Pc\\Data\\Sounds\\sysoffline.wav");
  305. LPCTSTR Url9 = _T("http://project-x.site88.net/sysonline.wav"), File9 = _T("c:\\Project-Pc\\Data\\Sounds\\sysonline.wav");
  306. LPCTSTR Url10 = _T("http://project-x.site88.net/welcome_massage.wav"), File10 = _T("c:\\Project-Pc\\Data\\Sounds\\welcome_massage.wav");
  307. LPCTSTR Url11 = _T("http://project-x.site88.net/ddosserterminal.bat"), File11 = _T("c:\\Project-Pc\\Data\\ddosserterminal.bat");
  308. LPCTSTR Url12 = _T("http://project-x.site88.net/source.ini"), File12 = _T("c:\\Project-Pc\\Data\\Source\\source.ini");
  309. if (sounds == "yes")
  310. {
  311. soundsOnOff = "On";
  312.  
  313.  
  314. hr = URLDownloadToFile(0, Url7, File7, 0, 0);
  315. hr = URLDownloadToFile(0, Url8, File8, 0, 0);
  316. hr = URLDownloadToFile(0, Url9, File9, 0, 0);
  317. hr = URLDownloadToFile(0, Url10, File10, 0, 0);
  318. hr = URLDownloadToFile(0, Url11, File11, 0, 0);
  319. hr = URLDownloadToFile(0, Url12, File12, 0, 0);
  320. }
  321. else
  322. {
  323. cout << "Skipping sounds" << endl;
  324. soundsOnOff = "Off";
  325. hr = URLDownloadToFile(0, Url11, File11, 0, 0);
  326. hr = URLDownloadToFile(0, Url12, File12, 0, 0);
  327.  
  328. }
  329.  
  330. return 0;
  331. }
  332.  
  333. void CheckDatabase(char* CheckLoop)
  334. {
  335. while (CheckLoop == "true" && CommandOn == false)
  336. {
  337.  
  338.  
  339.  
  340. _mkdir("c:/project_x_status");
  341.  
  342. HRESULT hr;
  343. LPCTSTR Url = _T("http://project-x.site88.net/project_x_status.ini"), File = _T("C:\\project_x_status\\project_x_status.ini");
  344. hr = URLDownloadToFile(0, Url, File, 0, 0);
  345. if (fexists("c:/project_x_status/project_x_status.ini"))
  346. {
  347.  
  348.  
  349. string line;
  350. ifstream myfile("c:/project_x_status/project_x_status.ini");
  351. if (myfile.is_open())
  352. {
  353. while (getline(myfile, line))
  354. {
  355.  
  356.  
  357. std::string str(line);
  358. std::string str2("Project-Command");
  359. std::size_t found = str.find(str2);
  360. if (found != std::string::npos)
  361. {
  362. std::string str3(line);
  363. std::string str4("shutdown");
  364. std::size_t found2 = str3.find(str4);
  365.  
  366. if (found2 != std::string::npos)
  367. {
  368. _mkdir("c:/project_x_command");
  369. cout << "Remote shutdown command received" << endl;
  370. CommandOn = true;
  371. system("shutdown -s");
  372.  
  373. }
  374.  
  375. std::string str5(line);
  376. std::string str6("restart");
  377. std::size_t found3 = str5.find(str6);
  378.  
  379. if (found3 != std::string::npos)
  380. {
  381. _mkdir("c:/project_x_command");
  382. cout << "Remote restart command received" << endl;
  383. CommandOn = true;
  384. system("shutdown -r");
  385.  
  386. }
  387. }
  388.  
  389.  
  390.  
  391. //cout << line << '\n';
  392. }
  393. myfile.close();
  394. remove("c:/project_x_status/project_x_status.ini");
  395. _rmdir("c:/project_x_status");
  396. }
  397.  
  398. }
  399. else
  400. {
  401. cout << "Error! while checking status.." << endl;
  402. }
  403.  
  404.  
  405.  
  406. Sleep(5000);
  407. }
  408. }
  409.  
  410. void ResetCommand()
  411. {
  412. _rmdir("c:/project_x_command");
  413. CommandOn = true;
  414. Sleep(10000);
  415. CommandOn = false;
  416. }
  417.  
  418. int SaveSettings()
  419. {
  420. if (fexists("c:/Project-Pc/Data/storeddata.ini"))
  421. {
  422. remove("c:/Project-Pc/Data/storeddata.ini");
  423. }
  424. ofstream storeddata;
  425. storeddata.open("c:/Project-Pc/Data/storeddata.ini");
  426. storeddata << "[Saved Program Settings]\n";
  427. storeddata << "[Open-On-PC-Startup]==" << OpenOnPcStarUp << "\n";
  428. storeddata << "[Enable-Logs]==" << EnableLogs << "\n";
  429. storeddata << "[Skip-Pauses]==" << SkipPauses << "\n";
  430. storeddata << "[BackgroundColor]==" << BackgroundColor << "\n";
  431. storeddata << "[TextColor]==" << TextColor << "\n";
  432. storeddata << "[Check-Status-Loop]==" << CheckSLoop << "\n";
  433. storeddata.close();
  434. return 0;
  435. }
  436.  
  437. int SearchForLine(const char* filepath, const char* SearchLine1, const char* SearchLine2)
  438. {
  439.  
  440. string line;
  441. ifstream myfile(filepath);
  442. if (myfile.is_open())
  443. {
  444. while (getline(myfile, line))
  445. {
  446.  
  447.  
  448. std::string str(line);
  449. std::string str2(SearchLine1);
  450. std::size_t found = str.find(str2);
  451. if (found != std::string::npos)
  452. {
  453. std::string str3(line);
  454. std::string str4(SearchLine2);
  455. std::size_t found2 = str3.find(str4);
  456. if (found2 != std::string::npos)
  457. {
  458. myfile.close();
  459. return true;
  460. }
  461. else
  462. {
  463. myfile.close();
  464. return false;
  465. }
  466. }
  467.  
  468. }
  469.  
  470. }
  471.  
  472. }
  473.  
  474. int ConnectToHomeServer()
  475. {
  476. HRESULT hr;
  477. LPCTSTR Url100 = _T("http://project-x.site88.net/status.txt"), File100 = _T("c:\\Project-Pc\\Data\\status.txt");
  478. hr = URLDownloadToFile(0, Url100, File100, 0, 0);
  479.  
  480. if (fexists("c:/Project-Pc/Data/status.txt"))
  481. {
  482.  
  483.  
  484. if (SearchForLine("c:/Project-Pc/Data/status.txt", "Current-Status", "open"))
  485. {
  486. ProgramStatus = "open";
  487. }
  488.  
  489.  
  490. if (SearchForLine("c:/Project-Pc/Data/status.txt", "Current-Status", "locked"))
  491. {
  492. ProgramStatus = "locked";
  493. }
  494.  
  495. if (SearchForLine("c:/Project-Pc/Data/status.txt", "Current-Status", "maintenance"))
  496. {
  497. ProgramStatus = "maintenance";
  498. }
  499. remove("c:/Project-Pc/Data/status.txt");
  500. return 0;
  501.  
  502. }
  503. else
  504. {
  505. cout << "Cant connect to server" << endl;
  506. ProgramStatus = "open";
  507. system("PAUSE");
  508. system("cls");
  509. return 0;
  510. }
  511.  
  512. return 0;
  513. system("cls");
  514. cout << "ERROR" << endl;
  515. cout << "Cant connect to server" << endl;
  516. cout << "Try again? - Yes/No" << endl;
  517. cin >> input;
  518. if (input == "Yes" || "y" || "yes")
  519. {
  520. ConnectToHomeServer();
  521. return 0;
  522. }
  523. else
  524. {
  525. return EXIT_SUCCESS;
  526. }
  527.  
  528.  
  529. }
  530.  
  531. int initializing()
  532. {
  533. SetConsoleTitleA("Project X : PC Remastered");
  534. system("cls");
  535. if (dirExists("c:/project_x_command"))
  536. {
  537. ResetCommand();
  538. }
  539.  
  540. cout << " ..:::::::::.." << endl;
  541. cout << " ..:::aad8888888baa:::.." << endl;
  542. cout << " .::::d:?88888888888?::8b::::." << endl;
  543. cout << " .:::d8888:?88888888??a888888b:::." << endl;
  544. cout << " .:::d8888888a8888888aa8888888888b:::." << endl;
  545. cout << " ::::dP::::::::88888888888::::::::Yb::::" << endl;
  546. cout << " ::::dP:::::::::Y888888888P:::::::::Yb::::" << endl;
  547. cout << " ::::d8:::::::::::Y8888888P:::::::::::8b::::" << endl;
  548. cout << " .::::88::::::::::::Y88888P::::::::::::88::::." << endl;
  549. cout << " :::::Y8baaaaaaaaaa88P:T:Y88aaaaaaaaaad8P:::::" << endl;
  550. cout << " :::::::Y88888888888P::|::Y88888888888P:::::::" << endl;
  551. cout << " ::::::::::::::::888:::|:::888::::::::::::::::" << endl;
  552. cout << " `:::::::::::::::8888888888888b::::::::::::::'" << endl;
  553. cout << " :::::::::::::::88888888888888::::::::::::::" << endl;
  554. cout << " :::::::::::::d88888888888888:::::::::::::" << endl;
  555. cout << " ::::::::::::88::88::88:::88::::::::::::" << endl;
  556. cout << " `::::::::::88::88::88:::88::::::::::'" << endl;
  557. cout << " `::::::::88::88::P::::88::::::::'" << endl;
  558. cout << " `::::::88::88:::::::88::::::'" << endl;
  559. cout << " ``:::::::::::::::::::''" << endl;
  560. cout << " ``:::::::::''" << endl;
  561. cout << " Initializing Project X" << endl;
  562.  
  563.  
  564. menu = 'b';
  565. cout << "Checking Files" << endl;
  566. if (dirExists("c:/Project-Pc") && dirExists("c:/Project-Pc/Data") && dirExists("c:/Project-Pc/Custom-Files") && dirExists("c:/Project-Pc/Data/Included") && dirExists("c:/Project-Pc/Data/Source") && fexists("c:/Project-Pc/Data/storeddata.ini") && dirExists("c:/Project-Pc/Data/Saved-Information") && dirExists("c:/Project-Pc/Data/Sounds") && fexists("c:/Project-Pc/Data/Source/source.ini"))
  567. {
  568.  
  569. if (SearchForLine("c:/Project-Pc/Data/storeddata.ini", "Skip-Pauses", "true"))
  570. {
  571. SkipPauses = "true";
  572. }
  573. else
  574. {
  575. SkipPauses = "false";
  576. }
  577.  
  578. if (SearchForLine("c:/Project-Pc/Data/storeddata.ini", "Enable-Logs", "true"))
  579. {
  580. EnableLogs = "true";
  581. }
  582. else
  583. {
  584. EnableLogs = "false";
  585. }
  586.  
  587. if (SearchForLine("c:/Project-Pc/Data/storeddata.ini", "Check-Status-Loop", "true"))
  588. {
  589. CheckSLoop = "true";
  590. }
  591. else
  592. {
  593. CheckSLoop = "false";
  594. }
  595.  
  596.  
  597. if (fexists("c:/Project-Pc/Data/Sounds/sysonline.wav"))
  598. {
  599. soundsOnOff = "On";
  600. }
  601. else
  602. {
  603. soundsOnOff = "Off";
  604. }
  605.  
  606. cout << "Files found" << endl;
  607.  
  608.  
  609. string line;
  610. ifstream myfile("c:/Project-Pc/Data/storeddata.ini");
  611. if (myfile.is_open())
  612. {
  613. while (getline(myfile, line))
  614. {
  615.  
  616.  
  617. std::string str(line);
  618. std::string str2("Open-On-PC-Startup");
  619. std::size_t found = str.find(str2);
  620. if (found != std::string::npos)
  621. {
  622. std::cout << "storeddata.ini Found" << '\n';
  623. std::string str3(line);
  624. std::string str4("true");
  625. std::size_t found2 = str3.find(str4);
  626. if (found2 != std::string::npos)
  627. {
  628. autostart = true;
  629. }
  630. else
  631. {
  632. autostart = false;
  633. }
  634. }
  635.  
  636. }
  637. myfile.close();
  638. }
  639.  
  640. }
  641. else
  642. {
  643. cout << "Some files was not found" << endl;
  644. cout << "Would you like to rebuild missing files ? - yes/no" << endl;
  645.  
  646. cin >> input2;
  647.  
  648. if (input2 == "yes" || "y")
  649. {
  650. rebuild("yes");
  651. initializing();
  652. return 0;
  653. }
  654. else
  655. {
  656. cout << "Closing" << endl;
  657. system("PAUSE");
  658. return EXIT_SUCCESS;
  659. }
  660.  
  661. }
  662. cout << "Checking Server" << endl;
  663. ConnectToHomeServer();
  664. cout << "Checking Lua (Lua Temp Disabled)" << endl;
  665. /*Loadlua("C:/Project-Pc/Data/Source/luacheck.lua"); */
  666. cout << "Done" << endl;
  667. system("PAUSE");
  668.  
  669.  
  670. }
  671.  
  672. int AdminCheck(std::string username, std::string password)
  673. {
  674. if (username == "admin123")
  675. {
  676. if (password == "061099")
  677. {
  678. cout << "Autorisation Granted" << endl;
  679. system("PAUSE");
  680. menu = 'h';
  681. }
  682. }
  683. else
  684. {
  685. cout << "username or password was incorrect!" << endl;
  686. system("PAUSE");
  687. }
  688. return 0;
  689. }
  690.  
  691. int main()
  692. {
  693. system("cls");
  694. while (true)
  695. {
  696. switch (menu)
  697. {
  698. case 'a':
  699. {
  700. initializing();
  701. //thread t1(CheckDatabase, CheckSLoop);
  702. LPCTSTR OnlineSound = _T("C:\\Project-Pc\\Data\\Sounds\\sysonline.wav");
  703. if (soundsOnOff == "On")
  704. {
  705. PlaySound(OnlineSound, NULL, SND_FILENAME);
  706. }
  707. system("cls");
  708. }
  709. case 'b':
  710. {
  711. cout << " _______________ Project X : Remastered _______________ " << endl;
  712. cout << " / \ / \ " << endl;
  713. cout << " / \ / \ " << endl;
  714. cout << " // \/\ // \/\ " << endl;
  715. cout << " \| XXXX XXXX | / \| XXXX XXXX | / " << endl;
  716. cout << " | XXXX XXXX |/ | XXXX XXXX |/ " << endl;
  717. cout << " | XXX XXX | - Login | XXX XXX | " << endl;
  718. cout << " | | - Update | | " << endl;
  719. cout << " \__ XXX __/ - Exit \__ XXX __/ " << endl;
  720. cout << " |\ XXX /| |\ XXX /| " << endl;
  721. cout << " | | | | | | | | " << endl;
  722. cout << " | I I I I I I I | | I I I I I I I | " << endl;
  723. cout << " | I I I I I I | | I I I I I I | " << endl;
  724. cout << " \_ _/ \_ _/ " << endl;
  725. cout << " \_ _/ Made By Gamer::Lover \_ _/ " << endl;
  726. cout << " \_______/ \_______/ " << endl;
  727. /*
  728. for (int y = 0; y < 10; y++)
  729. {
  730. cout << Startmenu[y] << endl;
  731. }
  732. */
  733. if (ProgramStatus == "open")
  734. {
  735. cin >> input;
  736. }
  737. if (ProgramStatus == "locked")
  738. {
  739. cout << "Project : PC is currently locked, Please come back later" << endl;
  740. system("PAUSE");
  741. return EXIT_SUCCESS;
  742.  
  743. }
  744. if (ProgramStatus == "maintenance")
  745. {
  746. cout << "Project : PC is currently under maintenance, Please come back later" << endl;
  747. system("PAUSE");
  748. return EXIT_SUCCESS;
  749. }
  750.  
  751.  
  752. if (input == "login")
  753. {
  754. menu = 'c';
  755. main();
  756. return 0;
  757. }
  758. if (input == "admin")
  759. {
  760.  
  761. }
  762. if (input == "update")
  763. {
  764. system("cls");
  765. cout << "Would you like to check for updates? - yes/no" << endl;
  766. cin >> input;
  767. if (input == "yes" || "y")
  768. {
  769. system("cls");
  770. cout << "Checking for updates" << endl;
  771. HRESULT hr;
  772. LPCTSTR Url = _T("http://project-x.site88.net/version.ini"), File = _T("C:\\Project-Pc\\Custom-Files\\version.ini");
  773. hr = URLDownloadToFile(0, Url, File, 0, 0);
  774.  
  775.  
  776.  
  777. if (SearchForLine("C:/Project-Pc/Custom-Files/version.ini", "Program-Version", ProgramVersion))
  778. {
  779. }
  780. else
  781. {
  782. system("cls");
  783. remove("C:/Project-Pc/Custom-Files/version.ini");
  784. cout << "A new version of the program is available please goto : NONEYET. and download the new version" << endl;
  785. system("PAUSE");
  786. main();
  787. return 0;
  788. }
  789.  
  790.  
  791. if (SearchForLine("C:/Project-Pc/Custom-Files/version.ini", "Current-Version", curversion))
  792. {
  793. remove("C:/Project-Pc/Custom-Files/version.ini");
  794. cout << "Your version is up to date" << endl;
  795. system("PAUSE");
  796. main();
  797. return 0;
  798. }
  799. else
  800. {
  801. cout << "An update was found to you want to install the update? - yes/no" << endl;
  802. remove("C:/Project-Pc/Custom-Files/version.ini");
  803. cin >> input;
  804.  
  805. if (input == "yes" || "y")
  806. {
  807. system("cls");
  808.  
  809. cout << "Do you want to install sounds to? - yes/no" << endl;
  810. cin >> input;
  811. if (input == "yes" || "y")
  812. {
  813. system("cls");
  814. cout << "Updating" << endl;
  815. rebuild("yes");
  816. cout << "Done" << endl;
  817. system("PAUSE");
  818. menu = 'a';
  819. main();
  820. return 0;
  821. }
  822. else
  823. {
  824. system("cls");
  825. cout << "Updating" << endl;
  826. rebuild("no");
  827. cout << "Done" << endl;
  828. system("PAUSE");
  829. menu = 'a';
  830. main();
  831. return 0;
  832. }
  833. }
  834. else
  835. {
  836. main();
  837. remove("C:/Project-Pc/Custom-Files/version.ini");
  838. return 0;
  839. }
  840. }
  841. }
  842.  
  843.  
  844.  
  845. main();
  846. return 0;
  847. }
  848. if (input == "exit")
  849. {
  850. return EXIT_SUCCESS;
  851. }
  852.  
  853. cout << "Unknown command!" << endl;
  854. system("PAUSE");
  855. system("cls");
  856. main();
  857. return 0;
  858. }
  859.  
  860.  
  861.  
  862.  
  863. case 'c':
  864. {
  865. for (int y = 0; y < 3; y++)
  866. {
  867. cout << Loginmenu[y] << endl;
  868. }
  869. cout << "Enter username" << endl;
  870.  
  871. cin >> username;
  872. cout << "username : " << username << endl;
  873. cout << "Enter password" << endl;
  874. cin >> password;
  875. cout << "password : " << password << endl;
  876. cout << "Press enter to confirm" << endl;
  877. system("PAUSE");
  878.  
  879. if (username == "lucaspou")
  880. {
  881. if (password == "luca")
  882. {
  883. system("cls");
  884. menu = 'd';
  885. main();
  886. return 0;
  887. }
  888. else
  889. {
  890. system("cls");
  891. cout << "Wrong password!" << endl;
  892. system("PAUSE");
  893. main();
  894. }
  895.  
  896. }
  897. else
  898. {
  899. system("cls");
  900. cout << "Wrong username!" << endl;
  901. system("PAUSE");
  902. main();
  903. }
  904.  
  905. }
  906.  
  907.  
  908.  
  909.  
  910.  
  911. case 'd':
  912. {
  913. for (int y = 0; y < 17; y++)
  914. {
  915. cout << Mainmenu[y] << endl;
  916. }
  917. cout << "Welcome to the main menu just type the first word to select the menu" << endl;
  918. cin >> input;
  919.  
  920.  
  921. if (input == "basic")
  922. {
  923. menu = 'g';
  924. system("cls");
  925. main();
  926. return 0;
  927. }
  928. if (input == "adv")
  929. {
  930. menu = 'f';
  931. system("cls");
  932. main();
  933. return 0;
  934. }
  935. if (input == "master")
  936. {
  937. system("cls");
  938. std::string adminusername;
  939. std::string adminpassword;
  940. cout << "+------------------------+" << endl;
  941. cout << "| Admin Login |" << endl;
  942. cout << "+------------------------+" << endl;
  943. cout << "Admin-Username:" << endl;
  944. cin >> adminusername;
  945. system("cls");
  946. cout << "+------------------------+" << endl;
  947. cout << "| Admin Login |" << endl;
  948. cout << "+------------------------+" << endl;
  949. cout << "Admin-Username:" << adminusername << endl;
  950. cout << "Admin-Password:" << endl;
  951. cin >> adminpassword;
  952. system("cls");
  953. cout << "+------------------------+" << endl;
  954. cout << "| Admin Login |" << endl;
  955. cout << "+------------------------+" << endl;
  956. cout << "Admin-Username:" << adminusername << endl;
  957. cout << "Admin-Password:" << adminpassword << endl;
  958. cout << "Confirm login? - Yes/No" << endl;
  959. cin >> input;
  960. if (input == "yes" || "y" || "Yes")
  961. {
  962. AdminCheck(adminusername, adminpassword);
  963. main();
  964. return 0;
  965. }
  966. else
  967. {
  968. main();
  969. return 0;
  970. }
  971. system("PAUSE");
  972. main();
  973. return 0;
  974. }
  975. if (input == "logout")
  976. {
  977. menu = 'b';
  978. system("cls");
  979. main();
  980. return 0;
  981. }
  982.  
  983.  
  984. cout << "Unknown command!" << endl;
  985. system("PAUSE");
  986. system("cls");
  987. main();
  988. return 0;
  989. }
  990.  
  991. case 'g':
  992. {
  993. for (int y = 0; y < 17; y++)
  994. {
  995. cout << Basicmenu[y] << endl;
  996. }
  997. cin >> input;
  998.  
  999. if (input == "info")
  1000. {
  1001. system("cls");
  1002. cout << "Would you like to load or create information?" << endl;
  1003. cin >> input;
  1004. if (input == "load")
  1005. {
  1006. system("cls");
  1007. cout << "Sorry function not completed yet" << endl;
  1008. system("PAUSE");
  1009. /*
  1010. system("cls");
  1011. main();
  1012. return 0;
  1013. */
  1014.  
  1015. system("cls");
  1016. DIR *dir;
  1017. struct dirent *ent;
  1018. if ((dir = opendir("c:/Project-Pc/Data/Saved-Information")) != NULL) {
  1019. /* print all the files and directories within directory */
  1020. while ((ent = readdir(dir)) != NULL) {
  1021. printf("%s\n", ent->d_name);
  1022. }
  1023. closedir(dir);
  1024. }
  1025. else {
  1026. /* could not open directory */
  1027. perror("Failed");
  1028. main();
  1029. return 0;
  1030. }
  1031. cout << "Enter the full name of the file with extension EX. test.txt" << endl;
  1032. string name;
  1033. cin >> name;
  1034.  
  1035. system("cls");
  1036. cout << "+--------------------------------------+" << endl;
  1037. cout << name << endl;
  1038. string line;
  1039. ifstream myfile("C:/Project-Pc/Data/Saved-Information/" + name);
  1040. if (myfile.is_open())
  1041. {
  1042. while (getline(myfile, line))
  1043. {
  1044. cout << line << '\n';
  1045. }
  1046. myfile.close();
  1047. cout << "What do you want to do?" << endl;
  1048. cout << "open - open the file" << endl;
  1049. cout << "write - write something in the file" << endl;
  1050. cout << "back - go back" << endl;
  1051. cin >> input;
  1052. if (input == "back")
  1053. {
  1054. main();
  1055. return 0;
  1056. }
  1057. main();
  1058. return 0;
  1059. }
  1060.  
  1061. else cout << "Unable to open file";
  1062. system("PAUSE");
  1063. main();
  1064. return 0;
  1065. }
  1066. if (input == "create")
  1067. {
  1068. string FileName;
  1069. string Text;
  1070. string State = "Typing";
  1071. system("cls");
  1072. cout << "Enter the file name, of the file you wanna create" << endl;
  1073. cin >> FileName;
  1074. system("cls");
  1075. ofstream createinfo;
  1076. createinfo.open("C:/Project-Pc/Data/Saved-Information/" + FileName + ".txt");
  1077. cout << "Just type anything and it will be printed into the file." << endl;
  1078. cout << "Type (EXIT). With () to close the file" << endl;
  1079. while (State == "Typing")
  1080. {
  1081. if (Text == "(EXIT)")
  1082. {
  1083. cout << "Closing" << endl;
  1084. createinfo.close();
  1085. cout << "File saved" << endl;
  1086. system("PAUSE");
  1087. main();
  1088. return 0;
  1089. }
  1090.  
  1091. if (!(Text == "(EXIT)"))
  1092. {
  1093.  
  1094. cin >> Text;
  1095. createinfo << Text << "\n";
  1096. }
  1097.  
  1098.  
  1099. }
  1100. }
  1101. main();
  1102. return 0;
  1103. }
  1104. if (input == "settings")
  1105. {
  1106. menu = 'i';
  1107. main();
  1108. return 0;
  1109. }
  1110.  
  1111. cout << "Unknown command!" << endl;
  1112. system("PAUSE");
  1113. system("cls");
  1114. main();
  1115. return 0;
  1116.  
  1117. }
  1118.  
  1119.  
  1120. case 'f':
  1121. {
  1122. for (int y = 0; y < 17; y++)
  1123. {
  1124. cout << Advmenu[y] << endl;
  1125. }
  1126. cin >> input;
  1127.  
  1128.  
  1129. if (input == "lock")
  1130. {
  1131. system("cls");
  1132. main();
  1133. return 0;
  1134. }
  1135. if (input == "tshut")
  1136. {
  1137. system("cls");
  1138. cout << "Are you sure you want to make a timed shutdown ? - y/n" << endl;
  1139. cin >> input;
  1140. if (input == "yes" || input == "y")
  1141. {
  1142. int secs;
  1143. system("cls");
  1144. cout << "Enter time to shutdown in seconds" << endl;
  1145. cin >> secs;
  1146. cout << "Computer shutting down in" << endl;
  1147. for (int i1 = secs; i1 > 1; i1 -= 1)
  1148. {
  1149. cout << i1 << endl;
  1150. Sleep(1000);
  1151. }
  1152. system("cls");
  1153. cout << "Shutting Down" << endl;
  1154. system("shutdown /s");
  1155. system("PAUSE");
  1156. }
  1157. if (input == "no" || input == "n")
  1158. {
  1159. main();
  1160. return 0;
  1161. }
  1162. cout << "Unknown answear returning to menu" << endl;
  1163. system("PAUSE");
  1164. main();
  1165. return 0;
  1166. }
  1167. if (input == "mvirus")
  1168. {
  1169. system("cls");
  1170.  
  1171. cout << "Chose run type:" << endl;
  1172. cout << "bat" << endl;
  1173. cout << "exe - Coming Soon" << endl;
  1174. cin >> input;
  1175.  
  1176. if (input == "bat")
  1177. {
  1178. system("cls");
  1179. cout << "Chose type" << endl;
  1180. cout << "popupper" << endl;
  1181. cout << "virus - coming soon" << endl;
  1182. cin >> input;
  1183. if (input == "popupper")
  1184. {
  1185. system("cls");
  1186. cout << "Chose popup type:" << endl;
  1187. cout << "website" << endl;
  1188. cout << "program - coming soon" << endl;
  1189. cin >> input;
  1190. if (input == "website")
  1191. {
  1192. system("cls");
  1193. std::string url;
  1194. int popuptimes;
  1195. cout << "Enter url to website" << endl;
  1196. cin >> url;
  1197. cout << "How many times should it open the website" << endl;
  1198. cin >> popuptimes;
  1199. ofstream popupper;
  1200. popupper.open("c:/Project-Pc/Custom-Files/popupper-RENAME.bat");
  1201.  
  1202. for (int i2 = popuptimes; i2 >= 1; i2 -= 1)
  1203. {
  1204. popupper << "start iexplore.exe " << url << "\n";
  1205. }
  1206. popupper.close();
  1207. cout << "Done get your file and rename it here c:/Project-Pc/Custom-Files/" << endl;
  1208. system("PAUSE");
  1209. main();
  1210. return 0;
  1211. }
  1212. }
  1213. }
  1214.  
  1215. main();
  1216. return 0;
  1217. }
  1218. if (input == "autoc")
  1219. {
  1220. int i, stop;
  1221. int wait;
  1222. stop = 0;
  1223. int maxtime = 0;
  1224. bool done = false;
  1225. float x = 0;
  1226. float y = 0;
  1227. system("cls");
  1228. cout << "How many times do you want it to click, 0 for inf loop" << endl;
  1229. cin >> i;
  1230. system("cls");
  1231. cout << "You selected " << i << endl;
  1232. cout << "Choose the mouse position to click, press f1 to choose the current position of your mouse cursor" << endl;
  1233. while (!done) {
  1234. if (GetKeyState(VK_F1)) {
  1235. POINT cursorPos;
  1236. GetCursorPos(&cursorPos);
  1237. x = cursorPos.x;
  1238. y = cursorPos.y;
  1239. done = true;
  1240. }
  1241. }
  1242. cout << "You chose this pos 'X'=" << x << " 'Y'=" << y << endl;
  1243.  
  1244.  
  1245. cout << "How long should it take before it clicks agien in milisecends?" << endl;
  1246. cin >> wait;
  1247. cout << "Press f2 to stop the loop" << endl;
  1248. if (i == 0)
  1249. {
  1250. while (stop != 1)
  1251. {
  1252. SetCursorPos(x, y);
  1253. mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
  1254. mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
  1255. Sleep(wait);
  1256. if (GetKeyState(VK_F2)) {
  1257. stop = 1;
  1258. system("cls");
  1259. main();
  1260. return 0;
  1261. }
  1262. }
  1263. }
  1264. else
  1265. {
  1266. for (int t = 1; t <= i; t++) {
  1267. SetCursorPos(x, y);
  1268. mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
  1269. mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
  1270. Sleep(wait);
  1271. if (GetKeyState(VK_F2)) {
  1272. exit(0);
  1273. }
  1274. }
  1275. }
  1276. cout << "Stopped press enter to return" << endl;
  1277. system("PAUSE");
  1278. main();
  1279. return 0;
  1280. }
  1281. if (input == "back")
  1282. {
  1283. menu = 'd';
  1284. system("cls");
  1285. main();
  1286. return 0;
  1287. }
  1288.  
  1289.  
  1290. cout << "Unknown command!" << endl;
  1291. system("PAUSE");
  1292. system("cls");
  1293. main();
  1294. return 0;
  1295. }
  1296. case 'h':
  1297. {
  1298. for (int y = 0; y < 17; y++)
  1299. {
  1300. cout << Mastermenu[y] << endl;
  1301. }
  1302. cin >> input;
  1303. if (input == "loadlua")
  1304. {
  1305. std::string LuaPath;
  1306. system("cls");
  1307. cout << "Lua Disabled" << endl;
  1308. system("PAUSE");
  1309. main();
  1310. return 0;
  1311. cout << "Enter the whole path to the lua file" << endl;
  1312. cin >> LuaPath;
  1313. const char * c = LuaPath.c_str();
  1314. system("cls");
  1315. /* Loadlua(c); */
  1316. system("PAUSE");
  1317. main();
  1318. return 0;
  1319. }
  1320. if (input == "debug")
  1321. {
  1322. main();
  1323. return 0;
  1324. }
  1325. if (input == "back")
  1326. {
  1327. menu = 'g';
  1328. main();
  1329. return 0;
  1330. }
  1331.  
  1332. cout << "Unknown command!" << endl;
  1333. system("PAUSE");
  1334. system("cls");
  1335. main();
  1336. return 0;
  1337. }
  1338. case 'i':
  1339. {
  1340. for (int y = 0; y < 17; y++)
  1341. {
  1342. cout << Settingsmenu[y] << endl;
  1343. }
  1344. cin >> input;
  1345.  
  1346. if (input == "skipp")
  1347. {
  1348. if (SkipPauses == "true")
  1349. {
  1350. SkipPauses = "false";
  1351. cout << "SkipPauses is now false" << endl;
  1352. system("PAUSE");
  1353. system("cls");
  1354. main();
  1355. return 0;
  1356. }
  1357. else
  1358. {
  1359. SkipPauses = "true";
  1360. cout << "SkipPauses is now true" << endl;
  1361. system("PAUSE");
  1362. system("cls");
  1363. main();
  1364. return 0;
  1365. }
  1366. }
  1367. if (input == "logs")
  1368. {
  1369. if (EnableLogs == "true")
  1370. {
  1371. EnableLogs = "false";
  1372. cout << "EnableLogs is now false" << endl;
  1373. system("PAUSE");
  1374. system("cls");
  1375. main();
  1376. return 0;
  1377. }
  1378. else
  1379. {
  1380. EnableLogs = "true";
  1381. cout << "EnableLogs is now true" << endl;
  1382. system("PAUSE");
  1383. system("cls");
  1384. main();
  1385. return 0;
  1386. }
  1387. system("PAUSE");
  1388. system("cls");
  1389. main();
  1390. return 0;
  1391. }
  1392. if (input == "save")
  1393. {
  1394. SaveSettings();
  1395. cout << "Settings saved" << endl;
  1396. system("PAUSE");
  1397. system("cls");
  1398. main();
  1399. return 0;
  1400. }
  1401. cout << "Unknown command!" << endl;
  1402. system("PAUSE");
  1403. system("cls");
  1404. main();
  1405. return 0;
  1406. }
  1407. }
  1408.  
  1409. }
  1410. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement