This repository has been archived by the owner on Jul 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EmergencyDialog.cs
87 lines (82 loc) · 3.18 KB
/
EmergencyDialog.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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using Microsoft.Win32;
namespace raptor
{
public partial class EmergencyDialog : Form
{
private static int challenge;
private BigInteger bi_m, bi_n, bi_e, bi_r, bi_check;
Random random = new Random();
public EmergencyDialog()
{
InitializeComponent();
challenge = random.Next(99999);
this.label3.Text = "" + challenge;
this.textBox1.Focus();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
this.bi_e = new BigInteger(65537);
this.bi_m = new BigInteger(challenge);
this.bi_n = new BigInteger("5239739256519985939", 10);
this.bi_r = new BigInteger(this.textBox1.Text, 10);
bi_check = this.bi_r.modPow(this.bi_e, this.bi_n);
if (bi_check.Equals(bi_m))
{
Process proc = new Process();
try
{
RegistryKey HKLM = Registry.LocalMachine;
RegistryKey System_Key = HKLM.OpenSubKey("System");
RegistryKey CurrentControlSet = System_Key.OpenSubKey("CurrentControlSet");
RegistryKey Control_Key = CurrentControlSet.OpenSubKey("Control");
RegistryKey SDP = Control_Key.OpenSubKey("StorageDevicePolicies",true);
SDP.SetValue("WriteProtect", 0, RegistryValueKind.DWord);
}
catch (System.Exception ex)
{
}
if (System.IO.File.Exists("c:\\windows\\system32\\cmd.exe"))
{
proc.StartInfo.FileName = "c:\\windows\\system32\\cmd.exe";
}
else if (System.IO.File.Exists("x:\\minint\\system32\\cmd.exe"))
{
proc.StartInfo.FileName = "x:\\minint\\system32\\cmd.exe";
}
else if (System.IO.File.Exists("x:\\windows\\system32\\cmd.exe"))
{
proc.StartInfo.FileName = "x:\\windows\\system32\\cmd.exe";
}
else
{
proc.StartInfo.FileName = "x:\\i386\\system32\\cmd.exe";
}
proc.StartInfo.ErrorDialog = false;
proc.StartInfo.WorkingDirectory = Environment.CurrentDirectory;
proc.Start();
this.Close();
}
else
{
challenge = random.Next(9999999);
this.label3.Text = "" + challenge;
}
}
catch
{
MessageBox.Show("exception");
this.Close();
}
}
}
}