Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 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, high, 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. high = pid >> 0x10;
  76. low = pid << 0x10 >> 0x10;
  77.  
  78. pidTest = (tid ^ sid) ^ low;
  79.  
  80. if ((pidTest & 1) == 1)
  81. {
  82. orTest.Text = "Yes";
  83. }
  84. else
  85. {
  86. orTest.Text = "No";
  87. }
  88.  
  89.  
  90. }
  91.  
  92. private void checkPoke_FormClosed(object sender, FormClosedEventArgs e)
  93. {
  94. open = false;
  95. }
  96.  
  97. }
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement