-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.cs
213 lines (186 loc) · 9.24 KB
/
Form1.cs
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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Management;
using System.ServiceProcess;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace msconfuck
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//"Selective Startup"
private void PenisCheck_CheckedChanged(object sender, EventArgs e)
{
Penis1.Enabled = PenisCheck.Checked;
Penis2.Enabled = PenisCheck.Checked;
}
//"Normal Startup"
private void NormalButtonStartup_CheckedChanged(object sender, EventArgs e)
{
Penis1.Checked = true;
Penis2.Checked = true;
}
//"Diagnostic Startup"
private void DiagButtonPen_CheckedChanged(object sender, EventArgs e)
{
Penis1.Checked = false;
Penis2.Checked = false;
}
//"Help" button
private void HelpMyPenisBurns_Click(object sender, EventArgs e)
{
Process.Start("https://go.microsoft.com/fwlink/?LinkId=517009");
}
//cancel and OK buttons respectively
private void CancelMyProstateExam_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void AlrightDocMyPenisIsFineThanks_Click(object sender, EventArgs e)
{
Application.Exit();
}
void Add_Services()
{
foreach (ServiceController service in ServiceController.GetServices())
{
ListViewItem item = new ListViewItem(service.DisplayName);
item.SubItems.Add(new ListViewItem.ListViewSubItem(item, "Microsoft Corporation"));
item.SubItems.Add(new ListViewItem.ListViewSubItem(item, "Running"));
item.Checked = true;
Services.Items.Add(item);
}
}
public static string GetOSFriendlyName()
{
string result = string.Empty;
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT Caption FROM Win32_OperatingSystem");
foreach (ManagementObject os in searcher.Get())
{
result = os["Caption"].ToString();
break;
}
result = Regex.Replace(result, @"\D+", "");
return result;
}
Tuple<string,string,string> tup(string a, string b, string c) { return new Tuple<string, string, string>(a, b, c); }
Dictionary<string, string> tool_cmd_map = new Dictionary<string, string>();
private void Form1_Load(object sender, EventArgs e)
{
TheBootBois.Items.Clear();
TheBootBois.Items.Add("Windows "+GetOSFriendlyName()+" (C:\\Windows) : Current OS; Default OS");
TheBootBois.SetSelected(0, true);
//kill me please
List<Tuple<string, string, string>> tools_items = new List<Tuple<string, string, string>>();
tools_items.Add(tup("About Windows", "Display Windows version information.", "C:\\Windows\\system32\\winver.exe"));
tools_items.Add(tup("Change UAC Settings", "Change User Account Control settings.", "C:\\Windows\\System32\\UserAccountControlSettings.exe"));
tools_items.Add(tup("Security and Maintenance", "Open Security and Maintenance.", "C:\\Windows\\System32\\wscui.cpl"));
tools_items.Add(tup("Windows Troubleshooting", "Troubleshoot problems with your computer.", "C:\\Windows\\System32\\control.exe /name Microsoft.Troubleshooting"));
tools_items.Add(tup("Computer Management", "View and configure system settings and components.", "C:\\Windows\\System32\\compmgmt.msc"));
tools_items.Add(tup("System Information", "View advanced information about hardware and software settings.", "C:\\Windows\\System32\\msinfo32.exe"));
tools_items.Add(tup("Event Viewer", "View monitoring and troubleshooting messages.", "C:\\Windows\\System32\\eventvwr.exe"));
tools_items.Add(tup("Programs", "Launch, add, or remove programs and Windows components.", "C:\\Windows\\System32\\appwiz.cpl"));
tools_items.Add(tup("System Properties", "View basic information about your computer system settings.", "C:\\Windows\\System32\\control.exe system"));
tools_items.Add(tup("Internet Options", "View Internet Properties.", "C:\\Windows\\System32\\inetcpl.cpl"));
tools_items.Add(tup("Internet Protocol Configuration", "View and configure network address settings.", "C:\\Windows\\System32\\cmd.exe /k %windir%\\system32\\ipconfig.exe%%%ADV/all"));
tools_items.Add(tup("Performance Monitor", "Monitor the performance of local or remote computers.", "C:\\Windows\\System32\\perfmon.exe%%%ADV/sys"));
tools_items.Add(tup("Resource Monitor", "Monitor the performance and resource usage of the local computer.", "C:\\Windows\\System32\\resmon.exe"));
tools_items.Add(tup("Task Manager", "View details about programs and processes running on your computer.", "C:\\Windows\\System32\\taskmgr.exe /7"));
tools_items.Add(tup("Command Prompt", "Open a command prompt window.", "C:\\Windows\\System32\\cmd.exe"));
tools_items.Add(tup("Registry Editor", "Make changes to the Windows registry.", "C:\\Windows\\System32\\regedt32.exe"));
tools_items.Add(tup("Remote Assistance", "Receive help from (or offer help to) a friend over the Internet.", "C:\\Windows\\System32\\msra.exe"));
tools_items.Add(tup("System Restore", "Restore your computer system to an earlier state.", "C:\\Windows\\System32\\rstrui.exe"));
foreach(Tuple<string,string,string> tool in tools_items)
{
ListViewItem item = new ListViewItem(tool.Item1);
item.SubItems.Add(tool.Item2);
tool_cmd_map.Add(tool.Item1, tool.Item3);
ToolsBoys.Items.Add(item);
}
Add_Services();
}
//"Safe Boot" checkbox
private void SafeBootMan_CheckedChanged(object sender, EventArgs e)
{
Lol1.Enabled = SafeBootMan.Checked;
Lol2.Enabled = SafeBootMan.Checked;
Lol3.Enabled = SafeBootMan.Checked;
Lol4.Enabled = SafeBootMan.Checked;
}
//Link on the "Startup" tab
private void OpenMeUpDaddyo_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start("taskmgr");
}
//"Advanced Options" in "Boot" tab
private void ShowMeMoreBootsPapa_Click(object sender, EventArgs e)
{
using (AdvancedBootBoy b = new AdvancedBootBoy()) b.ShowDialog();
}
private void ExecToolCmd_Click(object sender, EventArgs e)
{
//split into command data
if (string.IsNullOrEmpty(ToolCMD.Text)) return;
List<string> cmd_split = ToolCMD.Text.Split(' ').ToList();
string bin = cmd_split[0];
cmd_split.RemoveAt(0);
string args = string.Join(" ", cmd_split.ToArray());
//launch binary with args
Process.Start(new ProcessStartInfo(bin, args));
}
private void AdvancedToolCMD_CheckedChanged(object sender, EventArgs e)
{
if (current_cmd_dat == null) return;
//if we checked, add the extra feature
//if not, set to the raw command
if (AdvancedToolCMD.Checked) ToolCMD.Text = current_cmd_dat[0] + " " + current_cmd_dat[1];
else ToolCMD.Text = current_cmd_dat[0];
}
string[] current_cmd_dat = null;
private void ToolsBoys_SelectedIndexChanged(object sender, EventArgs e)
{
if (ToolsBoys.SelectedItems.Count == 0) return;
current_cmd_dat = tool_cmd_map[ToolsBoys.SelectedItems[0].Text].Split(new string[] { "%%%ADV" }, StringSplitOptions.RemoveEmptyEntries);
//add tool cmd
ToolCMD.Text = current_cmd_dat[0];
if (current_cmd_dat.Length == 2 && AdvancedToolCMD.Checked) ToolCMD.Text += " " + current_cmd_dat[1];
AdvancedToolCMD.Visible = current_cmd_dat.Length == 2;
}
void ToggleServiceCheck(bool check)
{
foreach (ListViewItem item in Services.Items) item.Checked = check;
}
private void DisableServ_Click(object sender, EventArgs e)
{
ToggleServiceCheck(false);
}
private void EnableServ_Click(object sender, EventArgs e)
{
ToggleServiceCheck(true);
}
private void HideMicroServices_CheckedChanged(object sender, EventArgs e)
{
if (HideMicroServices.Checked) Services.Items.Clear();
else Add_Services();
}
//"Apply" button
private void ApplyMyPenisOintment_MouseEnter(object sender, EventArgs e)
{
ApplyMyPenisOintment.Enabled = false;
}
private void ApplyMyPenisOintment_MouseLeave(object sender, EventArgs e)
{
ApplyMyPenisOintment.Enabled = true;
}
}
}