Advertisement
Guest User

Untitled

a guest
Apr 20th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.01 KB | None | 0 0
  1. Imports System.IO, System.Management, System, System.Security.Cryptography, System.Text, System.Threading, System.Security.Permissions
  2.  
  3. Public Class LoginForm
  4.  
  5. Dim cpuInfo As String = String.Empty
  6. Dim mc As New ManagementClass("win32_processor")
  7. Dim moc As ManagementObjectCollection = mc.GetInstances()
  8. Dim WC As New Net.WebClient()
  9.  
  10. #Region "Useful Variables"
  11.  
  12. Dim INFO_WEBPAGE As String = "http://bennyclient.x10.mx/info/info.php"
  13.  
  14. Dim MY_USERNAME As String
  15. Dim MY_PASSWORD As String
  16. Dim MY_HWID As String
  17.  
  18. #End Region
  19.  
  20. Public Function ENCRYPT(ByVal input As String, ByVal pass As String) As String
  21. Dim AES As New System.Security.Cryptography.RijndaelManaged
  22. Dim Hash_AES As New System.Security.Cryptography.MD5CryptoServiceProvider
  23. Dim encrypted As String = ""
  24. Dim hash(31) As Byte
  25. Dim temp As Byte() = Hash_AES.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes(pass))
  26. Array.Copy(temp, 0, hash, 0, 16)
  27. Array.Copy(temp, 0, hash, 15, 16)
  28. AES.Key = hash
  29. AES.Mode = Security.Cryptography.CipherMode.ECB
  30. Dim DESEncrypter As System.Security.Cryptography.ICryptoTransform = AES.CreateEncryptor
  31. Dim Buffer As Byte() = System.Text.ASCIIEncoding.ASCII.GetBytes(input)
  32. encrypted = Convert.ToBase64String(DESEncrypter.TransformFinalBlock(Buffer, 0, Buffer.Length))
  33. Return encrypted
  34. End Function
  35.  
  36. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  37.  
  38. Dim cpuInfos As String
  39. For Each mo As ManagementObject In moc
  40. If cpuInfo = "" Then
  41. cpuInfo = mo.Properties("processorID").Value.ToString()
  42. cpuInfos = mo.Properties("processorID").Value.GetHashCode().ToString()
  43. Exit For
  44. End If
  45. Next
  46.  
  47. Dim HWID As String
  48. HWID = cpuInfo
  49.  
  50. Dim Os As OperatingSystem = Environment.OSVersion
  51. Dim Major = Os.Version.Major
  52. Dim Minor = Os.Version.Minor
  53. Dim Build = Os.Version.Build
  54. Dim Revis = Os.Version.Revision
  55. Dim NameLength = Environment.MachineName.Length.ToString()
  56. Dim Count = Environment.ProcessorCount.ToString()
  57. Dim CmdLind = Environment.CommandLine.Length.ToString()
  58. Dim Id = Net.Dns.GetHostEntry(Net.Dns.GetHostName).AddressList(0).ToString()
  59. Dim CustomHWID As String = Major.ToString() + (Build.ToString() * 600) * Revis.ToString() + NameLength + Count * Id.Length * HWID.Length.ToString() * 771 * 91 * 25 * 11
  60. Dim FinalHWID As String = CustomHWID * 777
  61.  
  62. Dim WebString As String = WC.DownloadString(INFO_WEBPAGE)
  63. MY_USERNAME = ENCRYPT(TextBox1.Text, 25).ToString()
  64. MY_PASSWORD = ENCRYPT(TextBox2.Text, 25).ToString()
  65. MY_HWID = ENCRYPT(FinalHWID, 25).ToString()
  66.  
  67. If WebString.Contains(Path.Combine(MY_USERNAME & "%%" & MY_PASSWORD & "%%" & MY_HWID)) Then
  68. Me.Hide()
  69. MainForm.Show()
  70. MessageBox.Show("Welcome " & TextBox1.Text & "!")
  71. Else
  72. MessageBox.Show("Wrong login. The client will now exit.")
  73. Application.Exit()
  74. End If
  75.  
  76. End Sub
  77.  
  78. Private Sub MainForm_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
  79. Application.Exit()
  80. End Sub
  81.  
  82. Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, _
  83. ByVal keyData As System.Windows.Forms.Keys) _
  84. As Boolean
  85.  
  86. If msg.WParam.ToInt32() = CInt(Keys.Enter) Then
  87. Button1.PerformClick()
  88. Return True
  89. End If
  90. Return MyBase.ProcessCmdKey(msg, keyData)
  91. End Function
  92.  
  93. Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
  94.  
  95. End Sub
  96.  
  97. Private Sub LoginForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  98.  
  99. End Sub
  100. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement