-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.cpp
More file actions
1777 lines (1744 loc) · 59.4 KB
/
Copy pathmain.cpp
File metadata and controls
1777 lines (1744 loc) · 59.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
bool testmode = true;
/*
███████╗███████╗███████╗██╗ ██╗ ██████╗ ██╗ ██╗██╗██╗ ██╗ ███████╗██████╗
██╔════╝██╔════╝██╔════╝██║ ██║██╔═══██╗ ██║ ██╔╝██║██║ ██║ ██╔════╝██╔══██╗
███████╗█████╗ █████╗ ██║ █╗ ██║██║ ██║ █████╔╝ ██║██║ ██║ █████╗ ██████╔╝
╚════██║██╔══╝ ██╔══╝ ██║███╗██║██║ ██║ ██╔═██╗ ██║██║ ██║ ██╔══╝ ██╔══██╗
███████║███████╗███████╗╚███╔███╔╝╚██████╔╝ ██║ ██╗██║███████╗███████╗███████╗██║ ██║
╚══════╝╚══════╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝╚══════╝╚══════╝╚══════╝╚═╝ ╚═╝
by WHSTU
Version 2.0
*/
#include "./main.h"
struct About {
const std::string AppName = "希沃克星";
const std::string AppNameEn = "SeewoKiller";
const std::string Version = "2.1.1.147";
const long long VersionCode = 020101147;
const std::string VersionName = "Stupefy";
std::vector<std::string> versionNameWeb;//版本代号
std::vector<std::string> versionWeb;//版本
std::vector<std::string> versionCodeWeb = {"0"}; //版本数字代码
} info;
#include "./cmdCtrl.h"
#include "./files.h"
#include "./SplashScreen.h"
#include "./CameraRec.h"
#include "./web.h"
#include "./game.h"
using namespace GAME;
using namespace std;
char path[MAX_PATH];
size_t position;
string xwbbpath;
int dwMajorInt;
int dwMinorInt;
bool fastboot = false;
/*HWND hwnd = GetConsoleWindow();
void SetColorAndBackground(int ForgC, int BackC) {//单个字的颜色
//1深蓝,2深绿,3深青,4深红,5深紫,6深黄,7灰白(默认),8深灰
//9浅蓝,10浅绿,11浅青,12浅红,13浅紫,14浅黄,15白色,0黑色
WORD wColor = ((BackC & 0x0F) << 4) + (ForgC & 0x0F);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), wColor);
}
void gotoxy(long long x, long long y) {
COORD pos;
pos.X = 2 * x;
pos.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}
void setfont(int size) {//字体、大小、粗细
CONSOLE_FONT_INFOEX cfi;
cfi.cbSize = sizeof cfi;
cfi.nFont = 0;
cfi.dwFontSize.X = 0;
cfi.dwFontSize.Y = size;//设置字体大小
cfi.FontFamily = FF_DONTCARE;
cfi.FontWeight = FW_BOLD;//字体粗细 FW_BOLD,原始为FW_NORMAL
wcscpy_s(cfi.FaceName, L"System");//设置字体,必须是控制台已有的
SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), FALSE, &cfi);
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_FONT_INFO consoleCurrentFont;
GetCurrentConsoleFont(handle, FALSE, &consoleCurrentFont);
}*/
/*屏蔽关闭按钮*/
void connot_close_button() {
HMENU hmenu = GetSystemMenu(hwnd, false);
ifstream file(".\\settings\\enable-close-window-button.seewokiller");
string value;
getline(file, value);
value = UTF8ToGBK(value);
if (value != "true" and testmode != true) {
RemoveMenu(hmenu, SC_CLOSE, MF_BYCOMMAND);
SetWindowLong(hwnd, GWL_STYLE,
GetWindowLong(hwnd, GWL_STYLE) | WS_MINIMIZEBOX | WS_THICKFRAME);
} else {
SetWindowLong(hwnd, GWL_STYLE,
GetWindowLong(hwnd, GWL_STYLE) & ~(WS_MINIMIZEBOX | WS_THICKFRAME));
}
ShowWindow(hwnd, SW_MAXIMIZE);//最大化
SetWindowPos(hwnd, HWND_TOP, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), SWP_FRAMECHANGED);
DrawMenuBar(hwnd);
ReleaseDC(hwnd, NULL);
}
//任务栏进度条
//全局或类成员变量
ITaskbarList3* g_pTaskbar = nullptr;
void InitTaskbarInterface() {
CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
CoCreateInstance(
CLSID_TaskbarList, nullptr, CLSCTX_ALL,
IID_ITaskbarList3, reinterpret_cast<void**>(&g_pTaskbar)
);
if (g_pTaskbar) g_pTaskbar->HrInit();
return;
}
void ReleaseTaskbarInterface() {
if (g_pTaskbar) g_pTaskbar->Release();
CoUninitialize();
return;
}
// 线程函数
void taskbarprocess(TBPFLAG state, int percent = -1) {
/*
TBPF_NOPROGRESS无进度条(默认状态)
TBPF_INDETERMINATE不确定进度(持续动画)
TBPF_NORMAL正常进度(绿色)
TBPF_ERROR错误(红色)
TBPF_PAUSED暂停(黄色)
*/
g_pTaskbar->SetProgressState(hwnd, state);
if (state != TBPF_NOPROGRESS && state != TBPF_INDETERMINATE && (percent >= 0 || percent <= 100)) {
g_pTaskbar->SetProgressValue(hwnd, percent, 100);
}
return;
}
/*注册表*/
#define CHECK_ERROR(func) \
if (ERROR_SUCCESS != (func)) { \
std::cerr << "Error in " << __FUNCTION__ << " at line " << __LINE__ << " with error code " << GetLastError() << std::endl; \
return false; \
}
bool regedit(string root, string regpath, const char* valueName, string form, const char* Value) {
HKEY hKey = NULL;
LONG result;
HKEY hRootKey;
if (root == "HKEY_CLASSES_ROOT") {
hRootKey = HKEY_CLASSES_ROOT;
} else if (root == "HKEY_CURRENT_USER") {
hRootKey = HKEY_CURRENT_USER;
} else if (root == "HKEY_LOCAL_MACHINE") {
hRootKey = HKEY_LOCAL_MACHINE;
} else if (root == "HKEY_USERS") {
hRootKey = HKEY_USERS;
} else if (root == "HKEY_CURRENT_CONFIG") {
hRootKey = HKEY_CURRENT_CONFIG;
} else {
cerr << "Invalid root key." << endl;
return false;
}
result = RegOpenKeyEx(hRootKey, regpath.c_str(), 0, KEY_SET_VALUE, &hKey);
CHECK_ERROR(result);
if (form == "REG_SZ" || form == "REG_EXPAND_SZ") {
result = RegSetValueEx(hKey, valueName, 0, (form == "REG_SZ") ? REG_SZ : REG_EXPAND_SZ, (const BYTE*)Value, strlen(Value) + 1);
} else if (form == "REG_DWORD") {
DWORD newValue = static_cast<DWORD>(strtol(Value, nullptr, 10));
result = RegSetValueEx(hKey, valueName, 0, REG_DWORD, (const BYTE*)&newValue, sizeof(DWORD));
} else if (form == "REG_BINARY") {
cerr << "REG_BINARY not implemented correctly." << endl;
RegCloseKey(hKey);
return false;
} else if (form == "REG_QWORD") {
ULONGLONG newValue = _strtoui64(Value, nullptr, 10);
result = RegSetValueEx(hKey, valueName, 0, REG_QWORD, (const BYTE*)&newValue, sizeof(ULONGLONG));
} else if (form == "REG_MULTI_SZ") {
cerr << "REG_MULTI_SZ not implemented correctly." << endl;
RegCloseKey(hKey);
return false;
} else {
cerr << "Invalid data type." << endl;
RegCloseKey(hKey);
return false;
}
CHECK_ERROR(result);
RegCloseKey(hKey);
return true;
}
/*重启explorer.exe*/
void restartexp() {
system("TASKKILL /F /IM explorer.exe");
cout << "杀进程成功,5秒后尝试重启\n";
Sleep(5000);
system("start C:\\Windows\\explorer.exe");
cout << "恢复中\n";
Sleep(2000);
system("start C:\\Windows\\explorer.exe");
}
void checkUpdate(bool IsPoweron = false) {
if (IsPoweron == false) {
//初始化
gotoxy(0, 3);
SetColorAndBackground(7, 0);
for (int i = 0; i < 15; i++) {
cout << " \n";
}
gotoxy(0, 3);
//--------
cout << "\n正在获取版本信息...";
}
//fetch
//ReadWebFileVector("https://seewokiller.whstu.dpdns.org/installer/version.txt", info.versionWeb, 1000);
//ReadWebFileVector("https://seewokiller.whstu.dpdns.org/installer/versionName.txt", info.versionNameWeb, 1000);
ReadWebFileVector("https://seewokiller.whstu.dpdns.org/installer/versionCode.txt", info.versionCodeWeb, 2500);
if (IsPoweron == false && info.versionCodeWeb.empty()) {
cout << "错误:未获取到版本信息。请检查网络。\n\n";
return;
}
long long versionCodeNumber = stoll(info.versionCodeWeb[0]);
if (versionCodeNumber > info.VersionCode) {
word.recent.push_back("[*]有软件更新");
switch (IsPoweron) {
case false: {
ReadWebFileVector("https://seewokiller.whstu.dpdns.org/installer/version.txt", info.versionWeb, 2500);
cout << "\n发现软件更新: " << info.versionWeb[0] << " (" << info.versionNameWeb[0] << "),";
cout << "\n当前: " << info.Version << "\n\n";
cout << "是否前往网站下载? (Y/y-是, 其它按键-否\n";
while (true) {
char ch = getch();
if (ch == 'Y' or ch == 'y') {
system("start \"https://whstu.dpdns.org/download/seewokiller/\"");
break;
}
}
break;
}
}
} else {
switch (IsPoweron) {
case false: {
cout << "\nVersion " << info.Version << ", 已是最新版本\n";
break;
}
}
}
return;
}
void quickstart() {
int step = 1;
cls
while (step <= 6) {
cls
gotoxy(0, 6);
cout << "\n\n\n这是初学者引导程序。按a返回,按d继续,按s跳过所有\n\n";
cout << "第" << step << "步,共6步\n\n";
switch (step) {
case 1: {
cout << "首先,请将你的实体/软键盘切换为英文输入法,并关闭大写锁定。\n";
cout << "希沃克星(经典界面)运行时,请不要点击界面,否则界面将会被选中,希沃克星的进程将会停止。\n";
break;
}
case 2: {
cout << "按wasd控制上下左右";
break;
}
case 3: {
cout << "按空格键确定";
break;
}
case 4: {
cout << "带有\">>>\"的选项包含子项目,可以按空格键打开";
break;
}
case 5: {
cout << "技巧:通过Windows“任务视图”将希沃克星转移至另一个桌面以躲避大部分老师的检查\n";
cout << "瓦特工具箱Watt Toolkit可以加速对Steam、Github的访问,网址https://steampp.net/";
break;
}
case 6: {
cout << "你已经完成了初学者引导程序。欢迎使用希沃克星!\n本引导程序将会保留在“设置”板块中";
break;
}
default:
return;
}
char ch = getch();
for (;; ch = getch()) {
if (ch == 'a') {
if (step > 1) {
step--;
break;
}
} else if (ch == 'd') {
step++;
break;
} else if (ch == 's') {
if (MessageBox(hwnd, _T("你确实要跳过吗?\n本引导程序将会保留在设置板块中"), _T("鸡叫"), MB_YESNO) == IDYES) {
cls
return;
}
}
}
}
cls
}
void poweron(bool SkipCheckWinVer, bool fb = false) {
//1深蓝,2深绿,3深青,4深红,5深紫,6深黄,7灰白(默认),8深灰
//9浅蓝,10浅绿,11浅青,12浅红,13浅紫,14浅黄,15白色,0黑色
if (fb == true) {
word.recent.clear();
word.all.clear();
word.more.clear();
word.setting.clear();
word.recent = {"NULL", "一键解希沃锁屏", "晚自习制裁模式", "连点器(可防屏保)"};
word.all = {"NULL", "循环清任务(上课防屏保)", "一键卸载", "晚自习制裁模式", "连点器(可防屏保)", "一键解希沃锁屏", "录制视频"};
word.more = {"NULL", "冰点还原破解", "AI", "计算π"};
word.setting = {"NULL", "退出", "冰点还原疑难解答", "命令行帮助"};
return;
}
auto del = find(word.recent.begin(), word.recent.end(), "[*]有插件加载失败>>>");
if (del != word.recent.end()) {
word.recent.erase(del);
}
del = find(word.recent.begin(), word.recent.end(), "[*]有软件更新");
if (del != word.recent.end()) {
word.recent.erase(del);
}
setfont(30);
connot_close_button();
S(500);
WHSTU_Rainbow();
//校验文件
gotoxy(16, 14);
cout << "正在校验配置文件(1/5)";
gotoxy(15, 16);
cout << "[= ]";
taskbarprocess(TBPF_NORMAL, 5);
S(100);
//---变量名称使用UUID生成器前8位
CreateDirectory("./settings", NULL);
string fe7f8a96[5] = {"true", "false"};
string ebf9f2e8 = ".\\settings\\write-log-when-killapp.seewokiller";
check_config_avaliable(ebf9f2e8, fe7f8a96, 2, "false");
change_word(word.setting, SearchForAddress(word.setting, "在晚自习制裁/循环清任务时启用日志"), true, ebf9f2e8);
string eacf0909[5] = {"true", "false"};
string b7135431 = ".\\settings\\enable-close-window-button.seewokiller";
check_config_avaliable(b7135431, eacf0909, 2, "false");
change_word(word.setting, SearchForAddress(word.setting, "允许使用“关闭”按钮"), true, b7135431);
string eb9730d6[5] = {"总是询问", "总是旧UI", "总是新UI"};
string a57f2d49 = ".\\settings\\start.seewokiller";
check_config_avaliable(a57f2d49, eb9730d6, 3, "总是询问");
change_word(word.setting, SearchForAddress(word.setting, "启动设置"), true, a57f2d49);
//-----
gotoxy(16, 14);
cout << "正在验证系统版本(2/5) ";
gotoxy(15, 16);
cout << "[===== ]";
taskbarprocess(TBPF_NORMAL, 25);
S(100);
//检测Windows版本
typedef void(__stdcall * NTPROC)(DWORD*, DWORD*, DWORD*);
HINSTANCE hinst = LoadLibrary(TEXT("ntdll.dll"));//加载DLL
NTPROC GetNtVersionNumbers = (NTPROC)GetProcAddress(hinst, "RtlGetNtVersionNumbers");//获取函数地址
DWORD dwMajor, dwMinor, dwBuildNumber;
GetNtVersionNumbers(&dwMajor, &dwMinor, &dwBuildNumber);
gotoxy(15, 14);
printf("Windows版本: %d.%d", (int)dwMajor, (int)dwMinor);
cout << "(3/5) ";
gotoxy(15, 16);
cout << "[======= ]";
taskbarprocess(TBPF_NORMAL, 35);
S(100);
//总是新UI
string startv = read_config(".\\settings\\start.seewokiller");
if (startv == "总是新UI") {
string guipath = executable_path + "\\gui.exe";
STARTUPINFO si = { sizeof(si) };//0
PROCESS_INFORMATION pi;
LPTSTR szCommandLine = _tcsdup(TEXT(guipath.c_str()));//有权限的都可以打开
BOOL fSuccess = CreateProcess(NULL, szCommandLine, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi);//参数意义
if (fSuccess) {
gotoxy(15, 16);
cout << "[============= ]";
taskbarprocess(TBPF_NORMAL, 65);
S(10);
gotoxy(15, 16);
cout << "[====================]";
taskbarprocess(TBPF_NORMAL, 100);
S(200);
ReleaseTaskbarInterface();
exit(0);
}
}
//-------
dwMajorInt = static_cast<int>(dwMajor);
dwMinorInt = static_cast<int>(dwMinor);
float version = dwMajorInt + dwMinorInt * 0.1;
if (SkipCheckWinVer == false and startv == "总是询问") {
if (version >= 6.1 and fileExist(".\\gui.exe") == true) {
taskbarprocess(TBPF_PAUSED, 35);
if (MessageBox(hwnd, _T("检测到你的系统为Windows 7+,\n是否使用全新UI?"), _T("提示"), MB_OKCANCEL) == 1) {
string guipath = executable_path + "\\gui.exe";
STARTUPINFO si = { sizeof(si) };//0
PROCESS_INFORMATION pi;
LPTSTR szCommandLine = _tcsdup(TEXT(guipath.c_str()));//有权限的都可以打开
BOOL fSuccess = CreateProcess(NULL, szCommandLine, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi);//参数意义
if (fSuccess) {
gotoxy(15, 16);
cout << "[============= ]";
taskbarprocess(TBPF_NORMAL, 65);
S(10);
gotoxy(15, 16);
cout << "[====================]";
taskbarprocess(TBPF_NORMAL, 100);
S(200);
ReleaseTaskbarInterface();
exit(0);
}
}//返回1确定,2取消
}
}
/*Windows 10-10.0
Windows 8.1-6.3
Windows 8-6.2
Windows 7-6.1
Windows Vista-6.0
Windows XP 64位-5.2
Windows XP-5.1
Windows 2000-5.0
https://learn.microsoft.com/zh-cn/windows/win32/sysinfo/operating-system-version
*/
gotoxy(15, 14);
cout << "正在加载插件(4/5) ";
gotoxy(15, 16);
cout << "[============== ]";
CreateDirectory("./plugin", NULL);
PLUGIN::PluginMain();
//system("pause");
gotoxy(15, 14);
cout << "正在进行最后的准备(5/5) ";
gotoxy(15, 16);
cout << "[================== ]";
taskbarprocess(TBPF_NORMAL, 55);
checkUpdate(true);
S(200);
if (fileExist(".\\settings\\already-quick-started.seewokiller") == false) {
cls
gotoxy(15, 14);
cout << "你好";
S(2000);
gotoxy(15, 14);
cout << "欢迎使用希沃克星";
S(3000);
quickstart();
ofstream file(".\\settings\\already-quick-started.seewokiller");
file.close();
}
gotoxy(15, 16);
cout << "[====================]";
taskbarprocess(TBPF_NORMAL, 100);
S(100);
setfont(30);
taskbarprocess(TBPF_NOPROGRESS);
return;
}
void about() {
//初始化
gotoxy(0, 3);
SetColorAndBackground(7, 0);
for (int i = 0; i < 15; i++) {
cout << " \n";
}
gotoxy(0, 3);
//--------
cout << "\nPowered by\n\n ";
S(500);
SetColorAndBackground(4, 12);
cout << " W ";
SetColorAndBackground(6, 14);
cout << " H ";
SetColorAndBackground(2, 10);
cout << " S ";
SetColorAndBackground(1, 9);
cout << " T ";
SetColorAndBackground(13, 5);
cout << " U ";
SetColorAndBackground(0, 0);
cout << " ";
SetColorAndBackground(15, 8);
cout << " S t u d i o ";
SetColorAndBackground(7, 0);
S(500);
cout << "\n";
cout << "\n" << info.AppNameEn << " " << info.Version << " (" << info.VersionName << ")\n";
cout << "\n卓然第三帝国https://whstu.dpdns.org/提供技术支持";
cout << "\n代码仓库:https://github.com/whstu/SeewoKiller/";
cout << "\nSeewoKiller QQ 群:664929698";
cout << "\n经典界面UI基于SlytherinOS框架\n";
SetColorAndBackground(10, 0);
cout << " Slytherin ";
SetColorAndBackground(0, 2);
cout << "O";
SetColorAndBackground(7, 0);
cout << "S";
cout << "\n新版界面基于PyQt5和qfluentwidgets,网址https://qfluentwidgets.com/\n";
cout << "\n技巧:通过Windows“任务视图”将希沃克星转移至另一个桌面以躲避大部分老师的检查\n";
cout << "瓦特工具箱Watt Toolkit可以加速对Steam、Github的访问,网址https://steampp.net/\n";
cout << "\n";
cout << "“Slytherin(TM)”是J.K.Rowling的注册商标,版权归WizardingWorld(R)所有\n";
cout << "\n按b回车即可返回\n";
while (true) {
string ans;
cin >> ans;
if (ans == "b") {
return;
}
if (ans == "dev") {
auto add = std::find(word.setting.begin(), word.setting.end(), "开发者选项>>>");
if (add != word.setting.end()) {//如果存在
cout << "开发者模式 已开启。不需要重复操作。\n";
} else {
word.setting.push_back("开发者选项>>>");
cout << "开发者模式 已开启。\n按b后回车即可返回。\n";
}
}
}
}
BOOL IsUserAnAdmin() {
BOOL bResult = FALSE;
SID_IDENTIFIER_AUTHORITY sia = SECURITY_NT_AUTHORITY;
PSID pSid = NULL;
if (AllocateAndInitializeSid(&sia, 2,
SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0, &pSid)) {
// 检查当前线程或进程的访问令牌是否包含该SID
if (!CheckTokenMembership(NULL, pSid, &bResult)) {
// 如果CheckTokenMembership失败,则可能不是管理员,但也可能因为其他原因
bResult = FALSE;
}
// 释放SID
FreeSid(pSid);
} else {
// 如果SID分配失败,则默认不是管理员
bResult = FALSE;
}
return bResult;
}
bool getadmin() {
// 获取当前程序的完整路径
TCHAR szPath[MAX_PATH];
GetModuleFileName(NULL, szPath, MAX_PATH);
// 检查当前用户是否是管理员
if (!IsUserAnAdmin()) {
// 如果不是管理员,则以管理员权限运行当前程序
SHELLEXECUTEINFO sei = {0};
sei.cbSize = sizeof(SHELLEXECUTEINFO);
sei.lpFile = szPath;
sei.nShow = SW_SHOWNORMAL;
sei.lpVerb = _T("runas"); // 指定操作为以管理员身份运行
ShellExecuteEx(&sei);
return false;
} else {
// 如果已经是管理员,则正常继续
cout << "已获得管理员权限\n";
return true;
}
}
void taskkill(bool KillSeewoService, bool Wanzixi) {
ifstream file(".\\settings\\write-log-when-killapp.seewokiller");
string value;
getline(file, value);
value = UTF8ToGBK(value);
bool log = false;
if (value == "true") {
CreateDirectory("./log", NULL);
log = true;
}
long long n = 1;
while (true) {
if (log == true) {
time_t now = time(nullptr);
tm* localTime = localtime(&now);
string filename = ".\\log\\log-" + to_string(localTime->tm_year + 1900) + "-" + to_string(localTime->tm_mon + 1) + "-" + to_string(localTime->tm_mday) + ".log";
ofstream file(filename.c_str(), ios::app);
now = time(nullptr);
localTime = localtime(&now);
string text = to_string(localTime->tm_hour) + ":" +
to_string(localTime->tm_min) + ":" +
(localTime->tm_sec < 10 ? "0" : "") +
to_string(localTime->tm_sec) +
"第" + to_string(n) + "次杀进程";
text = GBKToUTF8(text);
file << text << endl;
file.close();
n++;
}
thread a1(system, "TASKKILL /F /IM EasiRecorder.exe");
a1.detach();
//cout << "正在结束进程:轻录播\n";
//cout << "TASKKILL /F /IM EasiRecorder.exe\n";
system("TASKKILL /F /IM EasiRecorder.exe");
if (KillSeewoService == true) {
cout << "正在结束进程:希沃管家\n";
thread b1(system, "TASKKILL /F /IM SeewoServiceAssistant.exe");
thread b2(system, "TASKKILL /F /IM SeewoAbility.exe");
thread b3(system, "TASKKILL /F /IM SeewoCore.exe");
b1.detach();
b2.detach();
b3.join();
//cout << "TASKKILL /F /IM SeewoServiceAssistant.exe\n";
//system("TASKKILL /F /IM SeewoServiceAssistant.exe");
//cout << "TASKKILL /F /IM SeewoAbility.exe\n";
//system("TASKKILL /F /IM SeewoAbility.exe");
//cout << "TASKKILL /F /IM SeewoCore.exe\n";
//system("TASKKILL /F /IM SeewoCore.exe");
}
if (Wanzixi == true) {
thread c1(system, "taskkill /f /t /im taskmgr.exe");
thread c2(system, "TASKKILL /F /IM SystemSettings.exe");
thread c3(system, "taskkill /f /fi \"WINDOWTITLE eq 网络连接\"");
thread c4(system, "taskkill /f /fi \"WINDOWTITLE eq 控制面板\\网络和 Internet\\网络连接\"");
thread c5(system, "TASKKILL /F /IM msedge.exe");
thread c6(system, "TASKKILL /F /IM iexplore.exe");
c1.detach();
c2.detach();
c3.join();
c4.detach();
c5.detach();
c6.join();
//system("taskkill /f /t /im taskmgr.exe");
//cout << "正在结束进程:设置\n";
//cout << "TASKKILL /F /IM SystemSettings.exe\n";
//system("TASKKILL /F /IM SystemSettings.exe");
//cout << "正在结束进程:控制面板\n";
//cout << "TASKKILL /F /FI \"WINDOWTITLE eq 网络连接\"\n";
//system("taskkill /f /fi \"WINDOWTITLE eq 网络连接\"");
//system("taskkill /f /fi \"WINDOWTITLE eq 控制面板\\网络和 Internet\\网络连接\"");
//cout << "正在结束进程:Edge\n";
//cout << "TASKKILL /F /IM msedge.exe\n";
//system("TASKKILL /F /IM msedge.exe");
//cout << "正在结束进程:IE\n";
//cout << "TASKKILL /F /IM iexplore.exe\n";
//system("TASKKILL /F /IM iexplore.exe");
}
}
}
void uninstall() {
cls
cout << "正在卸载轻录播\n";
system("\"C:\\Program Files (x86)\\Seewo\\EasiRecorder\\Uninstall.exe\"");
cout << "正在卸载Easicare\n";
system("\"C:\\Program Files (x86)\\Seewo\\Easicare\\Uninstall.exe\"");
cout << "正在卸载EasiAgent\n";
system("\"C:\\Program Files (x86)\\Seewo\\EasiAgent\\Uninstall.exe\"");
cout << "正在卸载希沃智能笔助手\n";
system("\"C:\\Program Files (x86)\\Seewo\\SmartpenService\\Uninstall.exe\"");
return;
}
void liandianqi() {
cls
int gap;
int x, y;
SetColorAndBackground(4, 6);
cout << "警告:请勿用于正常上课!";
SetColorAndBackground(0, 7);
cout << "\n\n点击间隔:单位为毫秒,不支持小数,可输入0";
cout << "\n请输入点击间隔:";
cin >> gap;
while (cin.fail() or gap < 0) {
cin.clear();
cin.ignore(numeric_limits<streamsize>::max(), '\n');
cout << "输入错误,请重试:";
cin >> gap;
}
cout << "\n\n点击坐标:点击屏幕的坐标,输入114514为默认(跟随鼠标位置移动)\n";
cout << "请输入坐标x(横):";
cin >> x;
while (cin.fail() or x < 0) {
cin.clear();
cin.ignore(numeric_limits<streamsize>::max(), '\n');
cout << "输入错误,请重试:";
cin >> x;
}
cout << "\n请输入坐标y(纵):";
cin >> y;
while (cin.fail() or y < 0) {
cin.clear();
cin.ignore(numeric_limits<streamsize>::max(), '\n');
cout << "输入错误,请重试:";
cin >> y;
}
cout << "每" << gap << "秒点击屏幕一次,请将鼠标移动至合适位置\n";
system("pause");
long long i = 1;
while (true) {
cout << "\b\b\b\b\b\b\b\b\b\b\b\b\b\b" << i;
POINT cur_pos;
GetCursorPos(&cur_pos);
if (x != 114514) {
cur_pos.x = x;
}
if (y != 114514) {
cur_pos.y = y;
}
mouse_event(MOUSEEVENTF_LEFTDOWN, cur_pos.x, cur_pos.y, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, cur_pos.x, cur_pos.y, 0, 0);
i++;
S(gap);
}
}
void help(string name = "seewofreeze") {
if (name == "seewofreeze") {
cls
cout << "欢迎使用冰点还原帮助程序。\n";
cout << "正在检测...\n";
S(500);
if (fileExist(".\\SeewoFreeze\\SeewoFreezeUI.exe") == false) {
cls
cout << "检测到冰点还原软件不存在。\n";
cout << "请检查是否安装了冰点还原模块。\n";
cout << "\n如果您确认已经安装过冰点还原模块但仍无法使用,那么可能是杀毒软件问题。\n";
cout << "请关闭杀毒软件后重试。\n";
cout << "\n对于Windows安全中心,请进行以下操作:";
cout << "打开Windows安全中心\n";
cout << "选择“病毒和威胁防护”\n";
cout << "找到所有“篡改”“扫描”选项,全部关闭\n";
cout << "重新安装希沃克星。";
system("pause");
cls
return;
}
cls
cout << "请尝试执行以下操作。\n";
cout << "选择希沃克星安装目录下的SeewoFreeze文件夹,打开属性\n";
cout << "选择“安全”选项卡\n";
cout << "选择“高级”\n";
cout << "点击“禁用继承”\n";
cout << "选择“从此对象中删除所有已继承的权限”\n";
cout << "\n回到“高级”界面,点击“添加”\n";
cout << "点击“选择主体”,在“对象名称”文本框中输入以下内容:\n";
system("whoami");
cout << "勾选“完全控制”\n";
cout << "确定(如果窗口太大,可以用键盘回车)\n";
cout << "确定,关闭属性\n应用时一定要应用于子文件和子文件夹!!!!\n";
cout << "再次尝试冰点还原。\n";
system("pause");
return;
}
if (name == "command") {
cls
cout << "希沃克星允许使用命令行直接启动指定任务。\n";
cout << "晚自习制裁:";
SetColorAndBackground(0, 7);
cout << executable_path << "\\SeewoKiller.exe wanzixi";
SetColorAndBackground(7, 0);
cout << "\n\n循环清任务:";
SetColorAndBackground(0, 7);
cout << executable_path << "\\SeewoKiller.exe taskkill";
SetColorAndBackground(7, 0);
cout << "\n\n连点器:";
SetColorAndBackground(0, 7);
cout << executable_path << "\\SeewoKiller.exe liandianqi";
SetColorAndBackground(7, 0);
cout << "\n\n冰点破解:";
SetColorAndBackground(0, 7);
cout << executable_path << "\\SeewoKiller.exe seewofreeze";
SetColorAndBackground(7, 0);
cout << "\n";
while (true) {
cout << "按b并回车以返回";
string b;
cin >> b;
if (b == "b") {
return;
}
}
}
if (name == "plugin") {
cls
cout << "错误的插件: \n";
for (size_t i = 0; i < plugin.errorpath.size(); ++i) {
cout << " - " << plugin.errorpath[i] << endl;
}
cout << "\n";
cout << "按r重试,按其它键返回\n";
while (true) {
if (getch() == 'r') {
cls
poweron(true);
}
return;
}
}
}
struct JOKE { /*恶搞*/
void kill() {
while (true) {
system("TASKKILL /F /IM wps.exe");
system("TASKKILL /F /IM EasiNote.exe");
system("TASKKILL /F /IM EasiNote.BrowserSubprocess.exe");
system("TASKKILL /F /IM swenserver.exe");
system("TASKKILL /F /IM Cvte.RemoteProcess.exe");
system("TASKKILL /F /IM EasiCameraGuardian.exe");
system("TASKKILL /F /IM EasiCamera.exe");
system("TASKKILL /F /IM DingTalk.exe");
system("TASKKILL /F /IM WeChat.exe");
}
}
void copy_file() {
MessageBox(hwnd, _T("此功能可以提取任意文件夹的所有内容,且支持U盘。\n你现在需要设置这些文件的位置和拷贝后存储的位置。"), _T("提示"), MB_OK);
if (MessageBox(hwnd, _T("本软件不对你使用此功能造成的任何损失(包括但不限于驱逐电教、被叫去和老师喝茶等)负责,请慎重考虑!"), _T("警告"), MB_YESNO | MB_ICONWARNING) == IDNO) {
return;
}
MessageBox(hwnd, _T("你需要在接下来的控制台中输入文件来源和拷贝后的文件去向。"), _T("提示"), MB_OK);
SetColorAndBackground(7, 0);
cout << "\n请输入文件来源。\n";
SetColorAndBackground(4, 7);
cout << "注意:文件夹名称最后要输入\\。本程序不支持复制单个文件。\n示例:E:\\,F:\\马说课件\\\n";
SetColorAndBackground(7, 0);
cout << "请输入(输入1退出程序):";
string infile;
cin >> infile;
if (infile == "1") {
return;
}
SetColorAndBackground(7, 0);
cout << "\n请输入文件去向。\n";
SetColorAndBackground(4, 7);
cout << "注意:文件夹名称最后也要输入\\。\n";
SetColorAndBackground(7, 0);
cout << "请输入(输入0使用默认路径D:\\file\\,输入1退出程序):";
string outfile;
cin >> outfile;
if (outfile == "0") {
outfile = "D:\\file\\";
}
if (outfile == "1") {
return;
}
cout << "设置完成。当U盘插入后(目录存在),希沃克星会自动复制其中的文件。\n按任意键后开始搜索。";
getch();
cls
cout << "开始!!\n------------------\n正在等待目录出现";
string existpath = infile + "temp.dat";
while (fileExist(existpath.c_str()) == false) {
ofstream file(existpath.c_str());
file << GBKToUTF8("");
file.close();
}
string command = "del \"" + existpath + "\"";
system(command.c_str());
cout << "\n已找到文件夹,开始复制\n";
command = "xcopy \"" + infile + "\" \"" + outfile + "\" /E /I /H /C /Y";
system(command.c_str());
cout << "\n";
system("pause");
return;
}
} joke;
struct Launcher {
string listname(bool allowA, bool allowD, const vector<string>& liststring) {
const int n = liststring.size() - 1;
int channel = 1;
if (n > 0) {
gotoxy(0, 3);
SetColorAndBackground(7, 0);
for (int i = 1; i < channel; i++) {
cout << liststring[i] << "\n";
}
SetColorAndBackground(0, 7);
cout << liststring[channel] << "\n";
SetColorAndBackground(7, 0);
for (int i = channel + 1; i <= n; i++) {
cout << liststring[i] << "\n";
}
} else {
gotoxy(0, 3);
SetColorAndBackground(0, 7);
cout << "[暂无]\n";
SetColorAndBackground(7, 0);
}
// 获取控制台输入句柄
HANDLE hInput = GetStdHandle(STD_INPUT_HANDLE);
DWORD eventsRead;
INPUT_RECORD ir;
DWORD numEvents;
while (1) {
// 等待并读取一个输入事件(阻塞直到有事件)
ReadConsoleInput(hInput, &ir, 1, &eventsRead);
if (eventsRead == 0) continue;
// 只处理键盘事件
if (ir.EventType != KEY_EVENT) continue;
KEY_EVENT_RECORD& ker = ir.Event.KeyEvent;
// 忽略按键弹起事件
if (!ker.bKeyDown) continue;
// 获取虚拟键码
WORD vk = ker.wVirtualKeyCode;
char mapped = 0;
// 检测方向键
if (vk == VK_UP) mapped = 'w';
else if (vk == VK_DOWN) mapped = 's';
else if (vk == VK_LEFT) mapped = 'a';
else if (vk == VK_RIGHT) mapped = 'd';
// 检测回车键(VK_RETURN)
else if (vk == VK_RETURN) mapped = ' ';
// 检测字母键(wasd / WASD)
else {
// 获取实际字符(包括大小写)
char ch = ker.uChar.AsciiChar;
if (ch == 'w' || ch == 'W' || ch == 's' || ch == 'S' ||
ch == 'a' || ch == 'A' || ch == 'd' || ch == 'D') {
mapped = tolower(ch);
}
// 检测空格键
else if (ch == ' ') {
mapped = ' ';
}
}
// 如果映射到有效字符,则进入原有的 switch 处理
if (mapped != 0) {
char x = mapped; // 使用映射后的字符,后续 switch 不变
switch (x) {
case 's': {
if (n <= 1) {
break;
}
if (channel < n) {
channel++;
}
gotoxy(0, 3);
SetColorAndBackground(7, 0);
for (int i = 1; i < channel; i++) {
cout << liststring[i] << "\n";
}
SetColorAndBackground(0, 7);
cout << liststring[channel] << "\n";
SetColorAndBackground(7, 0);
for (int i = channel + 1; i <= n; i++) {
cout << liststring[i] << "\n";
}
break;
}
case 'w': {
if (n <= 1) {
break;
}
if (channel > 1) {
channel--;
}
gotoxy(0, 3);
SetColorAndBackground(7, 0);
for (int i = 1; i < channel; i++) {
cout << liststring[i] << "\n";
}
SetColorAndBackground(0, 7);
cout << liststring[channel] << "\n";
SetColorAndBackground(7, 0);
for (int i = channel + 1; i <= n; i++) {
cout << liststring[i] << "\n";
}
break;
}
case 'a': {
if (allowA == true) {
if (box > 1) {
box--;
}
}
return "-1";
}
case 'd': {
if (allowD == true) {
if (box < boxn) {
box++;
}
}
return "-1";
}
case ' ': {
return liststring[channel];
}
}
}
}
return "-2";
}
void head(string WindowTitle = "希沃克星", string cmdTitle = "SeewoKiller") {
string cmd = "title " + WindowTitle;
system(cmd.c_str());
cls
gotoxy(0, 0);
if (fastboot == true) {