namespace HabboRC4_V24Release { using System; using System.Text; public class Habbo_V24_Crypto { private int ᙄ; private int ᙃ; private int[] ᙅ = new int[0x100]; private int[] 4AAAA = new int[0x100]; private string[] 5AAA1 = new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F" }; private string 6AAAA = "1wz8rzgiv87708l9oi7ot8l9smdqv5yvzz8tavkyuoi9p3kgrrq7r5p53kchnb5hly8jkfx5hsoo6imx8o5ktczwdst8dooa7r331wkrw8zi8789io89mq5vztvyo93gr755khbhyjf5soixokcws8oar3wr"; private int 7AAA1 = 0x11; public Habbo_V24_Crypto() { this.initCalculators(); this.init(); this.premixTable(this.6AAAA, this.7AAA1); } public string deciphper(string data) { StringBuilder builder = new StringBuilder(data.Length); int num = 0; int num2 = 0; for (int i = 0; i < data.Length; i += 2) { this.ᙃ = (this.ᙃ + 1) % 0x100; this.ᙄ = (this.ᙄ + this.4AAAA[this.ᙃ]) % 0x100; num = this.4AAAA[this.ᙃ]; this.4AAAA[this.ᙃ] = this.4AAAA[this.ᙄ]; this.4AAAA[this.ᙄ] = num; num2 = this.4AAAA[(this.4AAAA[this.ᙃ] + this.4AAAA[this.ᙄ]) % 0x100]; num = Convert.ToInt32(this.JavaSubstring(data, i, i + 2), 0x10); builder = builder.Append((char) (num ^ num2)); } return builder.ToString(); } public string encipher(string data) { StringBuilder builder = new StringBuilder(data.Length * 2); int num = 0; int num2 = 0; for (int i = 0; i < data.Length; i++) { this.ᙃ = (this.ᙃ + 1) % 0x100; this.ᙄ = (this.ᙄ + this.4AAAA[this.ᙃ]) % 0x100; num = this.4AAAA[this.ᙃ]; this.4AAAA[this.ᙃ] = this.4AAAA[this.ᙄ]; this.4AAAA[this.ᙄ] = num; num2 = this.4AAAA[(this.4AAAA[this.ᙃ] + this.4AAAA[this.ᙄ]) % 0x100]; int num4 = data.Substring(i, 1).ToCharArray()[0] ^ num2; if (num4 <= 0) { builder.Append("00"); } else { builder.Append(this.5AAA1[(num4 >> 4) & 15]); builder.Append(this.5AAA1[num4 & 15]); } } return builder.ToString(); } private static string GenerateRandomString(int Length) { string str = ""; Random random = new Random(); for (int i = 0; i < Length; i++) { str = str + ((char) random.Next(0x41, 0x7a)).ToString(); } return str; } private void init() { for (int i = 0; i <= 0xfe; i++) { this.4AAAA[i] = i + 1; } this.4AAAA[0] = 0; this.4AAAA[0xff] = 1; } private void initCalculators() { this.ᙃ = 0; this.ᙄ = 0; } public string JavaSubstring(string dataIn, int start, int end) { return dataIn.Substring(start, end - start); } internal void premixTable(string datain, int count) { for (int i = 0; i < count; i++) { this.encipher(datain); } } public string rePremix() { int count = 10; string datain = GenerateRandomString(20); this.premixTable(datain, count); return ""; } } }