private void cmddecodeWiredStr_Click(object sender, EventArgs e) { string data = this.txtWiredStr.Text.Trim(); StringBuilder sb = new StringBuilder(); if (data != null || data != String.Empty) { try { while (data.Length != 0) { int val = MikeUtils.decodeVL64(data); string valStr = MikeUtils.encodeVL64(val); sb.Append("[" + valStr + "=" + val.ToString() + "] "); data = data.Substring(valStr.Length); } this.txtWiredStr.Text = sb.ToString(); } catch (Exception ex) { MessageBox.Show("error decoding vl64 string. " + ex.Message); } } }
private void protocol(string data) { try { string header = data.Substring(1, 2); string body = data.Substring(2); switch (header) { #region Crypto case "AQ": case "AP": if (LemonEnvironment.cryptoActive) { return; } // Client key LemonEnvironment.clientKey = body.Substring(5); // Make sure we have the keys from the haxswf - otherwise we'll get a null ref while (LemonEnvironment.decPublicKey == null || LemonEnvironment.encPublicKey == null) { ; } // Send the client key LemonEnvironment.mainWnd.SendClientKey(); Thread.Sleep(600); // send our own key data = "_R" + MikeUtils.encodeB64(LemonEnvironment.encPublicKey) + LemonEnvironment.encPublicKey; data = "@" + MikeUtils.encodeB64(data) + data; // Once again, make sure we've got a key to init decryption with // otherwise we'll get a null ref while (LemonEnvironment.sharedKeyDec == null) { ; } LemonEnvironment.RC4D = new Crypto.MikeCrypto(HexEncoding.GetBytes(LemonEnvironment.sharedKeyDec), LemonEnvironment.padding2); break; #endregion default: break; } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } server.Send(data); }
private void cmdB64DecodeStr_Click(object sender, EventArgs e) { string data = this.txtB64Str.Text.Trim(); if (data.Length < 2) { return; } this.txtB64Str.Text = MikeUtils.decodeB64(data.Substring(0, 2)).ToString(); }
private void cmdWiredIntEncode_Click(object sender, EventArgs e) { try { int toEncode = int.Parse(this.txtWiredInt.Text.ToString()); this.txtWiredInt.Text = MikeUtils.encodeVL64(toEncode); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void cmdB64Int_Click(object sender, EventArgs e) { try { int toEncode = int.Parse(this.txtB64Int.Text); this.txtB64Int.Text = MikeUtils.encodeB64(toEncode); } catch (Exception ex) { MessageBox.Show("Invalid integer entered [" + ex.Message + "]"); } }
public HabboLogin(string hotel, string mail, string pass) { this.url = "https://www.habbo." + hotel + "/account/submit"; this.redirectUrl = "https://www.habbo." + hotel + "/identity/useOrCreateAvatar"; this.hotel = hotel; // Account for special characters (people with symbols, other charsets e.g spain!) this.email = HttpUtility.UrlEncodeUnicode(mail); this.password = HttpUtility.UrlEncodeUnicode(pass); this.JSESSIONID = MikeUtils.GenerateRandom() + ".resin-fe-6"; // hax this.loginThread = new Thread(new ThreadStart(this.start)); this.loginThread.Start(); }
private void cmdSendServer_Click(object sender, EventArgs e) { LemonEnvironment.tcp.GetMainConnection.Server.Send("@" + MikeUtils.encodeB64(this.txtSend.Text) + this.txtSend.Text); }
private void cmdB64Str_Click(object sender, EventArgs e) { string toEncode = this.txtB64Str.Text; this.txtB64Str.Text = MikeUtils.encodeB64(toEncode) + toEncode; }