Exemple #1
0
        private static void Parse0x3A(ClientSocket cs, Receiver receiver)
        {
            Int32 accountResponse = receiver.GetInt32();

            switch (accountResponse)
            {
            case 0x000:
                cs.FirstJoin = true;
                //sets logged on variables
                ConnectedBar.AddOne();
                //confirm logon packet
                Builder builder = new Builder();
                builder.InsertNTString(cs.AccountName);
                builder.InsertByte(0);
                builder.SendPacket(cs, 0x0A);
                //send join to targeted channel
                Send0x0C(cs);
                break;

            case 0x001:
                //account doesnt exist. create account
                Send0x3D(cs);
                break;

            case 0x002:
                //logon failed. generate random name, create account and so on
                cs.AccountName = RandomName();
                Send0x3D(cs);
                break;

            default:
                Chat.Add(Color.Wheat, "Unhandled 0x3A code." + NewLine);
                break;
            }
        }
Exemple #2
0
        //r/ enter commands here
        private static void CommandBots(ClientSocket cs, string message)
        {
            string lowercaseMessage = message.ToLower();

            //5 in length or longer commands
            if (lowercaseMessage.Length > 4)
            {
                if (lowercaseMessage.Substring(0, 4) == "say ")
                {
                    Builder builder = new Builder();
                    builder.InsertNTString(message.Substring(4));
                    builder.SendPacket(cs, 0x0E);
                    return;
                }
                if (lowercaseMessage.Substring(0, 4) == "mov ")
                {
                    //change target
                    UserSettings.TargetChannel = message.Substring(4);
                    //send join
                    Builder builder = new Builder();
                    builder.InsertNTString("/join " + message.Substring(4));
                    builder.SendPacket(cs, 0x0E);
                    return;
                }
            }

            if (message == "online")
            {
                Builder builder = new Builder();
                builder.InsertNTString("We are " + ConnectedBar.ReturnConnected() + " of " + ConnectedBar.ReturnConfigured());
                builder.SendPacket(cs, 0x0E);
                return;
            }

            if (message == "bark")
            {
                Builder builder = new Builder();
                builder.InsertNTString("Woof");
                builder.SendPacket(cs, 0x0E);
                return;
            }

            if (message == "roll over")
            {
                Builder builder = new Builder();
                builder.InsertNTString("/me rolls over");
                builder.SendPacket(cs, 0x0E);
                return;
            }

            if (message == "who's a good bot?")
            {
                Builder builder = new Builder();
                builder.InsertNTString("I am, I'm a good bot!");
                builder.SendPacket(cs, 0x0E);
                return;
            }
        }
Exemple #3
0
 private void Form1_Load(object sender, EventArgs e)
 {
     UserSettings.GenerateSettings();
     GeneratedSettings.SetFilePaths();
     GeneratedSettings.SetHashFiles();
     Chat.SetRichTextBox(this.chatBox);
     Proxies.ImportProxylist();
     CDKeys.ImportCdKeys();
     ConnectedBar.Reference(this.labelConnectedForecolor);
 }
Exemple #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            //no keys, dont proceed

            int keyCount   = CDKeys.ReturnListCount();
            int proxyCount = Proxies.ReturnListCount();

            if (keyCount == 0)
            {
                Chat.Add(Color.Yellow, "No cdkeys. Connection stopped." + Environment.NewLine);
                return;
            }
            if (proxyCount == 0)
            {
                Chat.Add(Color.Yellow, "No proxies. Connection stopped." + Environment.NewLine);
                return;
            }

            //determine max number of socks allowed
            int socks      = UserSettings.MaxClients;
            int perProxy   = UserSettings.ClientsPerProxy;
            int maxSockets = (perProxy * proxyCount);

            if (socks > maxSockets)
            {
                socks = maxSockets;
            }

            if (socks > keyCount)
            {
                socks = keyCount;
            }

            if (socks == 0)
            {
                Chat.Add(Color.Yellow, "Bot count cannot be zero. Connection stopped." + Environment.NewLine);
                return;
            }

            if (!GeneratedSettings.ConstructHeaders(UserSettings.ServerName))
            {
                Chat.Add(Color.Yellow, "Could not validate server. Connection stopped." + Environment.NewLine);
                return;
            }

            GeneratedSettings.BotActive = true;

            ConnectedBar.SetTotalSockets(socks);

            Chat.Add(Color.White, "Loading " + socks + " sockets." + Environment.NewLine);

            SocketActions.SpawnAndConnectClients(socks);
        }
Exemple #5
0
 internal static void DisconnectClient(ClientSocket cs)
 {
     cs.StopTiming();
     ConnectedBar.RemoveOne(cs);
     cs.Channel     = string.Empty;
     cs.LoggedOn    = false;
     cs.ServerToken = 0;
     cs.ClientToken = 0;
     cs.PacketBuffer.ResetBuffer();
     try
     {
         cs._socket.Close();
     }
     catch { }
 }