private void button_RSA_Click(object sender, EventArgs e) { if (!File.Exists("WzCrypto.dll")) { MessageBox.Show("WzCrypto.dll is missing, please place it in the executable directory."); return; } if (textBox_user.Equals(String.Empty) || textBox_RSA.Equals(String.Empty) || textBox_HWID.Equals(String.Empty)) { MessageBox.Show("Password, HWID or RSA cannot be empty!"); return; } else if (textBox_HWID.Text.Length != 21) { MessageBox.Show("Desired HWID length must be 21! To prevent banning, please also follow the format.."); return; } // Read PacketReader read = new PacketReader(ByteUtils.HexToBytes(textBox_RSA.Text)); // read.Skip(2); // Header int len = read.ReadShort(); byte[] RSAKey = read.ReadBytes(len); // Write StringBuilder sb = new StringBuilder("Header : "); sb.Append((int)SendOps.LOGIN); Packet packet = new Packet(SendOps.LOGIN); sb.Append(" User : "******" HWID : ").Append(textBox_HWID.Text); packet.WriteString(textBox_HWID.Text); packet.WriteHexAsBytes("00 00 00 00 00 00 A3 27 64 60 00 00 00 00 0E 92 00 00 00 00 02 00"); // packet.WriteHexAsBytes("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"); textBox_RSAOutput.Text = packet.ToPacketsString(); textBox_hwidoutputRead.Text = sb.ToString(); Properties.Settings.Default.hwid_acc = textBox_user.Text; Properties.Settings.Default.hwid_pass = textBox_password.Text; Properties.Settings.Default.hwid_default = textBox_HWID.Text; Properties.Settings.Default.Save(); }
public void WriteHexAsBytes(string hexString) { byte[] bytes = ByteUtils.HexToBytes(hexString); WriteBytes(bytes); }