Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Decompiled with JetBrains decompiler
- // Type: trick.io.AuthForm
- // Assembly: trick.io, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null
- // MVID: 48CC9BF8-A584-43E0-9E36-44F1F19A4F50
- // Assembly location: C:\Users\skillize\Desktop\trick.io-cleaned.exe
- using Bunifu.Framework.UI;
- using Newtonsoft.Json;
- using Newtonsoft.Json.Linq;
- using System;
- using System.ComponentModel;
- using System.Drawing;
- using System.IO;
- using System.Net;
- using System.Net.NetworkInformation;
- using System.Net.Security;
- using System.Threading;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace trick.io
- {
- public class AuthForm : Form
- {
- private IContainer components = (IContainer) null;
- private BunifuElipse AuthFormElipse;
- private PictureBox gifPictureBox;
- private Panel settings_AuthenticationPanel;
- private BunifuThinButton2 settings_AuthenticateButton;
- private BunifuMaterialTextbox settings_PasswordCombo;
- private BunifuMaterialTextbox settings_UsernameCombo;
- private Label settings_PasswordLabel;
- private Label settings_UsernameLabel;
- private BunifuElipse settings_AuthenticationPanelElipse;
- public AuthForm()
- {
- this.InitializeComponent();
- }
- public string GetMACAddress()
- {
- NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces();
- string empty = string.Empty;
- foreach (NetworkInterface networkInterface in networkInterfaces)
- {
- if (empty == string.Empty)
- {
- networkInterface.GetIPProperties();
- empty = networkInterface.GetPhysicalAddress().ToString();
- }
- }
- return empty;
- }
- public static void ShowAuth(PictureBox ctrl)
- {
- if (ctrl.InvokeRequired)
- {
- AuthForm.ShowAuthDelegate showAuthDelegate = new AuthForm.ShowAuthDelegate(AuthForm.ShowAuth);
- ctrl.Invoke((Delegate) showAuthDelegate, (object) ctrl);
- }
- else
- {
- ctrl.Enabled = false;
- ctrl.Visible = false;
- }
- }
- public static void Hide(Form ctrl, string acc)
- {
- if (ctrl.InvokeRequired)
- {
- AuthForm.HideDelegate hideDelegate = new AuthForm.HideDelegate(AuthForm.Hide);
- ctrl.Invoke((Delegate) hideDelegate, (object) ctrl, (object) acc);
- }
- else
- {
- ctrl.Hide();
- new MainForm(acc).Show();
- }
- }
- public static void SetUsername(BunifuMaterialTextbox ctrl, string acc)
- {
- if (((Control) ctrl).InvokeRequired)
- {
- AuthForm.SetUsernameDelegate usernameDelegate = new AuthForm.SetUsernameDelegate(AuthForm.SetUsername);
- ((Control) ctrl).Invoke((Delegate) usernameDelegate, (object) ctrl, (object) acc);
- }
- else
- ((Control) ctrl).Text = acc;
- }
- public static void SetPassword(BunifuMaterialTextbox ctrl, string acc)
- {
- if (((Control) ctrl).InvokeRequired)
- {
- AuthForm.SetPasswordDelegate passwordDelegate = new AuthForm.SetPasswordDelegate(AuthForm.SetPassword);
- ((Control) ctrl).Invoke((Delegate) passwordDelegate, (object) ctrl, (object) acc);
- }
- else
- ((Control) ctrl).Text = acc;
- }
- private JObject authenticate(string username, string password, int ms)
- {
- Thread.Sleep(ms);
- ServicePointManager.ServerCertificateValidationCallback += (RemoteCertificateValidationCallback) ((_param1, _param2, _param3, _param4) => true);
- ServicePointManager.Expect100Continue = true;
- ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
- string str = this.GetMACAddress().ToString();
- JObject jobject = new JObject();
- jobject.Add("status", JToken.op_Implicit(""));
- jobject.Add("acc_type", JToken.op_Implicit(""));
- try
- {
- HttpWebRequest httpWebRequest1 = (HttpWebRequest) WebRequest.Create(new Uri("https://trickioshop.xyz/temporary/auth/auth.php?usr=" + username + "&pwd=" + password + "&mc=" + str));
- httpWebRequest1.Method = "GET";
- NetworkCredential networkCredential = new NetworkCredential("trickiov3", "l6kn7YbKG1Tu");
- httpWebRequest1.Credentials = (ICredentials) networkCredential;
- jobject = JObject.Parse(new StreamReader(httpWebRequest1.GetResponse().GetResponseStream()).ReadToEnd());
- if (!(((object) jobject.Property("status").get_Value()).ToString() == "mac") || !(((object) jobject.Property("mac").get_Value()).ToString() == ""))
- return jobject;
- ServicePointManager.ServerCertificateValidationCallback += (RemoteCertificateValidationCallback) ((_param1, _param2, _param3, _param4) => true);
- ServicePointManager.Expect100Continue = true;
- ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
- HttpWebRequest httpWebRequest2 = (HttpWebRequest) WebRequest.Create(new Uri("https://trickioshop.xyz/temporary/auth/update.php?usr=" + username + "&pwd=" + password + "&mc=" + str));
- httpWebRequest1.Method = "GET";
- httpWebRequest2.Credentials = (ICredentials) networkCredential;
- new StreamReader(httpWebRequest2.GetResponse().GetResponseStream()).ReadToEnd();
- jobject.Property("status").set_Value(JToken.op_Implicit("newmac"));
- return jobject;
- }
- catch (Exception ex)
- {
- System.IO.File.WriteAllText("errors.txt", ex.Message.ToString());
- jobject.Property("status").set_Value(JToken.op_Implicit("except"));
- return jobject;
- }
- }
- private async void AuthForm_Load(object sender, EventArgs e)
- {
- this.gifPictureBox.BringToFront();
- string authText = System.IO.File.ReadAllText("auth.json");
- JObject authJson = JObject.Parse(authText);
- string username = ((object) authJson.Property("username").get_Value()).ToString();
- string password = ((object) authJson.Property("password").get_Value()).ToString();
- Task<JObject> auth = new Task<JObject>((Func<JObject>) (() => this.authenticate(username, password, 2500)));
- auth.Start();
- JObject jobject = await auth;
- JObject auth_res = jobject;
- jobject = (JObject) null;
- string str = ((object) auth_res.Property("status").get_Value()).ToString();
- if (!(str == "success"))
- {
- if (!(str == "user/pw"))
- {
- if (!(str == "mac"))
- {
- if (!(str == "newmac"))
- {
- if (!(str == "except"))
- {
- AuthForm.ShowAuth(this.gifPictureBox);
- AuthForm.SetUsername(this.settings_UsernameCombo, username);
- AuthForm.SetPassword(this.settings_PasswordCombo, password);
- int num = (int) MessageBox.Show("Authentication problem! Please contact discord for help!", "Authentication");
- }
- else
- {
- AuthForm.ShowAuth(this.gifPictureBox);
- AuthForm.SetUsername(this.settings_UsernameCombo, username);
- AuthForm.SetPassword(this.settings_PasswordCombo, password);
- int num = (int) MessageBox.Show("Authentication problem! Please contact discord for help!", "Authentication");
- }
- }
- else
- {
- int num = (int) MessageBox.Show("Registered new device!", "Authentication");
- AuthForm.ShowAuth(this.gifPictureBox);
- AuthForm.SetUsername(this.settings_UsernameCombo, username);
- AuthForm.SetPassword(this.settings_PasswordCombo, password);
- AuthForm.Hide((Form) this, ((object) auth_res.Property("acc_type").get_Value()).ToString());
- }
- }
- else
- {
- AuthForm.ShowAuth(this.gifPictureBox);
- AuthForm.SetUsername(this.settings_UsernameCombo, username);
- AuthForm.SetPassword(this.settings_PasswordCombo, password);
- int num = (int) MessageBox.Show("Multiple devices not allowed! Use discord bot to reset!", "Authentication");
- }
- }
- else
- {
- AuthForm.ShowAuth(this.gifPictureBox);
- AuthForm.SetUsername(this.settings_UsernameCombo, username);
- AuthForm.SetPassword(this.settings_PasswordCombo, password);
- int num = (int) MessageBox.Show("Wrong username/password!", "Authentication");
- }
- }
- else
- {
- AuthForm.ShowAuth(this.gifPictureBox);
- AuthForm.SetUsername(this.settings_UsernameCombo, username);
- AuthForm.SetPassword(this.settings_PasswordCombo, password);
- AuthForm.Hide((Form) this, ((object) auth_res.Property("acc_type").get_Value()).ToString());
- }
- }
- private void pictureBox1_Click(object sender, EventArgs e)
- {
- }
- private void settings_AuthenticateButton_Click(object sender, EventArgs e)
- {
- JObject jobject1 = this.authenticate(((Control) this.settings_UsernameCombo).Text, ((Control) this.settings_PasswordCombo).Text, 0);
- string str = ((object) jobject1.Property("status").get_Value()).ToString();
- if (!(str == "success"))
- {
- if (!(str == "user/pw"))
- {
- if (!(str == "mac"))
- {
- if (!(str == "newmac"))
- {
- if (!(str == "except"))
- {
- int num1 = (int) MessageBox.Show("Authentication problem! Please contact discord for help!", "Authentication");
- }
- else
- {
- int num2 = (int) MessageBox.Show("Authentication problem! Please contact discord for help!", "Authentication");
- }
- }
- else
- {
- JObject jobject2 = new JObject();
- jobject2.Add("username", JToken.op_Implicit(((Control) this.settings_UsernameCombo).Text));
- jobject2.Add("password", JToken.op_Implicit(((Control) this.settings_PasswordCombo).Text));
- System.IO.File.WriteAllText("auth.json", JsonConvert.SerializeObject((object) jobject2, (Formatting) 1));
- int num3 = (int) MessageBox.Show("Registered new device!", "Authentication");
- this.Hide();
- new MainForm(((object) jobject1.Property("acc_type").get_Value()).ToString()).Show();
- }
- }
- else
- {
- int num4 = (int) MessageBox.Show("Multiple devices not allowed! Use discord bot to reset!", "Authentication");
- }
- }
- else
- {
- int num5 = (int) MessageBox.Show("Wrong username/password!", "Authentication");
- }
- }
- else
- {
- JObject jobject2 = new JObject();
- jobject2.Add("username", JToken.op_Implicit(((Control) this.settings_UsernameCombo).Text));
- jobject2.Add("password", JToken.op_Implicit(((Control) this.settings_PasswordCombo).Text));
- System.IO.File.WriteAllText("auth.json", JsonConvert.SerializeObject((object) jobject2, (Formatting) 1));
- this.Hide();
- new MainForm(((object) jobject1.Property("acc_type").get_Value()).ToString()).Show();
- }
- }
- protected override void Dispose(bool disposing)
- {
- if ((!disposing ? 0 : (this.components != null ? 1 : 0)) != 0)
- this.components.Dispose();
- base.Dispose(disposing);
- }
- private void InitializeComponent()
- {
- this.components = (IContainer) new Container();
- ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (AuthForm));
- this.AuthFormElipse = new BunifuElipse(this.components);
- this.gifPictureBox = new PictureBox();
- this.settings_AuthenticationPanel = new Panel();
- this.settings_AuthenticateButton = new BunifuThinButton2();
- this.settings_PasswordCombo = new BunifuMaterialTextbox();
- this.settings_UsernameCombo = new BunifuMaterialTextbox();
- this.settings_PasswordLabel = new Label();
- this.settings_UsernameLabel = new Label();
- this.settings_AuthenticationPanelElipse = new BunifuElipse(this.components);
- ((ISupportInitialize) this.gifPictureBox).BeginInit();
- this.settings_AuthenticationPanel.SuspendLayout();
- this.SuspendLayout();
- this.AuthFormElipse.set_ElipseRadius(10);
- this.AuthFormElipse.set_TargetControl((Control) this);
- this.gifPictureBox.Image = (Image) componentResourceManager.GetObject("gifPictureBox.Image");
- this.gifPictureBox.Location = new Point(0, 0);
- this.gifPictureBox.Name = "gifPictureBox";
- this.gifPictureBox.Size = new Size(321, 240);
- this.gifPictureBox.TabIndex = 0;
- this.gifPictureBox.TabStop = false;
- this.gifPictureBox.Click += new EventHandler(this.pictureBox1_Click);
- this.settings_AuthenticationPanel.BackColor = Color.FromArgb(37, 35, 43);
- this.settings_AuthenticationPanel.Controls.Add((Control) this.settings_AuthenticateButton);
- this.settings_AuthenticationPanel.Controls.Add((Control) this.settings_PasswordCombo);
- this.settings_AuthenticationPanel.Controls.Add((Control) this.settings_UsernameCombo);
- this.settings_AuthenticationPanel.Controls.Add((Control) this.settings_PasswordLabel);
- this.settings_AuthenticationPanel.Controls.Add((Control) this.settings_UsernameLabel);
- this.settings_AuthenticationPanel.Location = new Point(10, 26);
- this.settings_AuthenticationPanel.Name = "settings_AuthenticationPanel";
- this.settings_AuthenticationPanel.Size = new Size(298, 186);
- this.settings_AuthenticationPanel.TabIndex = 18;
- this.settings_AuthenticateButton.set_ActiveBorderThickness(1);
- this.settings_AuthenticateButton.set_ActiveCornerRadius(20);
- this.settings_AuthenticateButton.set_ActiveFillColor(Color.LightSeaGreen);
- this.settings_AuthenticateButton.set_ActiveForecolor(Color.White);
- this.settings_AuthenticateButton.set_ActiveLineColor(Color.LightSeaGreen);
- ((Control) this.settings_AuthenticateButton).BackColor = Color.FromArgb(37, 35, 43);
- ((Control) this.settings_AuthenticateButton).BackgroundImage = (Image) componentResourceManager.GetObject("settings_AuthenticateButton.BackgroundImage");
- this.settings_AuthenticateButton.set_ButtonText("AUTHENTICATE");
- ((Control) this.settings_AuthenticateButton).Cursor = Cursors.Hand;
- ((Control) this.settings_AuthenticateButton).Font = new Font("Nirmala UI", 9.75f, FontStyle.Bold);
- ((Control) this.settings_AuthenticateButton).ForeColor = Color.LightSeaGreen;
- this.settings_AuthenticateButton.set_IdleBorderThickness(1);
- this.settings_AuthenticateButton.set_IdleCornerRadius(20);
- this.settings_AuthenticateButton.set_IdleFillColor(Color.Transparent);
- this.settings_AuthenticateButton.set_IdleForecolor(Color.Transparent);
- this.settings_AuthenticateButton.set_IdleLineColor(Color.LightSeaGreen);
- ((Control) this.settings_AuthenticateButton).Location = new Point(101, 124);
- ((Control) this.settings_AuthenticateButton).Margin = new Padding(4, 4, 4, 4);
- ((Control) this.settings_AuthenticateButton).Name = "settings_AuthenticateButton";
- ((Control) this.settings_AuthenticateButton).Size = new Size(166, 39);
- ((Control) this.settings_AuthenticateButton).TabIndex = 20;
- this.settings_AuthenticateButton.set_TextAlign(ContentAlignment.MiddleCenter);
- this.settings_AuthenticateButton.add_Click(new EventHandler(this.settings_AuthenticateButton_Click));
- ((Control) this.settings_PasswordCombo).Cursor = Cursors.IBeam;
- ((Control) this.settings_PasswordCombo).Font = new Font("Microsoft YaHei UI", 9.75f, FontStyle.Bold);
- ((Control) this.settings_PasswordCombo).ForeColor = Color.White;
- this.settings_PasswordCombo.set_HintForeColor(Color.Gray);
- this.settings_PasswordCombo.set_HintText("");
- this.settings_PasswordCombo.set_isPassword(false);
- this.settings_PasswordCombo.set_LineFocusedColor(Color.LightSeaGreen);
- this.settings_PasswordCombo.set_LineIdleColor(Color.Gray);
- this.settings_PasswordCombo.set_LineMouseHoverColor(Color.LightSeaGreen);
- this.settings_PasswordCombo.set_LineThickness(4);
- ((Control) this.settings_PasswordCombo).Location = new Point(101, 70);
- ((Control) this.settings_PasswordCombo).Margin = new Padding(4);
- ((Control) this.settings_PasswordCombo).Name = "settings_PasswordCombo";
- ((Control) this.settings_PasswordCombo).Size = new Size(164, 33);
- ((Control) this.settings_PasswordCombo).TabIndex = 18;
- this.settings_PasswordCombo.set_TextAlign(HorizontalAlignment.Left);
- ((Control) this.settings_UsernameCombo).Cursor = Cursors.IBeam;
- ((Control) this.settings_UsernameCombo).Font = new Font("Microsoft YaHei UI", 9.75f, FontStyle.Bold);
- ((Control) this.settings_UsernameCombo).ForeColor = Color.White;
- this.settings_UsernameCombo.set_HintForeColor(Color.Gray);
- this.settings_UsernameCombo.set_HintText("");
- this.settings_UsernameCombo.set_isPassword(false);
- this.settings_UsernameCombo.set_LineFocusedColor(Color.LightSeaGreen);
- this.settings_UsernameCombo.set_LineIdleColor(Color.Gray);
- this.settings_UsernameCombo.set_LineMouseHoverColor(Color.LightSeaGreen);
- this.settings_UsernameCombo.set_LineThickness(4);
- ((Control) this.settings_UsernameCombo).Location = new Point(101, 28);
- ((Control) this.settings_UsernameCombo).Margin = new Padding(4);
- ((Control) this.settings_UsernameCombo).Name = "settings_UsernameCombo";
- ((Control) this.settings_UsernameCombo).Size = new Size(164, 33);
- ((Control) this.settings_UsernameCombo).TabIndex = 17;
- this.settings_UsernameCombo.set_TextAlign(HorizontalAlignment.Left);
- this.settings_PasswordLabel.AutoSize = true;
- this.settings_PasswordLabel.ForeColor = Color.White;
- this.settings_PasswordLabel.Location = new Point(23, 77);
- this.settings_PasswordLabel.Name = "settings_PasswordLabel";
- this.settings_PasswordLabel.Size = new Size(70, 17);
- this.settings_PasswordLabel.TabIndex = 16;
- this.settings_PasswordLabel.Text = "password:";
- this.settings_UsernameLabel.AutoSize = true;
- this.settings_UsernameLabel.ForeColor = Color.White;
- this.settings_UsernameLabel.Location = new Point(21, 36);
- this.settings_UsernameLabel.Name = "settings_UsernameLabel";
- this.settings_UsernameLabel.Size = new Size(72, 17);
- this.settings_UsernameLabel.TabIndex = 15;
- this.settings_UsernameLabel.Text = "username:";
- this.settings_AuthenticationPanelElipse.set_ElipseRadius(15);
- this.settings_AuthenticationPanelElipse.set_TargetControl((Control) this.settings_AuthenticationPanel);
- this.AutoScaleMode = AutoScaleMode.None;
- this.BackColor = Color.FromArgb(30, 28, 34);
- this.ClientSize = new Size(320, 240);
- this.Controls.Add((Control) this.settings_AuthenticationPanel);
- this.Controls.Add((Control) this.gifPictureBox);
- this.Font = new Font("Nirmala UI", 9.75f, FontStyle.Bold);
- this.ForeColor = Color.White;
- this.FormBorderStyle = FormBorderStyle.None;
- this.Icon = (Icon) componentResourceManager.GetObject("$this.Icon");
- this.Name = nameof (AuthForm);
- this.StartPosition = FormStartPosition.CenterScreen;
- this.Text = nameof (AuthForm);
- this.Load += new EventHandler(this.AuthForm_Load);
- ((ISupportInitialize) this.gifPictureBox).EndInit();
- this.settings_AuthenticationPanel.ResumeLayout(false);
- this.settings_AuthenticationPanel.PerformLayout();
- this.ResumeLayout(false);
- }
- private delegate void ShowAuthDelegate(PictureBox ctrl);
- private delegate void HideDelegate(Form ctrl, string acc);
- private delegate void SetUsernameDelegate(BunifuMaterialTextbox ctrl, string acc);
- private delegate void SetPasswordDelegate(BunifuMaterialTextbox ctrl, string acc);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement