Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.08 KB | None | 0 0
  1. //Things you use go here!
  2. //Condoms dont
  3. using System;
  4. using HWIDGrabber;
  5. using System.Windows.Forms;
  6.  
  7.  
  8. namespace Ayy_Hook
  9. //Open brackets
  10. {
  11. public partial class Form1 : MetroFramework.Forms.MetroForm
  12. //Open brackets
  13. {
  14. //Save a phrase hwid so it can hold a string or letters and numbers in it
  15. string hwid;
  16.  
  17. //This is the load, its auto generated but visual studio and tbh theres really nothing much i can explain
  18. public Form1()
  19. //Open brackets
  20. {
  21. InitializeComponent();
  22. //Close brackets
  23. }
  24.  
  25. //Basically as soon as you enter form1 it runs this code first then the rest
  26. private void Form1_Load(object sender, EventArgs e)
  27. //Open brackets
  28. {
  29. //Basically make hwid your hwid without the long string (which is found after the equals sign)
  30. hwid = HWDI.GetMachineGuid();
  31.  
  32.  
  33. if (Properties.Settings.Default.Checked == true) //If the checkbox was set true from last launch:
  34. //Open brackets
  35. {
  36. metroTextBox1.Text = Properties.Settings.Default.Username; //Fill-in last username
  37. metroTextBox2.Text = Properties.Settings.Default.Password; //Fill-in last username
  38. metroCheckBox1.Checked = Properties.Settings.Default.Checked; //Check the checkbox
  39. //Close brackets
  40. }
  41. //Close brackets
  42. }
  43. private void metroButton1_Click(object sender, EventArgs e) //What happenes after you click the login button
  44. //Open brackets
  45. {
  46. Properties.Settings.Default.Username = metroTextBox1.Text; //Saves your username
  47. Properties.Settings.Default.Password = metroTextBox2.Text; //Saves your password
  48. Properties.Settings.Default.Checked = metroCheckBox1.Checked; //Saves the checkbox current state (checked or not)
  49. Properties.Settings.Default.Save(); //Execute the saving
  50.  
  51. //This is where the program goes onto yout site with the check.php file in order to check authentication
  52. //Note: If your woundering where the links are, they are in settings.cs which is shown below as Settings.Auth
  53. webBrowser1.Navigate(Settings.Auth + "?username=" + metroTextBox1.Text + " & password=" + metroTextBox2.Text + "&hwid=" + hwid);
  54. //Close brackets
  55. }
  56.  
  57. //This part is the response you get after you visit the site
  58. private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
  59. //Open brackets
  60. {
  61. //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
  62. if (webBrowser1.DocumentText.Contains("p1"))
  63. //Open brackets
  64. {
  65. //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
  66. //Note: I said else statement and not if else, they are 2 completly different things
  67. //Also the || means and so it will check for all of these groups at once
  68. if (webBrowser1.DocumentText.Contains("g4") || webBrowser1.DocumentText.Contains("g6") || webBrowser1.DocumentText.Contains("g8"))
  69. //Open brackets
  70. {
  71. //And now we have gotten to the final part (for checks).
  72. //This tells the program if your hwid is correct or not.
  73. //h1 means hwid is correct!
  74. if (webBrowser1.DocumentText.Contains("h1"))
  75. //Open brackets
  76. {
  77. var form2 = new Form2();
  78. form2.Closed += (s, args) => this.Close();
  79. form2.Show();
  80. this.Hide();
  81. }
  82. //This tells the program that your hwid is incorrect
  83. else if (webBrowser1.DocumentText.Contains("h2"))
  84. //Open brackets
  85. {
  86. //So it gives a error message "Error: Incorrect HWID"
  87. MetroFramework.MetroMessageBox.Show(this, "Error : Incorrect HWID.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, 100);
  88. //Close brackets
  89. }
  90. //This tells the program that your a new user and your hwid has just been set
  91. else if (webBrowser1.DocumentText.Contains("h3"))
  92. //Open brackets
  93. {
  94. //So it gives a message saying "Note: Setting new HWID"
  95. MetroFramework.MetroMessageBox.Show(this, "Note: Setting new HWID.", "HWID Reset", MessageBoxButtons.OK, MessageBoxIcon.Error, 100);
  96. //Close brackets
  97. }
  98. //Close brackets
  99. }
  100. //Now... Since your group didnt match up, we end up here... at this other... else... statement...
  101. else
  102. //Open brackets
  103. {
  104. //So it gives a error message saying "Error : Incorrect group"
  105. MetroFramework.MetroMessageBox.Show(this, "Error : Incorrect group.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, 100);
  106. //Close brackets
  107. }
  108. //Close brackets
  109. }
  110. //And if all else fails, we end up here
  111. else
  112. //Open brackets
  113. {
  114. //And so it FINALLY gives us this error message saying "Error : Incorrect username or password."
  115. MetroFramework.MetroMessageBox.Show(this, "Error : Incorrect information.", "HWID Reset", MessageBoxButtons.OK, MessageBoxIcon.Error, 100);
  116. //Close brackets
  117. }
  118. //Close brackets
  119. }
  120.  
  121. private void metroTextBox1_KeyDown(object sender, KeyEventArgs e) //When you press a curtain key down, execute code:
  122. //Open brackets
  123. {
  124. if (e.KeyCode == Keys.Enter) //If you pressed enter in the text box:
  125. //Open brackets
  126. {
  127. metroButton1_Click(this, new EventArgs()); //Activate the login button (aka execute login button code)
  128. //Close brackets
  129. }
  130. //Close brackets
  131. }
  132.  
  133. private void metroTextBox2_KeyDown(object sender, KeyEventArgs e) //When you press a curtain key down, execute code:
  134. //Open brackets
  135. {
  136. if (e.KeyCode == Keys.Enter) //If you pressed enter in the text box:
  137. //Open brackets
  138. {
  139. metroButton1_Click(this, new EventArgs()); //Activate the login button (aka execute login button code)
  140. //Close brackets
  141. }
  142. //Close brackets
  143. }
  144.  
  145. private void metroLabel1_Click(object sender, EventArgs e)
  146. {
  147.  
  148. }
  149. //Close brackets
  150. }
  151. //Close brackets
  152. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement