Bond697

5th Gen Wild Pokemon Hack-Check

Jul 19th, 2011
596
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.51 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.  
  10. namespace RNGPID
  11. {
  12.     public partial class checkPoke : Form
  13.     {
  14.         private static bool open;
  15.         private readonly char[] accepted = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
  16.  
  17.         public checkPoke()
  18.         {
  19.             InitializeComponent();
  20.             open = true;
  21.             hacktidText.MaxLength = 5;
  22.             hacksidText.MaxLength = 5;
  23.             checkPIDText.MaxLength = 10;
  24.         }
  25.  
  26.         public static bool isOpen()
  27.         {
  28.             return open;
  29.         }
  30.  
  31.         private void hackCheck_KeyPress(object sender, KeyPressEventArgs e)//stop all keystrokes but the allowed list for tid/sid/pid
  32.         {
  33.             if (char.IsControl(e.KeyChar))
  34.                 return;
  35.             for (int i = 0; i < accepted.Length; i++)
  36.             {
  37.                 if (e.KeyChar == accepted[i])
  38.                 {
  39.                     return;
  40.                 }
  41.             }
  42.             e.Handled = true;
  43.         }
  44.  
  45.         private void checkPoke_Load(object sender, EventArgs e)
  46.         {
  47.  
  48.         }
  49.  
  50.         private void hackRun_Click(object sender, EventArgs e)
  51.         {
  52.             uint pid, low, abil, tid, sid, pidTest;
  53.             byte xorTest;
  54.  
  55.             uint.TryParse(hacktidText.Text, System.Globalization.NumberStyles.Number, null, out tid);
  56.             uint.TryParse(hacksidText.Text, System.Globalization.NumberStyles.Number, null, out sid);
  57.             uint.TryParse(checkPIDText.Text, System.Globalization.NumberStyles.Number, null, out pid);
  58.  
  59.             abil = (pid >> 0x10) & 1;
  60.             abilityText.Text = abil.ToString();
  61.  
  62.  
  63.             xorTest = (byte)((tid & 1) ^ (sid & 1) ^ (pid >> 31) ^ (pid & 1));
  64.  
  65.             if (xorTest == 1)
  66.             {
  67.                 pidText.Text = "Illegal";
  68.             }
  69.             else
  70.             {
  71.                 pidText.Text = "Legal";
  72.             }
  73.  
  74.            
  75.             low = pid & 0xFFFF;
  76.  
  77.             pidTest = (tid ^ sid) ^ low;
  78.  
  79.             if ((pidTest & 1) == 1)
  80.                {
  81.                     orTest.Text = "Yes";
  82.                }
  83.             else
  84.                {
  85.                     orTest.Text = "No";
  86.                }
  87.         }
  88.  
  89.         private void checkPoke_FormClosed(object sender, FormClosedEventArgs e)
  90.         {
  91.             open = false;
  92.         }
  93.  
  94.     }
  95. }
Comments
  • User was banned
Add Comment
Please, Sign In to add comment