Advertisement
FederationHax

KV CHECKER SOURCE | By Federation

Jun 7th, 2016
786
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.81 KB | None | 0 0
  1. BY FEDERATION | KV CHECKER SOURCE + download || https://mega.nz/#!VkYRwaaT!pMigvdYjnZWHuQI9pDEkslnYBwclWT3k_Z4PSRmd1xI
  2. ---------------------------------------------
  3.  
  4.  
  5. using DevComponents.DotNetBar;
  6. using DevComponents.DotNetBar.Controls;
  7. using DevComponents.DotNetBar.Metro;
  8. using DevComponents.DotNetBar.Metro.ColorTables;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.ComponentModel;
  12. using System.Drawing;
  13. using System.IO;
  14. using System.Linq;
  15. using System.Threading;
  16. using System.Windows.Forms;
  17. using XRPCLib;
  18.  
  19. namespace KV_Validator
  20. {
  21. public class Form1 : MetroForm
  22. {
  23. private IList<string> Names = (IList<string>) new List<string>();
  24. private XRPC Jtag = new XRPC();
  25. private KVC kv = new KVC();
  26. private IContainer components = (IContainer) null;
  27. private string[] subFiles;
  28. private bool isConnected;
  29. private bool renameCheck;
  30. private string status;
  31. private StyleManager styleManager1;
  32. private ListBox listBox1;
  33. private GroupPanel groupPanel1;
  34. private ButtonX buttonX2;
  35. private ButtonX buttonX1;
  36. private ProgressBarX progressBarX1;
  37. private LabelX labelX1;
  38. private LabelX labelX2;
  39. private ButtonX buttonX3;
  40. private ButtonX buttonX4;
  41.  
  42. public Form1()
  43. {
  44. this.InitializeComponent();
  45. }
  46.  
  47. private void Form1_Load(object sender, EventArgs e)
  48. {
  49. this.listBox1.Items.Clear();
  50. string path = AppDomain.CurrentDomain.BaseDirectory + "KVs\\";
  51. string[] files = Directory.GetFiles(path);
  52. foreach (string directory in Directory.GetDirectories(path))
  53. {
  54. this.subFiles = Directory.GetFiles(directory);
  55. foreach (string subFile in this.subFiles)
  56. {
  57. if (subFile.EndsWith(".bin") && !subFile.Contains("cpukey"))
  58. {
  59. int num1 = directory.LastIndexOf('\\');
  60. int num2 = num1 > 0 ? subFile.LastIndexOf('\\', num1 - 1) : -1;
  61. string str = subFile.Substring(num2 + 1);
  62. this.Names.Add(str);
  63. this.listBox1.Items.Add((object) str);
  64. }
  65. }
  66. }
  67. foreach (string str1 in files)
  68. {
  69. if (str1.EndsWith(".bin") && !str1.Contains("cpukey"))
  70. {
  71. int num1 = str1.LastIndexOf('\\');
  72. int num2 = num1 > 0 ? str1.LastIndexOf('\\', num1 - 1) : -1;
  73. string str2 = str1.Substring(num2 + 1);
  74. this.Names.Add(str2);
  75. this.listBox1.Items.Add((object) str2);
  76. }
  77. }
  78. }
  79.  
  80. private void buttonX1_Click(object sender, EventArgs e)
  81. {
  82. if (this.listBox1.Items.Count >= 1)
  83. {
  84. this.listBox1.Items.Clear();
  85. this.buttonX1.Enabled = false;
  86. this.buttonX2.Enabled = false;
  87. if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + "KVs\\log.txt"))
  88. File.Delete(AppDomain.CurrentDomain.BaseDirectory + "KVs\\log.txt");
  89. ThreadPool.QueueUserWorkItem(new WaitCallback(this.doWork));
  90. }
  91. else
  92. {
  93. int num = (int) MessageBoxEx.Show("No KV.bin files found at " + AppDomain.CurrentDomain.BaseDirectory + "\\KVs");
  94. }
  95. }
  96.  
  97. private void buttonX2_Click(object sender, EventArgs e)
  98. {
  99. if (this.listBox1.SelectedItem == null)
  100. {
  101. int num = (int) MessageBoxEx.Show("No KV was selected", "Error");
  102. }
  103. else
  104. {
  105. if (this.listBox1.Items.Count < 1)
  106. return;
  107. this.buttonX2.Enabled = false;
  108. this.buttonX1.Enabled = false;
  109. this.shortWork();
  110. }
  111. }
  112.  
  113. private string checkNames(string currentItem)
  114. {
  115. currentItem = this.listBox1.GetItemText(this.listBox1.SelectedItem);
  116. if (currentItem.EndsWith(" is Banned"))
  117. currentItem = currentItem.Substring(0, currentItem.Length - 10);
  118. if (currentItem.EndsWith(" is Unbanned"))
  119. currentItem = currentItem.Substring(0, currentItem.Length - 12);
  120. return currentItem;
  121. }
  122.  
  123. private void doWork(object state)
  124. {
  125. // this.Invoke((Delegate) (() => this.progressBarX1.Value = 0));
  126. foreach (string name in (IEnumerable<string>) this.Names)
  127. {
  128. if (!name.Contains("cpukey"))
  129. {
  130. this.kv.getStatus(name);
  131. if (!this.kv.returnStatus())
  132. {
  133. this.status = name + " is Unbanned";
  134. // this.Invoke((Delegate) (() => this.listBox1.Items.Add((object) this.status)));
  135. // this.Invoke((Delegate) (() => this.listBox1.Refresh()));
  136. }
  137. else
  138. {
  139. this.status = name + " is Banned";
  140. // this.Invoke((Delegate) (() => this.listBox1.Items.Add((object) this.status)));
  141. // this.Invoke((Delegate) (() => this.listBox1.Refresh()));
  142. }
  143. // this.Invoke((Delegate) (() => this.progressBarStep()));
  144. // this.Invoke((Delegate) (() => this.progressBarX1.Refresh()));
  145. }
  146. }
  147. // this.Invoke((Delegate) (() => this.progressBarX1.Value = 100));
  148. // this.Invoke((Delegate) (() => this.buttonX1.Enabled = true));
  149. // this.Invoke((Delegate) (() => this.buttonX2.Enabled = true));
  150. // this.Invoke((Delegate) (() => this.listBox1.SelectedIndex = 0));
  151. }
  152.  
  153. private void listBox1_DrawItem(object sender, DrawItemEventArgs e)
  154. {
  155. if (e.Index < 0)
  156. return;
  157. if ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
  158. e = new DrawItemEventArgs(e.Graphics, e.Font, e.Bounds, e.Index, e.State ^ DrawItemState.Selected, e.ForeColor, Color.DarkOrange);
  159. e.DrawBackground();
  160. e.Graphics.DrawString(this.listBox1.Items[e.Index].ToString(), e.Font, Brushes.Black, (RectangleF) e.Bounds, StringFormat.GenericDefault);
  161. e.DrawFocusRectangle();
  162. }
  163.  
  164. private void progressBarStep()
  165. {
  166. this.progressBarX1.Step = 100 / this.Names.Count<string>();
  167. this.progressBarX1.PerformStep();
  168. this.progressBarX1.Refresh();
  169. }
  170.  
  171. private void shortWork()
  172. {
  173. foreach (string name in (IEnumerable<string>) this.Names)
  174. {
  175. if (name == this.checkNames(this.listBox1.GetItemText(this.listBox1.SelectedItem)))
  176. {
  177. try
  178. {
  179. this.progressBarX1.Value = 0;
  180. this.kv.getStatus(name);
  181. if (!this.kv.returnStatus())
  182. {
  183. this.status = name + " is Unbanned";
  184. this.listBox1.Items[this.listBox1.SelectedIndex] = (object) this.status;
  185. }
  186. else
  187. {
  188. this.status = name + " is Banned";
  189. this.listBox1.Items[this.listBox1.SelectedIndex] = (object) this.status;
  190. }
  191. this.listBox1.Refresh();
  192. this.buttonX2.Enabled = true;
  193. this.buttonX1.Enabled = true;
  194. this.progressBarX1.Value = 100;
  195. }
  196. catch (Exception ex)
  197. {
  198. int num = (int) MessageBoxEx.Show("Sorry, checking the current KV has failed\nCurrent File: " + name + "\n" + (object) ex);
  199. }
  200. }
  201. }
  202. }
  203.  
  204. private void labelX2_Click(object sender, EventArgs e)
  205. {
  206. int num1 = (int) MessageBoxEx.Show("Need some Unshared and Unbanned KVs?" + Environment.NewLine + Environment.NewLine + "Message sbmodz on Skype");
  207. int num2 = (int) MessageBoxEx.Show("PRICES:" + Environment.NewLine + Environment.NewLine + "PAYPAL/GOOGLE WALLET" + Environment.NewLine + "1+ $5 EACH" + Environment.NewLine + "10+ $4 EACH" + Environment.NewLine + "25+ $3.75 EACH" + Environment.NewLine + "50+ $3.50 EACH" + Environment.NewLine + "100+ $3.25 EACH" + Environment.NewLine + Environment.NewLine + "AMAZON:" + Environment.NewLine + "$6.50 EACH");
  208. }
  209.  
  210. private void buttonX3_Click(object sender, EventArgs e)
  211. {
  212. if (!this.isConnected)
  213. {
  214. this.Jtag.Connect();
  215. this.isConnected = true;
  216. }
  217. if (this.Jtag.activeConnection)
  218. {
  219. SaveFileDialog saveFileDialog = new SaveFileDialog();
  220. saveFileDialog.Title = "Save your Xbox 360 KV.bin file";
  221. saveFileDialog.Filter = "Binary File (*.bin)|*.bin";
  222. saveFileDialog.FileName = "KV";
  223. if (Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + "\\KVs"))
  224. saveFileDialog.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory + "\\KVs";
  225. else
  226. saveFileDialog.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory;
  227. if (saveFileDialog.ShowDialog() != DialogResult.OK)
  228. return;
  229. try
  230. {
  231. this.Jtag.xbCon.ReceiveFile(saveFileDialog.FileName, "HDD:\\KV.bin");
  232. int num1 = saveFileDialog.FileName.LastIndexOf('\\');
  233. int num2 = num1 > 0 ? saveFileDialog.FileName.LastIndexOf('\\', num1 - 1) : -1;
  234. string str = saveFileDialog.FileName.Substring(num2 + 1);
  235. this.kv.getStatus(saveFileDialog.FileName);
  236. if (!this.kv.returnStatus())
  237. {
  238. this.listBox1.Items.Add((object) (str + " is Unbanned"));
  239. this.listBox1.Refresh();
  240. }
  241. else
  242. {
  243. if (!this.kv.returnStatus())
  244. return;
  245. this.listBox1.Items.Add((object) (str + " is Banned"));
  246. this.listBox1.Refresh();
  247. }
  248. }
  249. catch (Exception ex)
  250. {
  251. int num = (int) MessageBoxEx.Show("Sorry, receiving the KV.bin file has failed\nCheck the file exists\nJRPC2 will block receiving of the file\n" + (object) ex);
  252. }
  253. }
  254. else
  255. {
  256. int num3 = (int) MessageBoxEx.Show("Sorry, could not connect to console\nVerify your connection and try again", "Error");
  257. }
  258. }
  259.  
  260. private void buttonX4_Click(object sender, EventArgs e)
  261. {
  262. if (this.listBox1.SelectedItem == null)
  263. {
  264. int num1 = (int) MessageBoxEx.Show("No KV was selected", "Error");
  265. }
  266. else
  267. {
  268. if (!this.isConnected)
  269. {
  270. this.Jtag.Connect();
  271. this.isConnected = true;
  272. }
  273. if (this.Jtag.activeConnection)
  274. {
  275. string itemText = this.listBox1.GetItemText(this.listBox1.SelectedItem);
  276. foreach (string name in (IEnumerable<string>) this.Names)
  277. {
  278. if (name == this.checkNames(itemText))
  279. {
  280. try
  281. {
  282. string str = name.Substring(name.LastIndexOf('\\') + 1);
  283. if (this.renameCheck)
  284. {
  285. this.Jtag.xbCon.SendFile(AppDomain.CurrentDomain.BaseDirectory + name, "HDD:\\" + str);
  286. int num2 = (int) MessageBoxEx.Show("Sent KV Successfully", "Success");
  287. this.progressBarX1.Value = 100;
  288. }
  289. else if (!this.renameCheck)
  290. {
  291. this.Jtag.xbCon.SendFile(AppDomain.CurrentDomain.BaseDirectory + name, "HDD:\\KV.bin");
  292. this.progressBarX1.Value = 100;
  293. int num2 = (int) MessageBoxEx.Show("Sent KV Successfully", "Success");
  294. }
  295. this.progressBarX1.Value = 0;
  296. }
  297. catch (Exception ex)
  298. {
  299. int num2 = (int) MessageBoxEx.Show("Sorry, sending the KV.bin file has failed\n" + (object) ex);
  300. }
  301. }
  302. }
  303. }
  304. else
  305. {
  306. int num3 = (int) MessageBoxEx.Show("Sorry, could not connect to console\nVerify your connection and try again", "Error");
  307. }
  308. }
  309. }
  310.  
  311. protected override void Dispose(bool disposing)
  312. {
  313. if (disposing && this.components != null)
  314. this.components.Dispose();
  315. base.Dispose(disposing);
  316. }
  317.  
  318. private void InitializeComponent()
  319. {
  320. this.components = (IContainer) new Container();
  321. ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (Form1));
  322. this.styleManager1 = new StyleManager(this.components);
  323. this.listBox1 = new ListBox();
  324. this.groupPanel1 = new GroupPanel();
  325. this.labelX2 = new LabelX();
  326. this.buttonX3 = new ButtonX();
  327. this.buttonX4 = new ButtonX();
  328. this.buttonX2 = new ButtonX();
  329. this.buttonX1 = new ButtonX();
  330. this.progressBarX1 = new ProgressBarX();
  331. this.labelX1 = new LabelX();
  332. this.groupPanel1.SuspendLayout();
  333. this.SuspendLayout();
  334. this.styleManager1.ManagerStyle = eStyle.Office2016;
  335. this.styleManager1.MetroColorParameters = new MetroColorGeneratorParameters(Color.FromArgb((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue), Color.Green);
  336. this.listBox1.BackColor = Color.FromArgb((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue);
  337. this.listBox1.DrawMode = DrawMode.OwnerDrawFixed;
  338. this.listBox1.ForeColor = Color.Black;
  339. this.listBox1.FormattingEnabled = true;
  340. this.listBox1.HorizontalScrollbar = true;
  341. this.listBox1.Location = new Point(124, 3);
  342. this.listBox1.Name = "listBox1";
  343. this.listBox1.Size = new Size(272, 212);
  344. this.listBox1.TabIndex = 3;
  345. this.listBox1.DrawItem += new DrawItemEventHandler(this.listBox1_DrawItem);
  346. this.groupPanel1.BackColor = Color.FromArgb((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue);
  347. this.groupPanel1.CanvasColor = Color.FromArgb((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue);
  348. this.groupPanel1.ColorSchemeStyle = eDotNetBarStyle.StyleManagerControlled;
  349. this.groupPanel1.Controls.Add((Control) this.labelX2);
  350. this.groupPanel1.Controls.Add((Control) this.buttonX3);
  351. this.groupPanel1.Controls.Add((Control) this.buttonX4);
  352. this.groupPanel1.Controls.Add((Control) this.buttonX2);
  353. this.groupPanel1.Controls.Add((Control) this.buttonX1);
  354. this.groupPanel1.Controls.Add((Control) this.progressBarX1);
  355. this.groupPanel1.Controls.Add((Control) this.listBox1);
  356. this.groupPanel1.DisabledBackColor = Color.Empty;
  357. this.groupPanel1.Location = new Point(12, 12);
  358. this.groupPanel1.Name = "groupPanel1";
  359. this.groupPanel1.Size = new Size(405, 267);
  360. this.groupPanel1.Style.BackColor2SchemePart = eColorSchemePart.PanelBackground2;
  361. this.groupPanel1.Style.BackColorGradientAngle = 90;
  362. this.groupPanel1.Style.BackColorSchemePart = eColorSchemePart.PanelBackground;
  363. this.groupPanel1.Style.BorderBottom = eStyleBorderType.Solid;
  364. this.groupPanel1.Style.BorderBottomWidth = 1;
  365. this.groupPanel1.Style.BorderColorSchemePart = eColorSchemePart.PanelBorder;
  366. this.groupPanel1.Style.BorderLeft = eStyleBorderType.Solid;
  367. this.groupPanel1.Style.BorderLeftWidth = 1;
  368. this.groupPanel1.Style.BorderRight = eStyleBorderType.Solid;
  369. this.groupPanel1.Style.BorderRightWidth = 1;
  370. this.groupPanel1.Style.BorderTop = eStyleBorderType.Solid;
  371. this.groupPanel1.Style.BorderTopWidth = 1;
  372. this.groupPanel1.Style.CornerDiameter = 4;
  373. this.groupPanel1.Style.CornerType = eCornerType.Rounded;
  374. this.groupPanel1.Style.TextAlignment = eStyleTextAlignment.Center;
  375. this.groupPanel1.Style.TextColorSchemePart = eColorSchemePart.PanelText;
  376. this.groupPanel1.Style.TextLineAlignment = eStyleTextAlignment.Near;
  377. this.groupPanel1.StyleMouseDown.CornerType = eCornerType.Square;
  378. this.groupPanel1.StyleMouseOver.CornerType = eCornerType.Square;
  379. this.groupPanel1.TabIndex = 4;
  380. this.groupPanel1.Text = "KV Checker";
  381. this.labelX2.BackColor = Color.FromArgb((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue);
  382. // this.labelX2.BackgroundImage = (Image) componentResourceManager.GetObject("labelX2.BackgroundImage");
  383. this.labelX2.BackgroundImageLayout = ImageLayout.Zoom;
  384. this.labelX2.BackgroundStyle.CornerType = eCornerType.Square;
  385. this.labelX2.ForeColor = Color.Black;
  386. this.labelX2.ImeMode = ImeMode.NoControl;
  387. this.labelX2.Location = new Point(3, 75);
  388. this.labelX2.Name = "labelX2";
  389. this.labelX2.Size = new Size(115, 67);
  390. this.labelX2.Style = eDotNetBarStyle.StyleManagerControlled;
  391. this.labelX2.TabIndex = 9;
  392. this.labelX2.Click += new EventHandler(this.labelX2_Click);
  393. this.buttonX3.AccessibleRole = AccessibleRole.PushButton;
  394. this.buttonX3.ColorTable = eButtonColor.OrangeWithBackground;
  395. this.buttonX3.Location = new Point(3, 148);
  396. this.buttonX3.Name = "buttonX3";
  397. this.buttonX3.Size = new Size(115, 30);
  398. this.buttonX3.Style = eDotNetBarStyle.StyleManagerControlled;
  399. this.buttonX3.TabIndex = 8;
  400. this.buttonX3.Text = "Grab KV from Console";
  401. this.buttonX3.Click += new EventHandler(this.buttonX3_Click);
  402. this.buttonX4.AccessibleRole = AccessibleRole.PushButton;
  403. this.buttonX4.ColorTable = eButtonColor.OrangeWithBackground;
  404. this.buttonX4.Location = new Point(3, 184);
  405. this.buttonX4.Name = "buttonX4";
  406. this.buttonX4.Size = new Size(115, 30);
  407. this.buttonX4.Style = eDotNetBarStyle.StyleManagerControlled;
  408. this.buttonX4.TabIndex = 7;
  409. this.buttonX4.Text = "Send selected KV to Console";
  410. this.buttonX4.Click += new EventHandler(this.buttonX4_Click);
  411. this.buttonX2.AccessibleRole = AccessibleRole.PushButton;
  412. this.buttonX2.ColorTable = eButtonColor.OrangeWithBackground;
  413. this.buttonX2.Location = new Point(3, 39);
  414. this.buttonX2.Name = "buttonX2";
  415. this.buttonX2.Size = new Size(115, 30);
  416. this.buttonX2.Style = eDotNetBarStyle.StyleManagerControlled;
  417. this.buttonX2.TabIndex = 6;
  418. this.buttonX2.Text = "Check selected KV";
  419. this.buttonX2.Click += new EventHandler(this.buttonX2_Click);
  420. // this.buttonX1.AccessibleRole = AccessibleRole.PushButton;
  421. this.buttonX1.ColorTable = eButtonColor.OrangeWithBackground;
  422. this.buttonX1.Location = new Point(3, 3);
  423. this.buttonX1.Name = "buttonX1";
  424. this.buttonX1.Size = new Size(115, 30);
  425. this.buttonX1.Style = eDotNetBarStyle.StyleManagerControlled;
  426. this.buttonX1.TabIndex = 5;
  427. this.buttonX1.Text = "Run Bulk Checker";
  428. this.buttonX1.Click += new EventHandler(this.buttonX1_Click);
  429. this.progressBarX1.BackColor = Color.FromArgb((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue);
  430. this.progressBarX1.BackgroundStyle.CornerType = eCornerType.Square;
  431. this.progressBarX1.ForeColor = Color.Black;
  432. this.progressBarX1.Location = new Point(3, 220);
  433. this.progressBarX1.Name = "progressBarX1";
  434. this.progressBarX1.Size = new Size(393, 23);
  435. this.progressBarX1.Style = eDotNetBarStyle.StyleManagerControlled;
  436. this.progressBarX1.TabIndex = 4;
  437. this.progressBarX1.Text = "progressBarX1";
  438. this.labelX1.BackColor = Color.FromArgb((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue);
  439. this.labelX1.BackgroundStyle.CornerType = eCornerType.Square;
  440. this.labelX1.ForeColor = Color.Black;
  441. this.labelX1.Location = new Point(324, 275);
  442. this.labelX1.Name = "labelX1";
  443. this.labelX1.Size = new Size(93, 23);
  444. this.labelX1.Style = eDotNetBarStyle.StyleManagerControlled;
  445. this.labelX1.TabIndex = 5;
  446. this.labelX1.Text = "XeDev Michael <3";
  447. this.AutoScaleDimensions = new SizeF(6f, 13f);
  448. // this.AutoScaleMode = AutoScaleMode.Font;
  449. this.ClientSize = new Size(429, 291);
  450. this.Controls.Add((Control) this.groupPanel1);
  451. this.Controls.Add((Control) this.labelX1);
  452. this.DoubleBuffered = true;
  453. // this.Icon = (Icon) componentResourceManager.GetObject("$this.Icon");
  454. this.MaximizeBox = false;
  455. this.MaximumSize = new Size(445, 330);
  456. this.MinimumSize = new Size(445, 330);
  457. this.Name = "Form1";
  458. this.StartPosition = FormStartPosition.CenterParent;
  459. this.Text = "SbModz KV Validator";
  460. this.Load += new EventHandler(this.Form1_Load);
  461. this.groupPanel1.ResumeLayout(false);
  462. this.ResumeLayout(false);
  463. }
  464. }
  465. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement