Advertisement
eXsses

PaySafeCard-Checker [ Form1.cs ]

Apr 13th, 2014
789
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 17.62 KB | None | 0 0
  1. using System;
  2. using System.Text.RegularExpressions;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using System.IO;
  11. using System.Diagnostics;
  12. using System.Web;
  13. using System.Threading;
  14. using System.Net;
  15. using System.Management;
  16.  
  17. namespace PSC_Checker
  18. {
  19.     public partial class Form1 : Form
  20.     {
  21.         int PSCnummer;
  22.         int PSCmax;
  23.         Thread[] checkerThread;
  24.         public Form1()
  25.         {
  26.             InitializeComponent();
  27.             PSCnummer = 0;
  28.             PSCmax = 0;
  29.             label1.Text = "Status:";
  30.             checkerThread = new Thread[Convert.ToInt32(1)];
  31.             for (int i = 0; i <= Convert.ToInt32(1) - 1; i++)
  32.             {
  33.                 int input = i;
  34.                 checkerThread[i] = new Thread(new ParameterizedThreadStart(Captchadladen));
  35.                 checkerThread[i].Start(input);
  36.             }
  37.         }
  38.         CookieContainer cookieContainer = new CookieContainer();
  39.  
  40.         private delegate void updateApplicationDel(string Status);
  41.         private delegate string Get();
  42.         private delegate void PSCwerthinzufügenHandler(int Index, string statsu);
  43.  
  44.  
  45.         public void Captchadladen(object jjj)
  46.         {
  47.             try
  48.             {
  49.  
  50.                 HttpWebRequest myRequest = (HttpWebRequest)HttpWebRequest.Create("https://www.paysafecard.com/fileadmin/source/widgets/balancecheck/index.php");
  51.                 myRequest.CookieContainer = cookieContainer;
  52.                 myRequest.Method = "GET";
  53.                 myRequest.UserAgent = "UMozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/19.0 Firefox/19.0";
  54.                 myRequest.ContentType = "application/x-www-form-urlencoded";
  55.                 HttpWebResponse myRes = (HttpWebResponse)myRequest.GetResponse();
  56.                 StreamReader srs = new StreamReader(myRes.GetResponseStream());
  57.                 string html = srs.ReadToEnd();
  58.                 html = System.Text.RegularExpressions.Regex.Replace(html, @"""", string.Empty);
  59.                 Regex CaptchaURL = new Regex("(?<=id=siimage style=border: 1px solid #ccc; src=).*(?=[a-z]{0,10}[0-9]{0,10}[A-Z]{0,10}[0-9]{0,10}alt=CAPTCHA Image>)");
  60.  
  61.  
  62.                 myRequest = (HttpWebRequest)HttpWebRequest.Create("https://www.paysafecard.com/" + CaptchaURL.Match(html).ToString());
  63.                 myRequest.CookieContainer = cookieContainer;
  64.                 myRequest.AllowAutoRedirect = true;
  65.                 myRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20.0 Firefox/20.0";
  66.                 myRequest.KeepAlive = true;
  67.                 Stream stream = myRequest.GetResponse().GetResponseStream();
  68.                 Image img = Image.FromStream(stream);
  69.                 pictureBox1.Image = img;
  70.             }
  71.             catch
  72.             {
  73.             }
  74.             if (textBox1.InvokeRequired)
  75.                 textBox1.Invoke(new updateApplicationDel(Captshafedlnull), "");
  76.             else
  77.                 textBox1.Text = "";
  78.             if (label1.InvokeRequired)
  79.                 label1.Invoke(new updateApplicationDel(label1ändern), "Status: Captscha geladen");
  80.             else
  81.             label1.Text = "Status: Captscha geladen";
  82.         }
  83.  
  84.         public void label1ändern(string status)
  85.         {
  86.             label1.Text = status;
  87.         }
  88.  
  89.         public void Captshafedlnull(string status)
  90.         {
  91.             textBox1.Text = status;
  92.         }
  93.  
  94.         public string GetCaptcha()
  95.         {
  96.             return textBox1.Text;
  97.         }
  98.  
  99.         public void PSCpürfen(object PSCro)
  100.         {
  101.             string ll = "";
  102.             try
  103.             {
  104.                 string PSC1 = PSCro.ToString();
  105.                 string Captcha = "";
  106.  
  107.                 if (textBox1.InvokeRequired)
  108.                     Captcha = textBox1.Invoke(new Get(GetCaptcha)).ToString();
  109.                 else
  110.                     Captcha = GetCaptcha();
  111.  
  112.  
  113.                 string PSCData = "cardnumber0=" + PSC1.Split(' ')[0].ToString() + "&cardnumber1=" + PSC1.Split(' ')[1].ToString() + "&cardnumber2=" + PSC1.Split(' ')[2].ToString() + "&cardnumber3=" + PSC1.Split(' ')[3].ToString() + "&captcha=" + Captcha + "&action=2&lc=de-de";
  114.                 ASCIIEncoding encoding = new ASCIIEncoding();
  115.                 byte[] data = Encoding.UTF8.GetBytes(PSCData);
  116.  
  117.                 HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("https://www.paysafecard.com/fileadmin/source/widgets/balancecheck/index.php");
  118.                 myRequest.Method = "POST";
  119.                 myRequest.CookieContainer = cookieContainer;
  120.                 myRequest.AllowAutoRedirect = true;
  121.                 myRequest.Timeout = 8000;
  122.                 myRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:22.0) Gecko/20130223 Firefox/22.0";
  123.                 myRequest.Referer = "https://www.paysafecard.com/de-de/guthaben-abfragen/";
  124.                 myRequest.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
  125.                 myRequest.KeepAlive = true;
  126.                 myRequest.ContentLength = data.Length;
  127.                 Stream newStream = myRequest.GetRequestStream();
  128.                 newStream.Write(data, 0, data.Length);
  129.                 newStream.Close();
  130.  
  131.                 HttpWebResponse myRes = (HttpWebResponse)myRequest.GetResponse();
  132.  
  133.                 StreamReader srs = new StreamReader(myRes.GetResponseStream());
  134.  
  135.                 string html = srs.ReadToEnd();
  136.                 if (html.Contains("Guthaben deiner paysafecard:"))
  137.                 {
  138.                     Regex Url = new Regex("(?<=<h2>Guthaben deiner paysafecard: EUR ).*(?=[0-9]{0,8}</h2>)");
  139.                     ll = Url.Match(html).ToString();
  140.                     if (listView1.InvokeRequired)
  141.                         listView1.Invoke(new PSCwerthinzufügenHandler(PSCwerthinzufügen), PSCnummer, Url.Match(html).ToString());
  142.                     else
  143.                         PSCwerthinzufügen(PSCnummer, Url.Match(html).ToString());
  144.  
  145.                     PSCnummer++;
  146.  
  147.                    
  148.                     checkerThread = new Thread[Convert.ToInt32(1)];
  149.                     for (int i = 0; i <= Convert.ToInt32(1) - 1; i++)
  150.                     {
  151.                         int input = i;
  152.                         checkerThread[i] = new Thread(new ParameterizedThreadStart(Captchadladen));
  153.                         checkerThread[i].Start(input);
  154.  
  155.                     }
  156.                 }
  157.                 else if (html.Contains("Das gesamte Guthaben&nbsp;steht dir noch zur Verf&uuml;gung."))
  158.                 {
  159.                     if (listView1.InvokeRequired)
  160.                         listView1.Invoke(new PSCwerthinzufügenHandler(PSCwerthinzufügen), PSCnummer, "Voll");
  161.                     else
  162.                         PSCwerthinzufügen(PSCnummer, "Voll");
  163.  
  164.                     PSCnummer++;
  165.  
  166.                     checkerThread = new Thread[Convert.ToInt32(1)];
  167.                     for (int i = 0; i <= Convert.ToInt32(1) - 1; i++)
  168.                     {
  169.                         int input = i;
  170.                         checkerThread[i] = new Thread(new ParameterizedThreadStart(Captchadladen));
  171.                         checkerThread[i].Start(input);
  172.  
  173.                     }
  174.                 }
  175.                 else
  176.                 {
  177.                     if (html.Contains("Die eingegebene Zahlenkombination stimmt nicht mit dem Captcha überein. Versuche es nocheinmal."))
  178.                     {
  179.                         MessageBox.Show("Die eingegebene Zahlenkombination stimmt nicht mit dem Captcha überein. Versuche es nocheinmal.");
  180.                         checkerThread = new Thread[Convert.ToInt32(1)];
  181.                         for (int i = 0; i <= Convert.ToInt32(1) - 1; i++)
  182.                         {
  183.                             int input = i;
  184.                             checkerThread[i] = new Thread(new ParameterizedThreadStart(Captchadladen));
  185.                             checkerThread[i].Start(input);
  186.  
  187.                         }
  188.                         if (PSCnummer >= 2)
  189.                         {
  190.                             PSCnummer--;
  191.                         }
  192.                         else
  193.                         {
  194.                             PSCnummer = 0;
  195.                         }
  196.  
  197.                     }
  198.                     else
  199.                     {
  200.                         if (listView1.InvokeRequired)
  201.                             listView1.Invoke(new PSCwerthinzufügenHandler(PSCwerthinzufügen), PSCnummer, "Ungültig");
  202.                         else
  203.                             PSCwerthinzufügen(PSCnummer, "Ungültig");
  204.                         PSCnummer++;
  205.                         checkerThread = new Thread[Convert.ToInt32(1)];
  206.                         for (int i = 0; i <= Convert.ToInt32(1) - 1; i++)
  207.                         {
  208.                             int input = i;
  209.                             checkerThread[i] = new Thread(new ParameterizedThreadStart(Captchadladen));
  210.                             checkerThread[i].Start(input);
  211.  
  212.                         }
  213.                     }
  214.  
  215.                     if (label1.InvokeRequired)
  216.                         label1.Invoke(new updateApplicationDel(label1ändern), "Status: PSC gecheckt");
  217.                     else
  218.                         label1.Text = "Status: PSC gecheckt";
  219.                 }
  220.             }
  221.             catch(Exception ex)
  222.             {
  223.                 MessageBox.Show(ex.ToString());
  224.             }
  225.            
  226.         }
  227.  
  228.  
  229.         private void button2_Click(object sender, EventArgs e)
  230.         {
  231.             try
  232.             {
  233.                 if (PSCnummer < PSCmax)
  234.                 {
  235.                     checkerThread = new Thread[Convert.ToInt32(1)];
  236.                     for (int i = 0; i <= Convert.ToInt32(1) - 1; i++)
  237.                     {
  238.                         string PSC = listView1.Items[PSCnummer].SubItems[0].Text.ToString();
  239.                         checkerThread[i] = new Thread(new ParameterizedThreadStart(PSCpürfen));
  240.                         checkerThread[i].Start(PSC);
  241.                     }
  242.                 }
  243.                 else
  244.                 {
  245.                     MessageBox.Show("Alle PSC Codes gecheckt");
  246.  
  247.                     if (label1.InvokeRequired)
  248.                         label1.Invoke(new updateApplicationDel(label1ändern), "Status: Alle PSC Codes gecheckt");
  249.                     else
  250.                         label1.Text = "Status: Alle PSC Codes gecheckt";
  251.                 }
  252.             }
  253.             catch
  254.             {
  255.             }
  256.         }
  257.  
  258.  
  259.         void PSCwerthinzufügen(int index, string statsu)
  260.         {
  261.             try
  262.             {
  263.                 listView1.Items[index].SubItems[1].Text = statsu;
  264.             }
  265.             catch
  266.             {
  267.             }
  268.         }
  269.  
  270.  
  271.         private void button3_Click(object sender, EventArgs e)
  272.         {
  273.             int proxyCount;
  274.             int line = 0;
  275.             using (OpenFileDialog o = new OpenFileDialog())
  276.             {
  277.                 o.Filter = "Text Files|*.txt|All Files|*.*";
  278.                 if (o.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  279.                 {
  280.                     proxyCount = File.ReadAllLines(o.FileName).Length;
  281.  
  282.                     foreach (String s in File.ReadAllLines(o.FileName))
  283.                     {
  284.                        
  285.                         try
  286.                         {
  287.                             Regex Url = new Regex("[0-9]{0,4}");
  288.                             StringBuilder sb = new StringBuilder();
  289.                             foreach (Match match in Url.Matches(s))
  290.                             {
  291.                                 string hinzufügen = match.ToString();
  292.                                 sb.Append(hinzufügen);
  293.                             }
  294.                             string l = sb.ToString();
  295.                             Regex Urls = new Regex("[0-9]{0,4}");
  296.                             StringBuilder ssb = new StringBuilder();
  297.                             foreach (Match match in Urls.Matches(l))
  298.                             {
  299.                                 string hinzufügen = match.ToString();
  300.                                 ssb.Append(hinzufügen + " ");
  301.                             }
  302.                             ListViewItem item1 = new ListViewItem();
  303.                             item1.Text = ssb.ToString();
  304.                             item1.SubItems.Add("");
  305.                             listView1.Items.Add(item1);
  306.                         }
  307.                         catch
  308.                         {
  309.                             line++;
  310.                         }
  311.                         line++;
  312.                         PSCmax++;
  313.                         Application.DoEvents();
  314.                     }
  315.                 }
  316.             }
  317.             if (label1.InvokeRequired)
  318.                 label1.Invoke(new updateApplicationDel(label1ändern), "Status: PSC von Textdatei hinzugefügt");
  319.             else
  320.                 label1.Text = "Status: PSC von Textdatei hinzugefügt";
  321.         }
  322.  
  323.         private void button5_Click(object sender, EventArgs e)
  324.         {
  325.             using (SaveFileDialog sF = new SaveFileDialog())
  326.             {
  327.                 sF.DefaultExt = "txt";
  328.                 sF.Filter = "Text Files|*.txt|All Files|*.*";
  329.                 if (sF.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  330.                 {
  331.                     int TwitterSave = listView1.Items.Count;
  332.                     if (checkBox1.Checked == true)
  333.                     {
  334.                         for (int i = 0; i <= TwitterSave; i++)
  335.                         {
  336.                             try
  337.                             {
  338.  
  339.                                 StreamWriter myFile = new StreamWriter(sF.FileName, true);
  340.                                 myFile.Write(listView1.Items[i].SubItems[0].Text.ToString() + " Wert = " + listView1.Items[i].SubItems[1].Text.ToString() + " €" + "\r\n");
  341.                                 myFile.Close();
  342.  
  343.                             }
  344.                             catch (Exception exc)
  345.                             {
  346.                                 string fehler = exc.ToString();
  347.                             }
  348.                         }
  349.                     }
  350.                     else
  351.                     {
  352.                         for (int i = 0; i <= TwitterSave; i++)
  353.                         {
  354.                             try
  355.                             {
  356.                                 StreamWriter myFile = new StreamWriter(sF.FileName, true);
  357.                                 myFile.Write(listView1.Items[i].SubItems[0].Text.ToString() + "\r\n");
  358.                                 myFile.Close();
  359.                             }
  360.                             catch (Exception exc)
  361.                             {
  362.                                 string fehler = exc.ToString();
  363.                             }
  364.                         }
  365.                     }
  366.                 }
  367.  
  368.             }
  369.             if (label1.InvokeRequired)
  370.                 label1.Invoke(new updateApplicationDel(label1ändern), "Status: PSC gespeichert");
  371.             else
  372.                 label1.Text = "Status: PSC gespeichert";
  373.             Application.DoEvents();
  374.         }
  375.  
  376.  
  377.         private bool pruefeEingabe(string tmp)
  378.         {
  379.             string pat = "0123456789 ";
  380.             foreach (char ch in tmp)
  381.             {
  382.                 if (pat.IndexOf(ch) < 0)
  383.                     return false;
  384.             }
  385.             return true;
  386.         }
  387.  
  388.         private void button4_Click(object sender, EventArgs e)
  389.         {
  390.             if (textBox2.Text != " ")
  391.             {
  392.                 if (textBox2.Text != "")
  393.                 {
  394.                     if (pruefeEingabe(textBox2.Text) == false)
  395.                     {
  396.                         MessageBox.Show("Bitte geben sie nur Zahlen ein!");
  397.                     }
  398.                     else
  399.                     {
  400.                         Regex Url = new Regex("[0-9]{0,4}");
  401.                         StringBuilder sb = new StringBuilder();
  402.                         foreach (Match match in Url.Matches(textBox2.Text))
  403.                         {
  404.                             string hinzufügen = match.ToString();
  405.                             sb.Append(hinzufügen);
  406.                         }
  407.                         string l = sb.ToString();
  408.                         Regex Urls = new Regex("[0-9]{0,4}");
  409.                         StringBuilder ssb = new StringBuilder();
  410.                         foreach (Match match in Urls.Matches(l))
  411.                         {
  412.                             string hinzufügen = match.ToString();
  413.                             ssb.Append(hinzufügen + " ");
  414.                         }
  415.                         ListViewItem item1 = new ListViewItem();
  416.                         item1.Text = ssb.ToString();
  417.                         item1.SubItems.Add("");
  418.                         listView1.Items.Add(item1);
  419.                         textBox2.Text = "";
  420.                         PSCmax++;
  421.                         if (label1.InvokeRequired)
  422.                             label1.Invoke(new updateApplicationDel(label1ändern), "Status:PSC von Textbox hinzugefügt");
  423.                         else
  424.                             label1.Text = "Status:PSC von Textbox hinzugefügt";
  425.                     }
  426.                 }
  427.                 else
  428.                 {
  429.                     MessageBox.Show("Bitte gebe sie eine PSC code ein");
  430.                 }
  431.             }
  432.             else
  433.             {
  434.                 MessageBox.Show("Bitte gebe sie eine PSC code ein");
  435.             }
  436.         }
  437.  
  438.  
  439.     }
  440. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement