Advertisement
Guest User

Untitled

a guest
Jan 14th, 2011
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.33 KB | None | 0 0
  1. namespace AthenaUnlocker
  2. {
  3. using System;
  4. using System.ComponentModel;
  5. using System.Diagnostics;
  6. using System.Drawing;
  7. using System.IO;
  8. using System.Net;
  9. using System.Reflection;
  10. using System.Runtime.CompilerServices;
  11. using System.Runtime.InteropServices;
  12. using System.Threading;
  13. using System.Windows.Forms;
  14.  
  15. public class Form1 : Form
  16. {
  17. public Assembly a = Assembly.GetExecutingAssembly();
  18. private bool butt1;
  19. private Button button1;
  20. private Button button2;
  21. private Button button3;
  22. private IContainer components;
  23. private Label label1;
  24. private Label label2;
  25. private Label label3;
  26. private Label label4;
  27. private TextBox txtDebug;
  28.  
  29. public Form1()
  30. {
  31. this.InitializeComponent();
  32. }
  33.  
  34. private void button1_Click(object sender, EventArgs e)
  35. {
  36. if (MessageBox.Show("Did you already apply Hard-SPL to your device? if the answer is Yes, would you like to skip this step?", "Already Hard-SPL'd?", MessageBoxButtons.YesNo) != DialogResult.Yes)
  37. {
  38. this.button1.Enabled = false;
  39. MessageBox.Show("Hard-SPL will now be extracted and run - a few antivirus programs incorrectly detect it as a virus due to incorrect hueristics, IT IS NOT A VIRUS, disable your antivirus program if this occurs", "Warning!!!", MessageBoxButtons.OK);
  40. this.extractAssembly("pput.exe", @"\TempRho\pput.exe");
  41. this.extractAssembly("prun.exe", @"\TempRho\prun.exe");
  42. this.extractAssembly("EnableRapi.cab", @"\TempRho\EnableRapi.cab");
  43. this.extractAssembly("RapiConfig.exe", @"\TempRho\RapiConfig.exe");
  44. this.extractAssembly("SSPL.exe", @"\TempRho\HardSPL.exe");
  45. this.runExecutable(@"\TempRho\pput.exe", @"-f EnableRapi.cab \EnableRapi.cab", @"\TempRho");
  46. this.runExecutable(@"\TempRho\prun.exe", @"\Windows\wceload.exe \EnableRapi.cab", @"\TempRho");
  47. MessageBox.Show("Please look at your device and install the tool then click OK once it completes", "Check Device", MessageBoxButtons.OK);
  48. this.runExecutable(@"\TempRho\RapiConfig.exe", "/P /M Open.xml", @"\TempRho");
  49. MessageBox.Show("Your device will now be flashed, follow the instructions, when the loading bar appears on the PC, Please wait patiently for the device to be flashed, it will go straight from 0% to 100%", "Information", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
  50. Process process = new Process();
  51. try
  52. {
  53. ProcessStartInfo info = new ProcessStartInfo("HardSPL.exe", "");
  54. info.WorkingDirectory = @"\TempRho";
  55. process.StartInfo = info;
  56. process.Start();
  57. base.Hide();
  58. }
  59. catch
  60. {
  61. MessageBox.Show("Running Hard-SPL failed, your antivirus most probably blocked it, disable your Antivirus and rerun this step");
  62. this.button1.Enabled = true;
  63. return;
  64. }
  65. process.WaitForExit();
  66. base.Show();
  67. Thread.Sleep(600);
  68. System.IO.File.Delete(@"\TempRho\HardSPL.exe");
  69. this.txtDebug.Text = this.txtDebug.Text + "\r\n\r\nStep 1 Ended!";
  70. this.button2.Enabled = true;
  71. }
  72. }
  73.  
  74. private void button2_Click(object sender, EventArgs e)
  75. {
  76. this.butt1 = this.button1.Enabled;
  77. this.button2.Enabled = false;
  78. new Thread(new ThreadStart(this.button2Thread)).Start();
  79. this.txtDebug.Text = this.txtDebug.Text + "\r\n\r\n==Communicating with Device...==\r\n\r\n";
  80. this.button1.Enabled = false;
  81. this.button3.Enabled = false;
  82. }
  83.  
  84. private void button2Thread()
  85. {
  86. string str;
  87. if (this.DoPreAuthenticate(out str))
  88. {
  89. this.txtDebug.Invoke(new setTextBox(this.setTextBoxx), new object[] { "\r\n\r\n==Running Radio Updater==\r\n\r\n" });
  90. this.runExecutable(@"\TempRho\pdel.exe", @"\devctl.dll", @"\TempRho");
  91. System.IO.File.Delete(@"\TempRho\prun.exe");
  92. System.IO.File.Delete(@"\TempRho\pget.exe");
  93. System.IO.File.Delete(@"\TempRho\pdel.exe");
  94. this.extractAssembly("PatchedAMSS.nbh", @"\TempRho\RUU_Signed.nbh");
  95. this.extractAssembly("EnterBootloader.exe", @"\TempRho\EnterBootloader.exe");
  96. this.extractAssembly("ErrorBattery.fig", @"\TempRho\ErrorBattery.fig");
  97. this.extractAssembly("ErrorUSB.fig", @"\TempRho\ErrorUSB.fig");
  98. this.extractAssembly("ModelID.fig", @"\TempRho\ModelID.fig");
  99. this.extractAssembly("rapitool.exe", @"\TempRho\rapitool.exe");
  100. this.extractAssembly("ROMUpdateUtility.exe", @"\TempRho\ROMUpdateUtility.exe");
  101. this.extractAssembly("ROMUpdateUtility.cfg", @"\TempRho\ROMUpdateUtility.cfg");
  102. this.extractAssembly("RUUGetInfo.exe", @"\TempRho\RUUGetInfo.exe");
  103. this.extractAssembly("RUUResource.dll", @"\TempRho\RUUResource.dll");
  104. if (this.butt1)
  105. {
  106. this.extractAssembly("EnableRapi.cab", @"\TempRho\EnableRapi.cab");
  107. this.extractAssembly("pput.exe", @"\TempRho\pput.exe");
  108. this.extractAssembly("prun.exe", @"\TempRho\prun.exe");
  109. this.runExecutable(@"\TempRho\pput.exe", @"-f EnableRapi.cab \EnableRapi.cab", @"\TempRho");
  110. this.runExecutable(@"\TempRho\prun.exe", @"\Windows\wceload.exe \EnableRapi.cab", @"\TempRho");
  111. MessageBox.Show("Please look at your device and install the tool then click OK once it completes", "Check Device", MessageBoxButtons.OK);
  112. this.extractAssembly("RapiConfig.exe", @"\TempRho\RapiConfig.exe");
  113. this.extractAssembly("Open.xml", @"\TempRho\Open.xml");
  114. }
  115. this.runExecutable(@"\TempRho\RapiConfig.exe", "/P /M Open.xml", @"\TempRho");
  116. Process process = new Process();
  117. ProcessStartInfo info = new ProcessStartInfo("ROMUpdateUtility.exe", "");
  118. info.WorkingDirectory = @"\TempRho";
  119. base.Invoke(new SetForm(this.SetFrm), new object[] { this, false });
  120. process.StartInfo = info;
  121. process.Start();
  122. process.WaitForExit();
  123. base.Invoke(new SetForm(this.SetFrm), new object[] { this, true });
  124. MessageBox.Show("Your Device must now be unlocked with a program, please configure your device and then connect and sync with Activesync. after doing so, Run step 3.", "READ THIS THROUGH!", MessageBoxButtons.OK);
  125. this.txtDebug.Invoke(new setTextBox(this.setTextBoxx), new object[] { "==Radio Patched!==\r\n\r\n" });
  126. this.button3.Invoke(new SetButton(this.setBtn), new object[] { this.button3, true });
  127. }
  128. }
  129.  
  130. private void button3_Click(object sender, EventArgs e)
  131. {
  132. MessageBox.Show("Please be patient while your data is retrieved, CLICK OK TO BEGIN");
  133. this.button1.Enabled = false;
  134. this.button2.Enabled = false;
  135. this.button3.Enabled = false;
  136. new Thread(new ThreadStart(this.button3Thread)).Start();
  137. }
  138.  
  139. private void button3Thread()
  140. {
  141. string str;
  142. this.txtDebug.Invoke(new setTextBox(this.setTextBoxx), new object[] { "\r\n\r\n==Communicating with Device...==\r\n\r\n" });
  143. if (this.DoAuthenticate(out str))
  144. {
  145. this.txtDebug.Invoke(new setTextBox(this.setTextBoxx), new object[] { "\r\n\r\n==Success, Running Unlock==\r\n\r\n" });
  146. this.extractAssembly("pdel.exe", @"\TempRho\pdel.exe");
  147. this.extractAssembly("pput.exe", @"\TempRho\pput.exe");
  148. this.extractAssembly("prun.exe", @"\TempRho\prun.exe");
  149. this.extractAssembly("pget.exe", @"\TempRho\pget.exe");
  150. this.runExecutable(@"\TempRho\pdel.exe", @"\devctl.dll", @"\TempRho");
  151. this.runExecutable(@"\TempRho\pput.exe", @"-f ATcmd.exe \ATcmd.exe", @"\TempRho");
  152. this.runExecutable(@"\TempRho\prun.exe", @"\ATcmd.exe -f devctl.dll AT@SYSTEMTIME?", @"\TempRho");
  153. Thread.Sleep(0x7d0);
  154. this.runExecutable(@"\TempRho\pget.exe", @"-f \devctl.dll ROMUpdateUtility.cfg", @"\TempRho");
  155. this.runExecutable(@"\TempRho\pdel.exe", @"\devctl.dll", @"\TempRho");
  156. string str2 = System.IO.File.ReadAllText("ROMUpdateUtility.cfg");
  157. this.runExecutable(@"\TempRho\prun.exe", @"\ATcmd.exe -f devctl.dll AT@CID?", @"\TempRho");
  158. Thread.Sleep(0x7d0);
  159. this.runExecutable(@"\TempRho\pget.exe", @"-f \devctl.dll ROMUpdateUtility.cfg", @"\TempRho");
  160. string str3 = System.IO.File.ReadAllText("ROMUpdateUtility.cfg").Split(new char[] { ' ' })[1].Substring(0, 8);
  161. this.runExecutable(@"\TempRho\pdel.exe", @"\devctl.dll", @"\TempRho");
  162. string str4 = "";
  163. try
  164. {
  165. WebResponse response = WebRequest.Create("http://www.htc-unlocks.com/verify.php?IMEI=" + str + "&time=" + str2 + "&cid=" + str3).GetResponse();
  166. str4 = new StreamReader(response.GetResponseStream()).ReadToEnd();
  167. response.Close();
  168. }
  169. catch
  170. {
  171. MessageBox.Show("Could not connect, try again shortly and check your internet is working");
  172. this.button3.Invoke(new SetButton(this.setBtn), new object[] { this.button3, true });
  173. return;
  174. }
  175. System.IO.File.Delete(@"\TempRho\pdel.exe");
  176. this.runExecutable(@"\TempRho\prun.exe", @"\ATcmd.exe -f devctl.dll AT@SMARTCARD=" + str4, @"\TempRho");
  177. this.extractAssembly("pput.exe", @"\TempRho\pput.exe");
  178. this.extractAssembly("prun.exe", @"\TempRho\prun.exe");
  179. this.extractAssembly("RhodUnlock.exe", @"\TempRho\RhodUnlock.exe");
  180. this.runExecutable(@"\TempRho\pput.exe", @"-f RhodUnlock.exe \RhodUnlock.exe", @"\TempRho");
  181. this.runExecutable(@"\TempRho\prun.exe", "RhodUnlock.exe", @"\TempRho");
  182. MessageBox.Show("Please now unlock your device with the options provided, CID unlock is mainly cosmetic and can be considered optional. SIM unlock is applied automatically. if you don't know what an options is for, then YOU DON'T NEED IT. You can now close this program!", "Next Instructions", MessageBoxButtons.OK);
  183. try
  184. {
  185. Directory.Delete(@"\TempRho", true);
  186. }
  187. catch
  188. {
  189. }
  190. }
  191. }
  192.  
  193. private void DeleteTheCrap()
  194. {
  195. try
  196. {
  197. System.IO.File.Delete(@"\TempRho\ROMUpdateUtility.cfg");
  198. System.IO.File.Delete(@"\TempRho\prun.exe");
  199. System.IO.File.Delete(@"\TempRho\pget.exe");
  200. System.IO.File.Delete(@"\TempRho\pdel.exe");
  201. System.IO.File.Delete(@"\TempRho\ATcmd.exe");
  202. }
  203. catch
  204. {
  205. }
  206. }
  207.  
  208. protected override void Dispose(bool disposing)
  209. {
  210. if (disposing && (this.components != null))
  211. {
  212. this.components.Dispose();
  213. }
  214. base.Dispose(disposing);
  215. }
  216.  
  217. private bool DoAuthenticate(out string imei)
  218. {
  219. imei = "";
  220. string str = "";
  221. try
  222. {
  223. this.extractAssembly("pput.exe", @"\TempRho\pput.exe");
  224. this.extractAssembly("prun.exe", @"\TempRho\prun.exe");
  225. this.extractAssembly("pdel.exe", @"\TempRho\pdel.exe");
  226. this.extractAssembly("pget.exe", @"\TempRho\pget.exe");
  227. this.extractAssembly("ATcmd.exe", @"\TempRho\ATcmd.exe");
  228. this.runExecutable(@"\TempRho\pput.exe", @"-f ATcmd.exe \ATcmd.exe", @"\TempRho");
  229. this.runExecutable(@"\TempRho\prun.exe", @"\ATcmd.exe -f devctl.dll AT@PID?", @"\TempRho");
  230. Thread.Sleep(0x3e8);
  231. this.runExecutable(@"\TempRho\pget.exe", @"-f \devctl.dll ROMUpdateUtility.cfg", @"\TempRho");
  232. this.runExecutable(@"\TempRho\pdel.exe", @"\devctl.dll", @"\TempRho");
  233. str = System.IO.File.ReadAllText(@"\TempRho\ROMUpdateUtility.cfg");
  234. this.runExecutable(@"\TempRho\pput.exe", @"-f ATcmd.exe \ATcmd.exe", @"\TempRho");
  235. this.runExecutable(@"\TempRho\prun.exe", @"\ATcmd.exe -f devctl.dll AT@IMEI?", @"\TempRho");
  236. Thread.Sleep(0x3e8);
  237. this.runExecutable(@"\TempRho\pget.exe", @"-f \devctl.dll ROMUpdateUtility.cfg", @"\TempRho");
  238. this.runExecutable(@"\TempRho\pdel.exe", @"\devctl.dll", @"\TempRho");
  239. imei = System.IO.File.ReadAllText(@"\TempRho\ROMUpdateUtility.cfg");
  240. imei = imei.Substring(0, 15);
  241. }
  242. catch
  243. {
  244. }
  245. string str2 = "";
  246. try
  247. {
  248. WebResponse response = WebRequest.Create("http://www.htc-unlocks.com/verify.php?IMEI=" + imei).GetResponse();
  249. str2 = new StreamReader(response.GetResponseStream()).ReadToEnd();
  250. response.Close();
  251. }
  252. catch
  253. {
  254. this.DeleteTheCrap();
  255. MessageBox.Show("Unable to make internet connection, perhaps you have a firewall running?");
  256. this.button3.Invoke(new SetButton(this.setBtn), new object[] { this.button3, true });
  257. return false;
  258. }
  259. if (!str2.Contains("OK"))
  260. {
  261. this.DeleteTheCrap();
  262. if (str2.Contains("BD"))
  263. {
  264. MessageBox.Show("Error with verification, please check your e-mail now.");
  265. }
  266. return false;
  267. }
  268. if (!str.Contains("RHODIUMW"))
  269. {
  270. this.DeleteTheCrap();
  271. MessageBox.Show("Incompatible device!");
  272. return false;
  273. }
  274. this.DeleteTheCrap();
  275. return true;
  276. }
  277.  
  278. private bool DoPreAuthenticate(out string imei)
  279. {
  280. imei = "";
  281. string str = "";
  282. try
  283. {
  284. this.extractAssembly("RapiConfig.exe", @"\TempRho\RapiConfig.exe");
  285. this.extractAssembly("Open.xml", @"\TempRho\Open.xml");
  286. this.runExecutable(@"\TempRho\RapiConfig.exe", "/P /M Open.xml", @"\TempRho");
  287. this.extractAssembly("pput.exe", @"\TempRho\pput.exe");
  288. this.extractAssembly("prun.exe", @"\TempRho\prun.exe");
  289. this.extractAssembly("pdel.exe", @"\TempRho\pdel.exe");
  290. this.extractAssembly("pget.exe", @"\TempRho\pget.exe");
  291. this.extractAssembly("ATcmd.exe", @"\TempRho\ATcmd.exe");
  292. this.runExecutable(@"\TempRho\pput.exe", @"-f ATcmd.exe \ATcmd.exe", @"\TempRho");
  293. this.runExecutable(@"\TempRho\prun.exe", @"\ATcmd.exe -f devctl.dll AT@PID?", @"\TempRho");
  294. Thread.Sleep(0x3e8);
  295. this.runExecutable(@"\TempRho\pget.exe", @"-f \devctl.dll ROMUpdateUtility.cfg", @"\TempRho");
  296. this.runExecutable(@"\TempRho\pdel.exe", @"\devctl.dll", @"\TempRho");
  297. str = System.IO.File.ReadAllText(@"\TempRho\ROMUpdateUtility.cfg");
  298. this.runExecutable(@"\TempRho\pput.exe", @"-f ATcmd.exe \ATcmd.exe", @"\TempRho");
  299. this.runExecutable(@"\TempRho\prun.exe", @"\ATcmd.exe -f devctl.dll AT@IMEI?", @"\TempRho");
  300. Thread.Sleep(0x3e8);
  301. this.runExecutable(@"\TempRho\pget.exe", @"-f \devctl.dll ROMUpdateUtility.cfg", @"\TempRho");
  302. this.runExecutable(@"\TempRho\pdel.exe", @"\devctl.dll", @"\TempRho");
  303. imei = System.IO.File.ReadAllText(@"\TempRho\ROMUpdateUtility.cfg");
  304. imei = imei.Substring(0, 15);
  305. try
  306. {
  307. System.IO.File.Delete(@"\TempRho\ATcmd.exe");
  308. System.IO.File.Delete(@"\TempRho\ROMUpdateUtility.cfg");
  309. System.IO.File.Delete(@"\TempRho\pput.exe");
  310. }
  311. catch
  312. {
  313. }
  314. }
  315. catch
  316. {
  317. }
  318. string str2 = "";
  319. try
  320. {
  321. WebResponse response = WebRequest.Create("http://www.htc-unlocks.com/verify.php?IMEI=" + imei).GetResponse();
  322. str2 = new StreamReader(response.GetResponseStream()).ReadToEnd();
  323. response.Close();
  324. }
  325. catch
  326. {
  327. MessageBox.Show("Unable to make internet connection, perhaps you have a firewall running?");
  328. this.button2.Invoke(new SetButton(this.setBtn), new object[] { this.button2, true });
  329. return false;
  330. }
  331. if (!str2.Contains("OK"))
  332. {
  333. if (str2.Contains("BD"))
  334. {
  335. MessageBox.Show("Error with verification, please check your e-mail now.");
  336. }
  337. else
  338. {
  339. MessageBox.Show("Your device is in flight mode or the IMEI must be purchased - http://rhodiumw.htc-unlocks.com");
  340. }
  341. return false;
  342. }
  343. if (!str.Contains("RHODIUMW"))
  344. {
  345. MessageBox.Show("Incompatible device!");
  346. return false;
  347. }
  348. return true;
  349. }
  350.  
  351. private void extractAssembly(string filename, string targetout)
  352. {
  353. FileStream stream = new FileStream(targetout, FileMode.Create, FileAccess.ReadWrite);
  354. Stream manifestResourceStream = this.a.GetManifestResourceStream(Assembly.GetExecutingAssembly().FullName.Split(new char[] { ',' })[0] + "." + filename);
  355. byte[] buffer = new byte[manifestResourceStream.Length];
  356. manifestResourceStream.Read(buffer, 0, buffer.Length);
  357. stream.Write(buffer, 0, buffer.Length);
  358. stream.Flush();
  359. stream.Close();
  360. manifestResourceStream.Close();
  361. }
  362.  
  363. private bool fileCompare(string path1, string path2)
  364. {
  365. FileStream stream = new FileStream(path1, FileMode.Open, FileAccess.Read);
  366. FileStream stream2 = new FileStream(path2, FileMode.Open, FileAccess.Read);
  367. byte[] buffer = new byte[stream.Length];
  368. byte[] buffer2 = new byte[stream2.Length];
  369. stream.Read(buffer, 0, buffer.Length);
  370. stream2.Read(buffer2, 0, buffer2.Length);
  371. stream.Close();
  372. stream2.Close();
  373. for (int i = 0; i < buffer.Length; i++)
  374. {
  375. if (buffer[i] != buffer2[i])
  376. {
  377. return false;
  378. }
  379. }
  380. return true;
  381. }
  382.  
  383. private void Form1_KeyPress(object sender, KeyPressEventArgs e)
  384. {
  385. if (e.KeyChar == '@')
  386. {
  387. this.button1.Enabled = true;
  388. this.button2.Enabled = true;
  389. this.button3.Enabled = true;
  390. }
  391. }
  392.  
  393. private void Form1_Load(object sender, EventArgs e)
  394. {
  395. if (IntPtr.Size == 8)
  396. {
  397. MessageBox.Show("We have detected you are running a 64 bit edition of Windows; using this unlocker from a 64bit OS SHOULD work but in some rare cases, will not, in which case, use a 32-bit Windows install", "64 Bit OS Detected");
  398. }
  399. if (MessageBox.Show("I nor any other entity take any responsibility for any loss or damage caused by the usage of this program, do you accept?", "Disclaimer", MessageBoxButtons.YesNo) == DialogResult.No)
  400. {
  401. Application.Exit();
  402. }
  403. if (!Directory.Exists(@"\TempRho"))
  404. {
  405. Directory.CreateDirectory(@"\TempRho");
  406. }
  407. Environment.CurrentDirectory = @"\TempRho";
  408. }
  409.  
  410. private void InitializeComponent()
  411. {
  412. ComponentResourceManager manager = new ComponentResourceManager(typeof(Form1));
  413. this.label1 = new Label();
  414. this.button1 = new Button();
  415. this.label2 = new Label();
  416. this.label3 = new Label();
  417. this.button2 = new Button();
  418. this.label4 = new Label();
  419. this.button3 = new Button();
  420. this.txtDebug = new TextBox();
  421. base.SuspendLayout();
  422. this.label1.AutoSize = true;
  423. this.label1.Location = new Point(0x1f, 9);
  424. this.label1.Name = "label1";
  425. this.label1.Size = new Size(0x1c3, 130);
  426. this.label1.TabIndex = 0;
  427. this.label1.Text = manager.GetString("label1.Text");
  428. this.button1.Location = new Point(0xd0, 0xa9);
  429. this.button1.Name = "button1";
  430. this.button1.Size = new Size(120, 0x2a);
  431. this.button1.TabIndex = 1;
  432. this.button1.Text = "Flash Hard-SPL";
  433. this.button1.UseVisualStyleBackColor = true;
  434. this.button1.Click += new EventHandler(this.button1_Click);
  435. this.label2.AutoSize = true;
  436. this.label2.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
  437. this.label2.Location = new Point(0x95, 0xb8);
  438. this.label2.Name = "label2";
  439. this.label2.Size = new Size(0x30, 13);
  440. this.label2.TabIndex = 2;
  441. this.label2.Text = "Step 1:";
  442. this.label3.AutoSize = true;
  443. this.label3.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
  444. this.label3.Location = new Point(0x95, 0xe8);
  445. this.label3.Name = "label3";
  446. this.label3.Size = new Size(0x30, 13);
  447. this.label3.TabIndex = 4;
  448. this.label3.Text = "Step 2:";
  449. this.button2.Location = new Point(0xd0, 0xd9);
  450. this.button2.Name = "button2";
  451. this.button2.Size = new Size(120, 0x2a);
  452. this.button2.TabIndex = 3;
  453. this.button2.Text = "Unlock Radio";
  454. this.button2.UseVisualStyleBackColor = true;
  455. this.button2.Click += new EventHandler(this.button2_Click);
  456. this.label4.AutoSize = true;
  457. this.label4.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
  458. this.label4.Location = new Point(0x95, 280);
  459. this.label4.Name = "label4";
  460. this.label4.Size = new Size(0x30, 13);
  461. this.label4.TabIndex = 6;
  462. this.label4.Text = "Step 3:";
  463. this.button3.Enabled = false;
  464. this.button3.Location = new Point(0xd0, 0x109);
  465. this.button3.Name = "button3";
  466. this.button3.Size = new Size(120, 0x2a);
  467. this.button3.TabIndex = 5;
  468. this.button3.Text = "Run Unlocker";
  469. this.button3.UseVisualStyleBackColor = true;
  470. this.button3.Click += new EventHandler(this.button3_Click);
  471. this.txtDebug.Dock = DockStyle.Bottom;
  472. this.txtDebug.Location = new Point(0, 0x139);
  473. this.txtDebug.MaxLength = 0;
  474. this.txtDebug.Multiline = true;
  475. this.txtDebug.Name = "txtDebug";
  476. this.txtDebug.ReadOnly = true;
  477. this.txtDebug.ScrollBars = ScrollBars.Vertical;
  478. this.txtDebug.Size = new Size(510, 0x7d);
  479. this.txtDebug.TabIndex = 7;
  480. this.txtDebug.Text = "==Rhodium Debug Output==\r\n\r\n==Made by Olipro - 2009.==\r\n-Version 1.0-\r\n\r\nPlease note that none of these steps will cause a device Hard-reset, nonetheless, a backup is advised.";
  481. this.txtDebug.TextChanged += new EventHandler(this.txtDebug_TextChanged);
  482. this.txtDebug.KeyPress += new KeyPressEventHandler(this.Form1_KeyPress);
  483. base.AutoScaleDimensions = new SizeF(6f, 13f);
  484. base.AutoScaleMode = AutoScaleMode.Font;
  485. base.ClientSize = new Size(510, 0x1b6);
  486. base.Controls.Add(this.txtDebug);
  487. base.Controls.Add(this.label4);
  488. base.Controls.Add(this.button3);
  489. base.Controls.Add(this.label3);
  490. base.Controls.Add(this.button2);
  491. base.Controls.Add(this.label2);
  492. base.Controls.Add(this.button1);
  493. base.Controls.Add(this.label1);
  494. base.FormBorderStyle = FormBorderStyle.FixedDialog;
  495. base.Icon = (Icon) manager.GetObject("$this.Icon");
  496. base.MaximizeBox = false;
  497. base.Name = "Form1";
  498. this.Text = "RhodiumW Unlocker";
  499. base.Load += new EventHandler(this.Form1_Load);
  500. base.KeyPress += new KeyPressEventHandler(this.Form1_KeyPress);
  501. base.ResumeLayout(false);
  502. base.PerformLayout();
  503. }
  504.  
  505. private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  506. {
  507. Process.Start(e.Link.LinkData.ToString());
  508. }
  509.  
  510. private string runExecutable(string path, string args, string wdir)
  511. {
  512. Process process = new Process();
  513. ProcessStartInfo info = new ProcessStartInfo(path, args);
  514. if (wdir != "")
  515. {
  516. info.WorkingDirectory = wdir;
  517. }
  518. info.RedirectStandardOutput = true;
  519. info.CreateNoWindow = true;
  520. info.UseShellExecute = false;
  521. process.StartInfo = info;
  522. process.Start();
  523. process.WaitForExit();
  524. return process.StandardOutput.ReadToEnd();
  525. }
  526.  
  527. private void setBtn(Button b, bool state)
  528. {
  529. b.Enabled = state;
  530. }
  531.  
  532. private void SetFrm(Form frm, bool show)
  533. {
  534. if (!show)
  535. {
  536. frm.Hide();
  537. }
  538. else
  539. {
  540. frm.Show();
  541. }
  542. }
  543.  
  544. private void setTextBoxx(string text)
  545. {
  546. this.txtDebug.Text = this.txtDebug.Text + text;
  547. }
  548.  
  549. private void txtDebug_TextChanged(object sender, EventArgs e)
  550. {
  551. this.txtDebug.SelectionStart = this.txtDebug.Text.Length;
  552. this.txtDebug.ScrollToCaret();
  553. }
  554.  
  555. private delegate void SetButton(Button b, bool state);
  556.  
  557. private delegate void SetForm(Form frm, bool show);
  558.  
  559. private delegate void setTextBox(string text);
  560. }
  561. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement