Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Things you use go here!
- //Condoms dont
- using System;
- using HWIDGrabber;
- using System.Windows.Forms;
- namespace Ayy_Hook
- //Open brackets
- {
- public partial class Form1 : MetroFramework.Forms.MetroForm
- //Open brackets
- {
- //Save a phrase hwid so it can hold a string or letters and numbers in it
- string hwid;
- //This is the load, its auto generated but visual studio and tbh theres really nothing much i can explain
- public Form1()
- //Open brackets
- {
- InitializeComponent();
- //Close brackets
- }
- //Basically as soon as you enter form1 it runs this code first then the rest
- private void Form1_Load(object sender, EventArgs e)
- //Open brackets
- {
- //Basically make hwid your hwid without the long string (which is found after the equals sign)
- hwid = HWDI.GetMachineGuid();
- if (Properties.Settings.Default.Checked == true) //If the checkbox was set true from last launch:
- //Open brackets
- {
- metroTextBox1.Text = Properties.Settings.Default.Username; //Fill-in last username
- metroTextBox2.Text = Properties.Settings.Default.Password; //Fill-in last username
- metroCheckBox1.Checked = Properties.Settings.Default.Checked; //Check the checkbox
- //Close brackets
- }
- //Close brackets
- }
- private void metroButton1_Click(object sender, EventArgs e) //What happenes after you click the login button
- //Open brackets
- {
- Properties.Settings.Default.Username = metroTextBox1.Text; //Saves your username
- Properties.Settings.Default.Password = metroTextBox2.Text; //Saves your password
- Properties.Settings.Default.Checked = metroCheckBox1.Checked; //Saves the checkbox current state (checked or not)
- Properties.Settings.Default.Save(); //Execute the saving
- //This is where the program goes onto yout site with the check.php file in order to check authentication
- //Note: If your woundering where the links are, they are in settings.cs which is shown below as Settings.Auth
- webBrowser1.Navigate(Settings.Auth + "?username=" + metroTextBox1.Text + " & password=" + metroTextBox2.Text + "&hwid=" + hwid);
- //Close brackets
- }
- //This part is the response you get after you visit the site
- private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
- //Open brackets
- {
- //So if the site responds with p1, it means that your password was correct and it can move on, otherwise it will go to the else statement
- if (webBrowser1.DocumentText.Contains("p1"))
- //Open brackets
- {
- //Next we check for your group! As long as you have one of these groups, your all good to go, otherwise it will go to the else statement
- //Note: I said else statement and not if else, they are 2 completly different things
- //Also the || means and so it will check for all of these groups at once
- if (webBrowser1.DocumentText.Contains("g4") || webBrowser1.DocumentText.Contains("g6") || webBrowser1.DocumentText.Contains("g8"))
- //Open brackets
- {
- //And now we have gotten to the final part (for checks).
- //This tells the program if your hwid is correct or not.
- //h1 means hwid is correct!
- if (webBrowser1.DocumentText.Contains("h1"))
- //Open brackets
- {
- var form2 = new Form2();
- form2.Closed += (s, args) => this.Close();
- form2.Show();
- this.Hide();
- }
- //This tells the program that your hwid is incorrect
- else if (webBrowser1.DocumentText.Contains("h2"))
- //Open brackets
- {
- //So it gives a error message "Error: Incorrect HWID"
- MetroFramework.MetroMessageBox.Show(this, "Error : Incorrect HWID.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, 100);
- //Close brackets
- }
- //This tells the program that your a new user and your hwid has just been set
- else if (webBrowser1.DocumentText.Contains("h3"))
- //Open brackets
- {
- //So it gives a message saying "Note: Setting new HWID"
- MetroFramework.MetroMessageBox.Show(this, "Note: Setting new HWID.", "HWID Reset", MessageBoxButtons.OK, MessageBoxIcon.Error, 100);
- //Close brackets
- }
- //Close brackets
- }
- //Now... Since your group didnt match up, we end up here... at this other... else... statement...
- else
- //Open brackets
- {
- //So it gives a error message saying "Error : Incorrect group"
- MetroFramework.MetroMessageBox.Show(this, "Error : Incorrect group.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, 100);
- //Close brackets
- }
- //Close brackets
- }
- //And if all else fails, we end up here
- else
- //Open brackets
- {
- //And so it FINALLY gives us this error message saying "Error : Incorrect username or password."
- MetroFramework.MetroMessageBox.Show(this, "Error : Incorrect information.", "HWID Reset", MessageBoxButtons.OK, MessageBoxIcon.Error, 100);
- //Close brackets
- }
- //Close brackets
- }
- private void metroTextBox1_KeyDown(object sender, KeyEventArgs e) //When you press a curtain key down, execute code:
- //Open brackets
- {
- if (e.KeyCode == Keys.Enter) //If you pressed enter in the text box:
- //Open brackets
- {
- metroButton1_Click(this, new EventArgs()); //Activate the login button (aka execute login button code)
- //Close brackets
- }
- //Close brackets
- }
- private void metroTextBox2_KeyDown(object sender, KeyEventArgs e) //When you press a curtain key down, execute code:
- //Open brackets
- {
- if (e.KeyCode == Keys.Enter) //If you pressed enter in the text box:
- //Open brackets
- {
- metroButton1_Click(this, new EventArgs()); //Activate the login button (aka execute login button code)
- //Close brackets
- }
- //Close brackets
- }
- private void metroLabel1_Click(object sender, EventArgs e)
- {
- }
- //Close brackets
- }
- //Close brackets
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement