-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
63 lines (51 loc) · 1.87 KB
/
Program.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Threading;
using System.Security.Permissions;
namespace YourTable
{
public static class Program
{
private static Options options = new Options();
/// <summary>
/// The main entry point for the application.
/// </summary>
[SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.ControlAppDomain)]
[STAThread]
static void Main()
{
//CREDIT: Microsoft .NET Document
Application.ThreadException += new ThreadExceptionEventHandler(UIThreadException);
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
AppDomain.CurrentDomain.UnhandledException +=
new UnhandledExceptionEventHandler(UnhandledException);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//if (checkOpened())
//{
// Application.Run(new src.Op());
//}
//else
//{
// Application.Run(new src.Test());
//}
Options.InsertToLog("Program has opened", "Program");
Application.Run(new Op()); //Used as a placeholder
}
private static void UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
}
private static void UIThreadException(object sender, ThreadExceptionEventArgs t)
{
if (options.checkHackerMode())
{
MessageBox.Show(t.Exception.Message + "\n" + t.Exception.StackTrace, "Error", MessageBoxButtons.OK);
}
Options.InsertToLog(t.Exception.Message, t.Exception.StackTrace);
}
}
}