rdsedmundo

Loader 1.0

Jun 8th, 2012
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.42 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Web;
  10. using System.Net;
  11. using System.IO;
  12. using System.Net.NetworkInformation;
  13. using System.Management;
  14.  
  15. namespace WindowsFormsApplication1
  16. {
  17.     public partial class Form1 : Form
  18.     {
  19.         public Form1()
  20.         {
  21.             InitializeComponent();
  22.         }
  23.         private String Do_REQ(String url) {
  24.             String resp = null;
  25.             HttpWebRequest WebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
  26.             WebRequest.Method = "GET";
  27.             HttpWebResponse myWebResponse = (HttpWebResponse)WebRequest.GetResponse();
  28.             StreamReader Source = new StreamReader(myWebResponse.GetResponseStream());
  29.             resp = Source.ReadToEnd();
  30.             myWebResponse.Close();
  31.             return resp;
  32.         }
  33.         public static string GetPCID()
  34.         {
  35.             try
  36.             {
  37.                 string cpuInfo = String.Empty;
  38.                 string temp = String.Empty;
  39.                 ManagementClass mc = new ManagementClass("Win32_Processor");
  40.                 ManagementObjectCollection moc = mc.GetInstances();
  41.                 foreach (ManagementObject mo in moc)
  42.                 {
  43.                     if (cpuInfo == String.Empty)
  44.                     {
  45.                         cpuInfo = mo.Properties["ProcessorId"].Value.ToString();
  46.                     }
  47.                 }
  48.                 return cpuInfo;
  49.             }
  50.             catch
  51.             {
  52.                 return "0";
  53.             }
  54.         }
  55.         public static void LOG(String log_data, String log_msg)
  56.         {
  57.             String path = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
  58.             path += "/log.txt";
  59.             if (!File.Exists(path)) { System.IO.File.Create(path).Close(); };
  60.             System.IO.TextWriter log = System.IO.File.CreateText(path);
  61.             log.WriteLine("[" + log_data + "] "+log_msg);
  62.             log.Close();
  63.         }
  64.         public static string GetPCNAME()
  65.         {
  66.             try
  67.             {
  68.                 return Environment.MachineName.ToString();
  69.             }
  70.             catch (Exception ex)
  71.             {
  72.                 throw ex;
  73.             }
  74.         }
  75.         private void button1_Click(object sender, EventArgs e)
  76.         {
  77.             this.Cursor = Cursors.AppStarting;
  78.             String c = GetPCNAME();
  79.             String d = GetPCID();
  80.             String nick = textBox1.Text;
  81.             String data = Do_REQ("http://kyl3.comuv.com/loader.php?c=" + c + "&d=" + d);
  82.             String resp = Do_REQ("http://kyl3.comuv.com/loader.php?data="+data+"&u="+nick);
  83.             if (resp == "CAN_JOIN")
  84.             {
  85.                 LOG(data, "Você já pode agora usufuir de nosso Hacker VIP.");
  86.                 MessageBox.Show("Seja bem-vindo", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
  87.                 this.Cursor = Cursors.Default;
  88.             }
  89.             else
  90.             {
  91.                 LOG(data, "Você não está autorizado ao uso deste programa.");
  92.                 MessageBox.Show("Você não está autorizado ao uso desse programa.\n\n#TOKEN_DATA: "+data, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
  93.                 Application.Exit();
  94.             }
  95.         }
  96.     }
  97. }
Advertisement
Add Comment
Please, Sign In to add comment