forked from MarkusMaal/BlueScreenSimulatorPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cs
More file actions
1708 lines (1601 loc) · 64.6 KB
/
Main.cs
File metadata and controls
1708 lines (1601 loc) · 64.6 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
using System;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using System.Diagnostics;
using Microsoft.Win32;
using SimulatorDatabase;
using System.Threading;
using System.Net.NetworkInformation;
using System.Collections.Generic;
namespace UltimateBlueScreenSimulator
{
public partial class Main : Form
{
internal BlueScreen me;
//these variables deal with error codes
public string c1 = "RRRRRRRRRRRRRRRR";
public string c2 = "RRRRRRRRRRRRRRRR";
public string c3 = "RRRRRRRRRRRRRRRR";
public string c4 = "RRRRRRRRRRRRRRRR";
public string kode = "";
public string emoticon = ":(";
//these variables are used for prank mode
//this variable determines whether or not to display a message
public bool showmsg = false;
//these variables are for displaying a message
public string MsgBoxMessage = "Enter a message here.";
public string MsgBoxTitle = "Enter a title here";
public MessageBoxIcon MsgBoxIcon = MessageBoxIcon.Exclamation;
public MessageBoxButtons MsgBoxType = MessageBoxButtons.OK;
//these variables are used for triggers
public int[] time = { 0, 5, 0 };
public string appname = "notepad.exe";
//timecatch determines whether or not the trigger is related to time
public bool timecatch = true;
//trigger device for prank mode
public string[] usb_device = { };
readonly Splash spl2 = new Splash();
//determines whether or not to close after closing a blue screen
public bool closecuzhidden = false;
//if true, closes form1 no matter what
public int error = 0;
//set cursor blink speed
public int blinkspeed = 100;
//whether or not the update is postponed
public bool postponeupdate = false;
public bool realpostpone = false;
//whether or not the automatic update check is allowed
public bool autoupdate = true;
//whether or not the updater hashchecks downloads
public bool hashverify = true;
//whether or not to show the mouse cursor in fullscreen mode
public bool showcursor = false;
//whether or not the user can close bluescreen with Alt+F4
public bool lockout = false;
//visible operating systems
public bool[] osshows = { true, true, true, true, true, true, true, true, true, true, true, true};
//enable/disable easter eggs
public bool enableeggs = true;
//indicates whether or not the about/settings window is visible
public bool abopen = false;
//scaling mode string
public string GMode = "HighQualityBicubic";
//if enabled, the program can write files
public bool fileio = true;
//specific OS when given in argument
public string specificos = "";
//this variable stores troubleshooting text for Windows XP/Vista/7 blue screens
public string supporttext = "If this is the first time you've seen this Stop error screen,\nrestart your computer. If this screen appears again, follow\nthese steps:\n\nCheck to make sure any new hardware or software is properly installed.\nIf this is a new installation, ask your hardware or software manufacturer\nfor any Windows updates you might need.\n\nIf problems continue, disable or remove any newly installed hardware\nor software. Disable BIOS memory options such as caching or shadowing.\nIf you need to use Safe mode to remove or disable components, restart\nyour computer, press F8 to select Advanced Startup Options, and then\nselect Safe Mode.";
internal bool displayone = false;
public static ThreadStart ts;
Thread bsod_starter;
public Main()
{
InitializeComponent();
}
private void ChangeConfiguration(object sender, EventArgs e)
{
if (linkLabel1.Visible)
{
linkLabel1.Visible = false;
label1.Text = "Select preset:";
windowVersion.Visible = true;
}
if (windowVersion.Items.Count == 1)
{
linkLabel1.Visible = true;
label1.Text = "Selected preset: " + windowVersion.SelectedItem.ToString();
linkLabel1.Location = new Point(label1.Location.X + label1.Width, linkLabel1.Location.Y);
windowVersion.Visible = false;
}
//hide all controls
WXOptions.Visible = false;
errorCode.Visible = false;
nineXmessage.Visible = false;
serverBox.Visible = false;
greenBox.Visible = false;
qrBox.Visible = false;
checkBox1.Visible = false;
winMode.Visible = false;
acpiBox.Visible = false;
amdBox.Visible = false;
stackBox.Visible = false;
checkBox2.Enabled = true;
ntPanel.Visible = false;
memoryBox.Visible = false;
dumpBox.Visible = false;
winPanel.Visible = false;
addInfFile.Enabled = false;
advNTButton.Visible = false;
dumpBox.Enabled = true;
eCodeEditButton.Visible = false;
devPCBox.Visible = false;
progressTuneButton.Visible = false;
progressTunerToolStripMenuItem.Enabled = false;
blackScreenBox.Visible = false;
try
{
// set current bluescreen
me = Program.bluescreens[Program.bluescreens.Count - 1 - windowVersion.SelectedIndex];
} catch (Exception ex)
{
me.Crash(ex.Message, ex.StackTrace, "OrangeScreen");
}
// set control visibility for specific OS-es
if (me.GetString("os") == "Windows 11")
{
WXOptions.Visible = true;
serverBox.Visible = true;
qrBox.Visible = true;
errorCode.Visible = true;
autoBox.Checked = true;
checkBox1.Visible = true;
winMode.Visible = true;
memoryBox.Visible = true;
eCodeEditButton.Visible = true;
blackScreenBox.Visible = true;
progressTuneButton.Visible = true;
progressTunerToolStripMenuItem.Enabled = true;
blackScreenBox.Checked = me.GetBool("blackscreen");
}
else if (me.GetString("os") == "Windows 10")
{
WXOptions.Visible = true;
serverBox.Visible = true;
greenBox.Visible = true;
qrBox.Visible = true;
errorCode.Visible = true;
autoBox.Checked = true;
checkBox1.Visible = true;
winMode.Visible = true;
memoryBox.Visible = true;
eCodeEditButton.Visible = true;
progressTunerToolStripMenuItem.Enabled = true;
devPCBox.Visible = true;
progressTuneButton.Visible = true;
}
else if (me.GetString("os") == "Windows 8/8.1")
{
WXOptions.Visible = true;
errorCode.Visible = true;
checkBox1.Visible = true;
winMode.Visible = true;
memoryBox.Visible = true;
eCodeEditButton.Visible = true;
progressTunerToolStripMenuItem.Enabled = true;
progressTuneButton.Visible = true;
}
else if ((me.GetString("os") == "Windows Vista") || (me.GetString("os") == "Windows 7"))
{
errorCode.Visible = true;
winMode.Visible = true;
acpiBox.Visible = true;
checkBox1.Visible = true;
autoBox.Visible = true;
dumpBox.Visible = true;
addInfFile.Enabled = true;
advNTButton.Visible = true;
eCodeEditButton.Visible = true;
progressTunerToolStripMenuItem.Enabled = true;
}
else if (me.GetString("os") == "Windows XP")
{
errorCode.Visible = true;
winMode.Visible = true;
checkBox1.Visible = true;
autoBox.Visible = true;
dumpBox.Visible = true;
addInfFile.Enabled = true;
advNTButton.Visible = true;
eCodeEditButton.Visible = true;
}
else if (me.GetString("os") == "Windows 2000")
{
errorCode.Visible = true;
winMode.Visible = true;
checkBox1.Checked = true;
eCodeEditButton.Visible = true;
advNTButton.Visible = true;
}
else if (me.GetString("os") == "Windows 9x/Me")
{
nineXmessage.Visible = true;
winMode.Visible = true;
eCodeEditButton.Visible = true;
}
else if (me.GetString("os") == "Windows CE")
{
winMode.Visible = true;
errorCode.Visible = true;
checkBox2.Checked = false;
checkBox2.Enabled = false;
textBox2.Enabled = false;
}
else if (me.GetString("os") == "Windows NT 3.x/4.0")
{
errorCode.Visible = true;
amdBox.Visible = true;
stackBox.Visible = true;
ntPanel.Visible = true;
winMode.Visible = true;
advNTButton.Visible = true;
eCodeEditButton.Visible = true;
}
else if (me.GetString("os") == "Windows 3.1x")
{
winMode.Visible = true;
}
else if (me.GetString("os") == "Windows 1.x/2.x")
{
winMode.Visible = true;
winPanel.Visible = true;
}
bool inlist = false;
foreach (string item in comboBox1.Items)
{
if (item == me.GetString("code"))
{
inlist = true;
}
}
customCheckBox.Checked = !inlist;
codeCustomizationToolStripMenuItem.Enabled = eCodeEditButton.Visible;
advancedNTOptionsToolStripMenuItem.Enabled = advNTButton.Visible;
// load options for current bluescreen
autoBox.Checked = me.GetBool("autoclose");
serverBox.Checked = me.GetBool("server");
greenBox.Checked = me.GetBool("green");
qrBox.Checked = me.GetBool("qr");
comboBox1.SelectedItem = me.GetString("code");
comboBox2.SelectedItem = me.GetString("screen_mode");
checkBox1.Checked = me.GetBool("show_description");
checkBox2.Checked = me.GetBool("show_file");
textBox2.Text = me.GetString("culprit");
amdBox.Checked = me.GetBool("amd");
stackBox.Checked = me.GetBool("stack_trace");
blinkBox.Checked = me.GetBool("blink");
acpiBox.Checked = me.GetBool("acpi");
playSndBox.Checked = me.GetBool("playsound");
waterBox.Checked = me.GetBool("watermark");
winMode.Checked = me.GetBool("windowed");
if (acpiBox.Checked)
{
dumpBox.Enabled = false;
}
win1startup.Checked = false;
win2startup.Checked = false;
nostartup.Checked = false;
switch (me.GetString("qr_file"))
{
case "local:0":
win1startup.Checked = true;
break;
case "local:1":
win2startup.Checked = true;
break;
case "local:null":
nostartup.Checked = true;
break;
}
}
public void GetOS()
{
windowVersion.Items.Clear();
for (int i = Program.bluescreens.Count - 1; i >= 0 ; i--)
{
windowVersion.Items.Add(Program.bluescreens[i].GetString("friendlyname"));
}
WXOptions.Visible = false;
errorCode.Visible = false;
nineXmessage.Visible = false;
serverBox.Visible = false;
greenBox.Visible = false;
qrBox.Visible = false;
checkBox1.Visible = false;
winMode.Visible = false;
acpiBox.Visible = false;
amdBox.Visible = false;
stackBox.Visible = false;
checkBox2.Enabled = true;
ntPanel.Visible = false;
if (windowVersion.Items.Count > 0) { windowVersion.SelectedIndex = 0; }
string winver = "";
int os_build = 0;
try
{
winver = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName", "").ToString();
os_build = Convert.ToInt32(Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "CurrentBuild", "0").ToString());
}
catch
{
}
if (specificos != "")
{
winver = specificos;
specificos = "";
}
//this code identifies Windows 11
if (os_build >= 22000)
{
SetOS("Windows 11");
}
//this code identifies Windows 10
else if (winver.Contains("Windows 10"))
{
SetOS("Windows 10");
}
//this code identifies Windows 8 or Windows 8.1
else if (winver.Contains("Windows 8"))
{
SetOS("Windows 8");
}
//this code identifies Windows 7
else if (winver.Contains("Windows 7"))
{
SetOS("Windows 7");
}
//this code identifies Windows Vista
else if (winver.Contains("Windows Vista"))
{
SetOS("Windows Vista");
}
//this code identifies Windows XP
else if (winver.Contains("Windows XP"))
{
SetOS("Windows XP");
}
//this code identifies Windows 2000
else if ((winver.Contains("Windows 2000")) || (winver.Contains("Windows NT 5")))
{
SetOS("Windows 2000");
}
//this code identifies Windows 95 or Windows 98
else if ((winver.Contains("Windows 95")) || (winver.Contains("Windows 98")))
{
SetOS("Windows 9x");
}
//this code identifies old Windows NT versions
else if ((winver.Contains("Windows NT 4")) || (winver.Contains("Windows NT 3")))
{
SetOS("Windows NT");
}
}
void SetOS(string winver)
{
for (int i = 0; i < windowVersion.Items.Count; i++)
{
if (windowVersion.Items[i].ToString().Contains(winver))
{
windowVersion.SelectedIndex = i;
}
}
}
public void Crash()
{
ts = new ThreadStart(ShowBlueScreen);
bsod_starter = new Thread(ts);
bsod_starter.Start();
}
public bool DoWeHaveInternet(long minimumSpeed)
{
if (!NetworkInterface.GetIsNetworkAvailable())
return false;
foreach (NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces())
{
// discard because of standard reasons
if ((ni.OperationalStatus != OperationalStatus.Up) ||
(ni.NetworkInterfaceType == NetworkInterfaceType.Loopback) ||
(ni.NetworkInterfaceType == NetworkInterfaceType.Tunnel))
continue;
// this allow to filter modems, serial, etc.
// I use 10000000 as a minimum speed for most cases
if (ni.Speed < minimumSpeed)
continue;
// discard virtual cards (virtual box, virtual pc, etc.)
if ((ni.Description.IndexOf("virtual", StringComparison.OrdinalIgnoreCase) >= 0) ||
(ni.Name.IndexOf("virtual", StringComparison.OrdinalIgnoreCase) >= 0))
continue;
// discard "Microsoft Loopback Adapter", it will not show as NetworkInterfaceType.Loopback but as Ethernet Card.
if (ni.Description.Equals("Microsoft Loopback Adapter", StringComparison.OrdinalIgnoreCase))
continue;
return true;
}
return false;
}
private void Initialize(object sender, EventArgs e)
{
ts = new ThreadStart(ShowBlueScreen);
bsod_starter = new Thread(ts);
try
{
System.IO.File.WriteAllText("test.log", "");
System.IO.File.Delete("test.log");
fileio = true;
}
catch
{
fileio = false;
autoupdate = false;
}
if (displayone)
{
windowVersion.Items.Clear();
for (int i = Program.bluescreens.Count - 1; i >= 0; i--)
{
windowVersion.Items.Add(Program.bluescreens[i].GetString("friendlyname"));
}
windowVersion.SelectedItem = me.GetString("friendlyname");
windowVersion.Visible = false;
label1.Text = "Selected preset: " + windowVersion.SelectedItem.ToString();
linkLabel1.Location = new Point(label1.Location.X + label1.Width, linkLabel1.Location.Y);
linkLabel1.Visible = true;
} else
{
GetOS();
}
if ((autoupdate == true) && DoWeHaveInternet(1000))
{
UpdateInterface ui = new UpdateInterface();
ui.DownloadFile(Program.update_server + "/bssp_version.txt", "vercheck.txt");
updateCheckerTimer.Enabled = true;
if (System.IO.File.Exists("BSSP_latest.zim"))
{
try
{
System.IO.File.Delete("BSSP_latest.zim");
}
catch
{
fileio = false;
}
}
}
if (this.WindowState == FormWindowState.Minimized)
{
this.Hide();
}
if (bsod_starter.IsAlive)
{
if (Program.hidden)
{
if (error == 0)
{
spl2.SplashText.Text = "Generating blue screen...";
spl2.veriFileTimer.Enabled = false;
spl2.Show();
}
}
}
switch (error)
{
case 0:
break;
case 1:
MessageBox.Show("No command specified in hidden mode\nAre you missing the /c argument?\n\n0x001: COMMAND_DEADLOCK", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 2:
MessageBox.Show("Specified file is either corrupted or not a valid blue screen simulator plus hack file.\n\n0x002: HEADER_MISSING", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 3:
MessageBox.Show("Specified file is either corrupted or incompatible with this version of blue screen simulator plus.\n\n0x003: INCOMPATIBLE_HACK", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 4:
MessageBox.Show("Specified file is either corrupt or does not exist.\n\n0x004: FILE_MISSING", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 5:
MessageBox.Show("Specified file is either corrupted or incompatible with this version of blue screen simulator plus.\n\n0x005: MISSING_ATTRIBUTES", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 6:
MessageBox.Show("Specified file is either corrupted or incompatible with this version of blue screen simulator plus.\n\n0x006: FACE_TOO_LONG", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 7:
MessageBox.Show("Specified file is either corrupted or incompatible with this version of blue screen simulator plus.\n\n0x007: FACE_TOO_SHORT", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 8:
MessageBox.Show("Specified file is either corrupted or incompatible with this version of blue screen simulator plus.\n\n0x008: RGB_OUT_OF_RANGE", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 9:
MessageBox.Show("Specified file is either corrupted or incompatible with this version of blue screen simulator plus.\n\n0x009: RGB_VALUE_NEGATIVE", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 10:
MessageBox.Show("A supported Windows version could not be identified.\n\n0x00A: PRODUCT_NAME_NOT_LISTED", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 11:
MessageBox.Show("Windows version could not be identified.\nAre you using a compatibility layer?\n\n0x00B: PRODUCT_NAME_MISSING", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 12:
MessageBox.Show("Cannot find the Windows version specified\n\n0x00C: WINVER_NOT_FOUND", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 13:
MessageBox.Show("Cannot find the error code specified\n\n0x00D: NTCODE_NOT_FOUND", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 14:
MessageBox.Show("Cannot find the error code specified\n\n0x00D: 9XCODE_NOT_FOUND", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 15:
MessageBox.Show("The syntax of the command is incorrect\n\n0x00E: BAD_SYNTAX", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 16:
MessageBox.Show("The syntax of the command is incorrect\n\n0x00F: BAD_SYNTAX", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 17:
MessageBox.Show("The syntax of the command is incorrect\n\n0x010: BAD_SYNTAX", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 18:
MessageBox.Show("The syntax of the command is incorrect\n\n0x011: BAD_SYNTAX", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 19:
MessageBox.Show("Internal database could not be loaded\n\n0x012: NT_DATABASE_MISSING", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 20:
MessageBox.Show("Internal database seems to be corrupted\n\n0x013: NT_DATABASE_CORRUPTED", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 23:
MessageBox.Show("The syntax of the command is incorrect\n\n0x016: COMMAND_ARGUMENT_INVALID", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 24:
MessageBox.Show("Specified hack file does not exist\n\n0x014: HACK_FILE_NON_EXISTENT", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
case 25:
MessageBox.Show("Specified hack file is either corrupted or incompatible with this version of blue screen simulator plus.\n\n0x015: HACK_FILE_INCOMPATIBLE", "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Error);
break;
default:
this.Close();
break;
}
}
private void Button1_Click(object sender, EventArgs e)
{
if (enableeggs == true)
{
if (textBox2.Text.ToLower().Contains("null"))
{
foreach (Control c in this.Controls)
{
c.Text = "undefined";
}
foreach (Control c in flowLayoutPanel1.Controls)
{
c.Text = "undefined";
c.Dispose();
}
foreach (Control c in flowLayoutPanel2.Controls)
{
c.Text = "undefined";
c.Dispose();
}
foreach (Control c in ntPanel.Controls)
{
c.Text = "undefined";
c.Dispose();
}
foreach (Control c in errorCode.Controls)
{
c.Text = "undefined";
c.Dispose();
}
foreach (Control c in nineXmessage.Controls)
{
c.Text = "undefined";
c.Dispose();
}
this.Text = "";
this.HelpButton = false;
this.ShowIcon = false;
this.ShowInTaskbar = false;
return;
}
}
if (Program.loadfinished && this.Visible)
{
Program.loadfinished = false;
Gen g = new Gen();
g.Show();
}
Program.f1.lockout = false;
Crash();
}
//launches troubleshooting text editor
private void Button2_Click(object sender, EventArgs e)
{
SupportEditor se = new SupportEditor();
se.Show();
}
public void ShowBlueScreen()
{
if (windowVersion.Items.Count < 1)
{
Program.loadfinished = true;
if (enableeggs)
{
MessageBox.Show("Please select a Windows version! Also, how in the world did you deselect a dropdown list?", "Error displaying blue screen", MessageBoxButtons.OK, MessageBoxIcon.Error);
} else
{
MessageBox.Show("No configuration selected", "Error displaying blue screen", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
return;
}
me.Show();
try
{
if (spl2.Visible) { spl2.Close(); }
}
catch
{
}
Thread.CurrentThread.Abort();
}
//search function
private void TextBox1_TextChanged(object sender, EventArgs e)
{
foreach (string it in comboBox1.Items)
{
if (it.Contains(textBox1.Text.Replace(" ", "_").ToUpper()))
{
comboBox1.SelectedItem = it;
break;
}
}
}
//random function
private void Button3_Click(object sender, EventArgs e)
{
if (MessageBox.Show("This will change random settings on various blue screens. Are you sure you want to continue?", "I'm feeling unlucky", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{
Program.loadfinished = false;
Gen g = new Gen();
g.Show();
Thread.Sleep(10);
RandFunction();
button1.PerformClick();
}
}
internal void RandFunction()
{
Random r = new Random();
for (int i = 0; i < Program.bluescreens.Count; i++)
{
foreach (string kvp in Program.bluescreens[i].AllBools().Keys.ToArray<string>())
{
bool value = r.Next(0, 1) == 1;
Program.bluescreens[i].SetBool(kvp, value);
}
Program.bluescreens[i].SetString("code", comboBox1.Items[r.Next(0, comboBox1.Items.Count - 1)].ToString());
if (Program.bluescreens[i].GetString("os") != "Windows 3.1x") { Program.bluescreens[i].SetString("screen_mode", comboBox2.Items[r.Next(0, comboBox2.Items.Count - 1)].ToString()); }
Program.bluescreens[i].SetBool("windowed", true);
Thread.Sleep(16);
}
windowVersion.SelectedIndex = SetRnd(windowVersion.Items.Count - 1);
if (enableeggs)
{
if (textBox1.Text == "blackscreen")
{
windowVersion.Items.Add("Windows Vista/7 BOOTMGR (1024x768, ClearType)");
windowVersion.SelectedIndex = windowVersion.Items.Count - 1;
}
}
textBox2.Text = me.GenFile();
if (windowVersion.SelectedIndex == 4) { checkBox1.Checked = true; }
}
int SetRnd(int limit)
{
System.Threading.Thread.Sleep(20);
Random rnd = new Random();
try
{
int outp = 0;
outp = rnd.Next(limit);
return outp;
}
catch
{
return 0;
}
}
//Technical address generation options
private void Button4_Click(object sender, EventArgs e)
{
if (enableeggs)
{
if (textBox1.Text == "RASTER_FONTS")
{
BTS bts = new BTS();
bts.Show();
return;
}
}
IndexForm iform = new IndexForm
{
me = me,
c1 = me.GetCodes()[0],
c2 = me.GetCodes()[1],
c3 = me.GetCodes()[2],
c4 = me.GetCodes()[3]
};
iform.Show();
}
//enables, disa
private void CheckBox2_CheckedChanged(object sender, EventArgs e)
{
textBox2.Enabled = checkBox2.Checked;
button2.Enabled = checkBox2.Checked;
me.SetBool("show_file", checkBox2.Checked);
}
private void Button5_Click(object sender, EventArgs e)
{
if (enableeggs)
{
if (textBox2.Text == "blaster")
{
foreach (Control c in this.Controls)
{
c.Text = "form";
}
foreach (Panel p in this.Controls.OfType<Panel>())
{
foreach (Control c in p.Controls)
{
c.Text = "panel";
}
foreach (Panel q in p.Controls.OfType<Panel>())
{
foreach (Panel r in q.Controls.OfType<Panel>())
{
foreach (Control f in r.Controls)
{
foreach (Panel s in q.Controls.OfType<Panel>())
{
foreach (Control d in s.Controls)
{
d.Text = "spaghetti";
}
s.Text = "subsubsubpanel";
}
f.Text = "subsubpanel";
}
}
foreach (Control c in q.Controls)
{
c.Text = "subpanel";
}
}
}
return;
}
}
StringEdit bh = new StringEdit
{
me = me
};
bh.Show();
}
private void Form1_HelpButtonClicked(object sender, CancelEventArgs e)
{
if (!abopen) {
AboutSettingsDialog a1 = new AboutSettingsDialog
{
Text = "Help and about"
};
a1.Show();
}
else
{
MessageBox.Show("Help and about window is already open", "Cannot open help and about", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
e.Cancel = true;
}
private void Timer2_Tick(object sender, EventArgs e)
{
if (timecatch)
{
int hrs = time[0];
int mins = time[1];
int secs = time[2];
if ((hrs == 0) && (mins == 0) && (secs == 0))
{
me.SetBool("watermark", false);
me.SetBool("windowed", false);
me.SetBool("autoclose", true);
Crash();
waitPopup.Enabled = true;
prankModeTimer.Enabled = false;
}
if (secs == 0)
{
mins -= 1;
secs = 60;
}
if (mins == -1)
{
hrs -= 1;
mins = 59;
}
if (hrs == -1)
{
hrs = 0;
mins = 0;
secs = 0;
} else
{
secs -= 1;
}
int[] timex = { hrs, mins, secs };
time = timex;
} else if (usb_device.Length > 0)
{
foreach (USBDeviceInfo usb in USBDeviceInfo.GetUSBDevices())
{
string usbinfo = usb.DeviceID;
if ((usbinfo == usb_device[0]))
{
me.SetBool("watermark", false);
me.SetBool("windowed", false);
me.SetBool("autoclose", true);
Crash();
waitPopup.Enabled = true;
prankModeTimer.Enabled = false;
break;
}
}
} else
{
bool getcatch = false;
if (Process.GetProcessesByName(appname.Replace(".exe", "")).Length != 0)
{
getcatch = true;
}
if (getcatch)
{
me.SetBool("watermark", false);
me.SetBool("windowed", false);
me.SetBool("autoclose", true);
Crash();
waitPopup.Enabled = true;
prankModeTimer.Enabled = false;
}
}
}
private void Form1_Shown(object sender, EventArgs e)
{
lockout = false;
}
private void Button7_Click(object sender, EventArgs e)
{
UpdateInterface ui = new UpdateInterface();
ui.Show();
this.Hide();
}
private void Timer3_Tick(object sender, EventArgs e)
{
if (System.IO.File.Exists("BSSP.exe"))
{
updateCheckerTimer.Enabled = false;
MessageBox.Show("Thank you for installing the latest version of Blue screen simulator plus :)\n\nWhat's new?\n* Fixed an issue related to downgrading", "Update was successful", MessageBoxButtons.OK, MessageBoxIcon.Information);
int tries = 0;
while (System.IO.File.Exists("BSSP.exe"))
{
tries += 1;
try
{
System.IO.File.Move("BSSP.exe", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\BSSP_old.exe");
System.IO.File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\BSSP_old.exe");
}
catch
{
//yo
}
if (tries > 500)
{
break;
}
}
}
try
{
if (System.IO.File.Exists("vercheck.txt"))
{
string[] lines = System.IO.File.ReadAllLines("vercheck.txt");
if (Convert.ToDouble(lines[0].Replace(".", ",").Replace("\r", "").Replace("\n", "").Trim()) > 2.11)
{
updateCheckerTimer.Enabled = false;
System.IO.File.Delete("vercheck.txt");
if (MessageBox.Show("A new version of blue screen simulator is available. Would you like to update now?", "Update available", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
System.IO.File.WriteAllText("hash.txt", lines[1].Trim());
if (postponeupdate == false)
{
UpdateInterface ui = new UpdateInterface();
ui.Show();
this.Hide();
}
else
{
realpostpone = true;
MessageBox.Show("The update has been postponed to install when the program is closed.");
}
}
} else
{
if (updateCheckerTimer.Interval == 5999)
{
updateCheckerTimer.Interval = 6000;
updateCheckerTimer.Enabled = false;
System.IO.File.Delete("vercheck.txt");
if (MessageBox.Show("A new version of blue screen simulator is available. Would you like to update now?", "Update available", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
System.IO.File.WriteAllText("hash.txt", lines[1].Trim());
if (postponeupdate == false)
{
UpdateInterface ui = new UpdateInterface();
ui.Show();
this.Hide();
}
else
{
realpostpone = true;
MessageBox.Show("The update has been postponed to install when the program is closed.");
}
}
}
else if (updateCheckerTimer.Interval == 5998)
{
updateCheckerTimer.Interval = 6000;
updateCheckerTimer.Enabled = false;
MessageBox.Show("This version of blue screen simulator plus is up to date", "Blue screens simulator plus", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
System.IO.File.Delete("vercheck.txt");