Ejemplo n.º 1
0
        private void TsFullClient_OnErrorEvent(object sender, CommandError e)
        {
            switch (e.Id)
            {
            case Ts3ErrorCode.whisper_no_targets:
                stallNoErrorCount = 0;
                isStall           = true;
                break;

            case Ts3ErrorCode.client_could_not_validate_identity:
                if (ts3FullClientData.IdentityLevel == "auto")
                {
                    int targetSecLevel = int.Parse(e.ExtraMessage);
                    Log.Write(Log.Level.Info, "Calculating up to required security level: {0}", targetSecLevel);
                    Ts3Crypt.ImproveSecurity(identity, targetSecLevel);
                    ts3FullClientData.IdentityOffset = identity.ValidKeyOffset;

                    ConnectClient();
                }
                else
                {
                    Log.Write(Log.Level.Warning, "The server reported that the security level you set is not high enough." +
                              "Increase the value to \"{0}\" or set it to \"auto\" to generate it on demand when connecting.", e.ExtraMessage);
                }
                break;

            default:
                Log.Write(Log.Level.Debug, e.ErrorFormat());
                break;
            }
        }
Ejemplo n.º 2
0
        public override void Connect()
        {
            // get or compute identity
            if (string.IsNullOrEmpty(ts3FullClientData.Identity))
            {
                identity = Ts3Crypt.GenerateNewIdentity();
                ts3FullClientData.Identity       = identity.PrivateKeyString;
                ts3FullClientData.IdentityOffset = identity.ValidKeyOffset;
            }
            else
            {
                identity = Ts3Crypt.LoadIdentity(ts3FullClientData.Identity, ts3FullClientData.IdentityOffset);
            }
            // check required security level
            Ts3Crypt.ImproveSecurity(identity, ts3FullClientData.IdentityLevel);
            ts3FullClientData.IdentityOffset = identity.ValidKeyOffset;

            // get or compute password
            if (!string.IsNullOrEmpty(ts3FullClientData.ServerPassword) &&
                ts3FullClientData.ServerPasswordAutoHash &&
                !ts3FullClientData.ServerPasswordIsHashed)
            {
                ts3FullClientData.ServerPassword         = Ts3Crypt.HashPassword(ts3FullClientData.ServerPassword);
                ts3FullClientData.ServerPasswordIsHashed = true;
            }

            tsFullClient.QuitMessage     = QuitMessages[Util.Random.Next(0, QuitMessages.Length)];
            tsFullClient.OnErrorEvent   += TsFullClient_OnErrorEvent;
            tsFullClient.OnDisconnected += TsFullClient_OnDisconnected;
            ConnectClient();
        }
Ejemplo n.º 3
0
        public string Connect(string Name = "FaCeBoTt", string Url = "c0d1n6.io")
        {
            Console.WriteLine(Url);

            ConnectionDataFull Join = new ConnectionDataFull();


            Join.Address = Url;

            //Join.Identity = Ts3Crypt.LoadIdentity(id, ulong.Parse("97698842"));
            Join.Identity = Ts3Crypt.GenerateNewIdentity();

            Join.Username = Name;
            Join.HWID     = "C**k 7";


            client.Connect(Join);

            while (client.status == Ts3FullClient.Ts3ClientStatus.Connecting)
            {
            }


            if (client.Connected)
            {
                SetDefaultAvatar();
                return("Ok");
            }
            else
            {
                return("Error!");
            }
        }
Ejemplo n.º 4
0
        static void Main()
        {
            //Ts3Crypt.Test();

            //return;
            var clients = new List <Ts3FullClient>();

            //for (int i = 0; i < 50; i++)
            {
                var client = new Ts3FullClient(EventDispatchType.AutoThreadPooled);
                client.OnConnected           += Client_OnConnected;
                client.OnDisconnected        += Client_OnDisconnected;
                client.OnErrorEvent          += Client_OnErrorEvent;
                client.OnTextMessageReceived += Client_OnTextMessageReceived;
                var data = Ts3Crypt.LoadIdentity("MCkDAgbAAgEgAiBPKKMIrHtAH/FBKchbm4iRWZybdRTk/ZiehtH0gQRg+A==", 64, 0);
                con = new ConnectionDataFull()
                {
                    Address = "127.0.0.1", Username = "******", Identity = data, Password = "******", VersionSign = VersionSign.VER_WIN_3_1_7
                };
                client.Connect(con);
                clients.Add(client);
            }

            Console.WriteLine("End");
            Console.ReadLine();
        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.ProcessExit += new EventHandler(CurrentDomain_ProcessExit);
            Console.CancelKeyPress += (s, e) =>
            {
                if (e.SpecialKey == ConsoleSpecialKey.ControlC)
                {
                    e.Cancel = true;
                    Dispose();
                }
            };
            LoadConfig(cfgfile);
            client.QuitMessage     = cfg[gen]["QuitMessage"];
            client.OnConnected    += OnConnected;
            client.OnDisconnected += OnDisconnected;
            client.OnErrorEvent   += OnErrorEvent;
            con = new ConnectionDataFull
            {
                Address     = cfg[gen]["Address"],
                Username    = cfg[gen]["NickName"],
                VersionSign = VersionSign.VER_WIN_3_1_8
            };
            var id = Ts3Crypt.LoadIdentityDynamic(cfg[gen]["Identity"]).Unwrap();

            Console.WriteLine("ID: {0}", id.PrivateKeyString);
            con.Identity = id;
            //Console.WriteLine("Connecting to {0} as \"{1}\" (UID: {2})", client.ConnectionData.Address, con.Username, con.Identity.ClientUid);
            client.Connect(con);
        }
Ejemplo n.º 6
0
        static void LoadConfig(string file)
        {
            var parser = new FileIniDataParser();

            if (!File.Exists(file))
            {
                cfg = new IniData();
                var g = cfg[gen]; var c = cfg[chan]; var p = cfg[perm];
                g["QuitMessage"]     = "Dynamic Channel Creator by Bluscream";
                g["Address"]         = string.Empty;
                g["NickName"]        = string.Empty;
                g["Identity"]        = Ts3Crypt.GenerateNewIdentity().PrivateKeyString;
                g["Public Channels"] = "";
                g["Start Count"]     = "1";
                g["Min Clients In Each Existing Channel For New Channel"] = "1";
                c["Description"]        = "";
                c["Name"]               = "";
                c["Phonetic name"]      = "";
                c["Topic"]              = "";
                c["Codec"]              = "";
                c["Codec quality"]      = "10";
                c["Codec latency"]      = "";
                c["Codec latency"]      = "";
                c["Password"]           = "";
                c["Delete delay"]       = "";
                c["Max clients"]        = "";
                c["Max family clients"] = "";
                c["type"]               = "permanent";
                p["i_icon_id"]          = "0";
                parser.WriteFile(file, cfg);
                Console.WriteLine("\"{0}\" created. Edit it and restart the bot!", file);
                Dispose();
            }
            cfg = parser.ReadFile(cfgfile);
        }
Ejemplo n.º 7
0
 private void UpdateIndentityToSecurityLevel(int targetLevel)
 {
     if (Ts3Crypt.GetSecurityLevel(identity) < targetLevel)
     {
         Log.Info("Calculating up to required security level: {0}", targetLevel);
         Ts3Crypt.ImproveSecurity(identity, targetLevel);
         ts3FullClientData.IdentityOffset = identity.ValidKeyOffset;
     }
 }
Ejemplo n.º 8
0
 private void UpdateIndentityToSecurityLevel(int targetLevel)
 {
     if (Ts3Crypt.GetSecurityLevel(identity) < targetLevel)
     {
         Log.Info("Calculating up to required security level: {0}", targetLevel);
         Ts3Crypt.ImproveSecurity(identity, targetLevel);
         config.Connect.Identity.Offset.Value = identity.ValidKeyOffset;
     }
 }
Ejemplo n.º 9
0
        public override void Connect()
        {
            // get or compute identity
            if (string.IsNullOrEmpty(ts3FullClientData.Identity))
            {
                identity = Ts3Crypt.GenerateNewIdentity();
                ts3FullClientData.Identity       = identity.PrivateKeyString;
                ts3FullClientData.IdentityOffset = identity.ValidKeyOffset;
            }
            else
            {
                var identityResult = Ts3Crypt.LoadIdentityDynamic(ts3FullClientData.Identity, ts3FullClientData.IdentityOffset);
                if (!identityResult.Ok)
                {
                    Log.Error("The identity from the config file is corrupted. Remove it to generate a new one next start; or try to repair it.");
                    return;
                }
                identity = identityResult.Value;
                if (ts3FullClientData.Identity != identity.PrivateKeyString)
                {
                    ts3FullClientData.Identity = identity.PrivateKeyString;
                }
                if (ts3FullClientData.IdentityOffset != identity.ValidKeyOffset)
                {
                    ts3FullClientData.IdentityOffset = identity.ValidKeyOffset;
                }
            }

            // check required security level
            if (ts3FullClientData.IdentityLevel == "auto")
            {
            }
            else if (int.TryParse(ts3FullClientData.IdentityLevel, out int targetLevel))
            {
                UpdateIndentityToSecurityLevel(targetLevel);
            }
            else
            {
                Log.Warn("Invalid value for QueryConnection::IdentityLevel, enter a number or \"auto\".");
            }

            // get or compute password
            if (!string.IsNullOrEmpty(ts3FullClientData.ServerPassword) &&
                ts3FullClientData.ServerPasswordAutoHash &&
                !ts3FullClientData.ServerPasswordIsHashed)
            {
                ts3FullClientData.ServerPassword         = Ts3Crypt.HashPassword(ts3FullClientData.ServerPassword);
                ts3FullClientData.ServerPasswordIsHashed = true;
            }

            tsFullClient.QuitMessage     = QuitMessages[Util.Random.Next(0, QuitMessages.Length)];
            tsFullClient.OnErrorEvent   += TsFullClient_OnErrorEvent;
            tsFullClient.OnConnected    += TsFullClient_OnConnected;
            tsFullClient.OnDisconnected += TsFullClient_OnDisconnected;
            ConnectClient();
        }
Ejemplo n.º 10
0
 public void Connect()
 {
     _conn = new ConnectionDataFull()
     {
         Hostname = "almanalex.de",
         Port     = 9987,
         Username = "******",
         Identity = Ts3Crypt.GenerateNewIdentity(15),
     };
     _ts.Connect(_conn);
 }
Ejemplo n.º 11
0
        private static void InitTS()
        {
            var identityData = Ts3Crypt.DeobfuscateAndImportTs3Identity(config.Secret.TSIdentity);

            if (!string.IsNullOrEmpty(identityData.Error))
            {
                Console.WriteLine(identityData.Error);
            }
            else
            {
                connectionData = new ConnectionDataFull()
                {
                    Identity = identityData.Unwrap()
                };

                if (!string.IsNullOrEmpty(config.Secret.TSAddress))
                {
                    connectionData.Address = config.Secret.TSAddress;
                }

                if (!string.IsNullOrEmpty(config.Secret.TSServerPassword))
                {
                    connectionData.ServerPassword = config.Secret.TSServerPassword;
                }

                if (!string.IsNullOrEmpty(config.Secret.TSUsername))
                {
                    connectionData.Username = config.Secret.TSUsername;
                }

                if (!string.IsNullOrEmpty(config.Secret.TSDefaultChannel))
                {
                    connectionData.DefaultChannel = config.Secret.TSDefaultChannel;
                }

                if (!string.IsNullOrEmpty(config.Secret.TSDefaultChannelPassword))
                {
                    connectionData.DefaultChannelPassword = config.Secret.TSDefaultChannelPassword;
                }

                client                    = new Ts3FullClient(EventDispatchType.AutoThreadPooled);
                client.OnConnected       += client_OnConnected;
                client.OnDisconnected    += client_OnDisconnected;
                client.OnErrorEvent      += client_OnErrorEvent;
                client.OnEachTextMessage += client_OnEachTextMessage;
                client.OnClientEnterView += Client_OnClientEnterView;

                client.OnEachClientMoved += Client_OnEachClientMoved;

                client.Connect(connectionData);
            }
        }
Ejemplo n.º 12
0
 public void Connect(MainWindow sender)
 {
     mainwindow = sender;
     con        = new ConnectionDataFull()
     {
         Hostname = Properties.Settings.Default.ip,
         Port     = Properties.Settings.Default.port,
         Username = Properties.Settings.Default.nickname,
         Identity = Ts3Crypt.GenerateNewIdentity(8),
         Password = Properties.Settings.Default.password
     };
     client.Connect(con);
 }
Ejemplo n.º 13
0
        public override void Connect()
        {
            // get or compute identity
            if (string.IsNullOrEmpty(ts3FullClientData.Identity))
            {
                identity = Ts3Crypt.GenerateNewIdentity();
                ts3FullClientData.Identity       = identity.PrivateKeyString;
                ts3FullClientData.IdentityOffset = identity.ValidKeyOffset;
            }
            else
            {
                identity = Ts3Crypt.LoadIdentity(ts3FullClientData.Identity, ts3FullClientData.IdentityOffset);
            }

            // check required security level
            if (ts3FullClientData.IdentityLevel == "auto")
            {
            }
            else if (int.TryParse(ts3FullClientData.IdentityLevel, out int targetLevel))
            {
                if (Ts3Crypt.GetSecurityLevel(identity) < targetLevel)
                {
                    Log.Info("Calculating up to required security level: {0}", targetLevel);
                    Ts3Crypt.ImproveSecurity(identity, targetLevel);
                    ts3FullClientData.IdentityOffset = identity.ValidKeyOffset;
                }
            }
            else
            {
                Log.Warn("Invalid value for QueryConnection::IdentityLevel, enter a number or \"auto\".");
            }


            // get or compute password
            if (!string.IsNullOrEmpty(ts3FullClientData.ServerPassword) &&
                ts3FullClientData.ServerPasswordAutoHash &&
                !ts3FullClientData.ServerPasswordIsHashed)
            {
                ts3FullClientData.ServerPassword         = Ts3Crypt.HashPassword(ts3FullClientData.ServerPassword);
                ts3FullClientData.ServerPasswordIsHashed = true;
            }

            tsFullClient.QuitMessage     = QuitMessages[Util.Random.Next(0, QuitMessages.Length)];
            tsFullClient.OnErrorEvent   += TsFullClient_OnErrorEvent;
            tsFullClient.OnDisconnected += TsFullClient_OnDisconnected;
            ConnectClient();
        }
Ejemplo n.º 14
0
        static void Main()
        {
            var client = new Ts3FullClient(EventDispatchType.ExtraDispatchThread);

            client.OnConnected           += Client_OnConnected;
            client.OnDisconnected        += Client_OnDisconnected;
            client.OnErrorEvent          += Client_OnErrorEvent;
            client.OnTextMessageReceived += Client_OnTextMessageReceived;
            var data = Ts3Crypt.LoadIdentity("MG8DAgeAAgEgAiEAqNonGuL0w/8kLlgLbl4UkH8DQQJ7fEu1tLt+mx1E+XkCIQDgQoIGcBVvAvNoiDT37iWbPQb2kYe0+VKLg67OH2eQQwIgTyijCKx7QB/xQSnIW5uIkVmcm3UU5P2YnobR9IEEYPg=", 64, 0);

            con = new ConnectionDataFull()
            {
                Hostname = "127.0.0.1", Port = 9987, Username = "******", Identity = data, Password = "******"
            };
            client.Connect(con);
            Console.WriteLine("End");
            Console.ReadLine();
        }
Ejemplo n.º 15
0
        public E <string> Connect()
        {
            // get or compute identity
            var identityConf = config.Connect.Identity;

            if (string.IsNullOrEmpty(identityConf.PrivateKey))
            {
                identity = Ts3Crypt.GenerateNewIdentity();
                identityConf.PrivateKey.Value = identity.PrivateKeyString;
                identityConf.Offset.Value     = identity.ValidKeyOffset;
            }
            else
            {
                var identityResult = Ts3Crypt.LoadIdentityDynamic(identityConf.PrivateKey.Value, identityConf.Offset.Value);
                if (!identityResult.Ok)
                {
                    Log.Error("The identity from the config file is corrupted. Remove it to generate a new one next start; or try to repair it.");
                    return("Corrupted identity");
                }
                identity = identityResult.Value;
                identityConf.PrivateKey.Value = identity.PrivateKeyString;
                identityConf.Offset.Value     = identity.ValidKeyOffset;
            }

            // check required security level
            if (identityConf.Level.Value >= 0 && identityConf.Level.Value <= 160)
            {
                UpdateIndentityToSecurityLevel(identityConf.Level.Value);
            }
            else if (identityConf.Level.Value != -1)
            {
                Log.Warn("Invalid config value for 'Level', enter a number between '0' and '160' or '-1' to adapt automatically.");
            }
            config.SaveWhenExists();

            reconnectCounter         = 0;
            lastReconnect            = null;
            tsFullClient.QuitMessage = QuitMessages[Util.Random.Next(0, QuitMessages.Length)];
            ClearAllCaches();
            return(ConnectClient());
        }
        public static ChannelCreated ChannelCreate(Ts3FullClient cli, string name, string password, string neededTP, string phoname)
        {
            var cmd = new Ts3Command("channelcreate", new List <ICommandPart>()
            {
                new CommandParameter("channel_name", name),
                new CommandParameter("channel_password", Ts3Crypt.HashPassword(password)),
                new CommandParameter("channel_needed_talk_power", neededTP),
                new CommandParameter("channel_name_phonetic", phoname)
            });
            var createdchan = cli.SendSpecialCommand(cmd, NotificationType.ChannelCreated).Notifications.Cast <ChannelCreated>();

            foreach (var chan in createdchan)
            {
                Console.WriteLine("#{0} CID: {1} CNAME: {2}", cli.ClientId, chan.ChannelId, chan.Name);
                if (chan.Name == name)
                {
                    return(chan);
                }
            }
            return(null);
        }
Ejemplo n.º 17
0
        static void Main3(string[] args)
        {
            // Initialize client
            var client = new Ts3FullClient(EventDispatchType.AutoThreadPooled);
            var data   = Ts3Crypt.LoadIdentity("MCkDAgbAAgEgAiBPKKMIrHtAH/FBKchbm4iRWZybdRTk/ZiehtH0gQRg+A==", 64, 0).Unwrap();

            //var data = Ts3Crypt.GenerateNewIdentity();
            con = new ConnectionDataFull()
            {
                Address = "pow.splamy.de", Username = "******", Identity = data
            };

            // Setup audio
            client
            // Save cpu by not processing the rest of the pipe when the
            // output is not read.
            .Chain <CheckActivePipe>()
            // This reads the packet meta data, checks for packet order
            // and manages packet merging.
            .Chain <AudioPacketReader>()
            // Teamspeak sends audio encoded. This pipe will decode it to
            // simple PCM.
            .Chain <DecoderPipe>()
            // This will merge multiple clients talking into one audio stream
            .Chain <ClientMixdown>()
            // Reads from the ClientMixdown buffer with a fixed timing
            .Into <PreciseTimedPipe>(x => x.Initialize(new SampleInfo(48_000, 2, 16)))
            // Reencode to the codec of our choice
            .Chain(new EncoderPipe(Codec.OpusMusic))
            // Define where to send to.
            .Chain <StaticMetaPipe>(x => x.SetVoice())
            // Send it with our client.
            .Chain(client);

            // Connect
            client.Connect(con);
        }
Ejemplo n.º 18
0
        private void TsFullClient_OnDisconnected(object sender, DisconnectEventArgs e)
        {
            if (e.Error != null)
            {
                var error = e.Error;
                switch (error.Id)
                {
                case Ts3ErrorCode.client_could_not_validate_identity:
                    if (ts3FullClientData.IdentityLevel == "auto")
                    {
                        int targetSecLevel = int.Parse(error.ExtraMessage);
                        Log.Info("Calculating up to required security level: {0}", targetSecLevel);
                        Ts3Crypt.ImproveSecurity(identity, targetSecLevel);
                        ts3FullClientData.IdentityOffset = identity.ValidKeyOffset;

                        ConnectClient();
                        return;                         // skip triggering event, we want to reconnect
                    }
                    else
                    {
                        Log.Warn("The server reported that the security level you set is not high enough." +
                                 "Increase the value to \"{0}\" or set it to \"auto\" to generate it on demand when connecting.", error.ExtraMessage);
                    }
                    break;

                default:
                    Log.Warn("Could not connect: {0}", error.ErrorFormat());
                    break;
                }
            }
            else
            {
                Log.Debug("Bot disconnected. Reason: {0}", e.ExitReason);
            }

            OnBotDisconnect?.Invoke(this, new EventArgs());
        }
Ejemplo n.º 19
0
        private void TsFullClient_OnErrorEvent(object sender, CommandError e)
        {
            switch (e.Id)
            {
            case Ts3ErrorCode.whisper_no_targets:
                stallNoErrorCount = 0;
                isStall           = true;
                break;

            case Ts3ErrorCode.client_could_not_validate_identity:
                autoReconnectOnce = true;
                int targetSecLevel = int.Parse(e.ExtraMessage);
                Log.Write(Log.Level.Info, "Calculating up to required security level: {0}", targetSecLevel);
                Ts3Crypt.ImproveSecurity(identity, targetSecLevel);
                ts3FullClientData.IdentityOffset = identity.ValidKeyOffset;

                tsFullClient.Disconnect();
                break;

            default:
                Log.Write(Log.Level.Debug, e.ErrorFormat());
                break;
            }
        }
        static void Main()
        {
            AppDomain.CurrentDomain.ProcessExit += new EventHandler(CurrentDomain_ProcessExit);
            clients  = new List <Ts3FullClient>();
            channels = File.ReadAllLines(chanfile);
            var parser = new FileIniDataParser();

            cfg = parser.ReadFile(cfgfile);
            RandomNick rndnick = new RandomNick();

            rndnick.Init();
            TSSettings.OpenDB();
            Console.CancelKeyPress += (s, e) => {
                if (e.SpecialKey == ConsoleSpecialKey.ControlC)
                {
                    e.Cancel = true;
                    Dispose();
                    Environment.Exit(0);
                }
            };
            con.Address  = cfg["general"]["Address"];
            con.Password = cfg["general"]["ServerPassword"];
            ownerUID     = cfg["general"]["OwnerUID"];

            /*
             * adminCGID = uint.Parse(cfg["general"]["adminCGID"]);
             * modCGID = uint.Parse(cfg["general"]["modCGID"]);
             * banCGID = uint.Parse(cfg["general"]["banCGID"]);
             */
            if (!File.Exists(idfile))
            {
                using (File.Create(idfile)) { }
            }
            ids = File.ReadAllLines(idfile);
            for (int i = 0; i < channels.Length; i++)
            {
                if (isExit)
                {
                    return;
                }
                con.Username = rndnick.GetRandomNick();                 //cfg["general"]["Nickname"];
                var client = new Ts3FullClient(EventDispatchType.DoubleThread);
                client.OnConnected           += OnConnected;
                client.OnDisconnected        += OnDisconnected;
                client.OnErrorEvent          += OnErrorEvent;
                client.OnTextMessageReceived += OnTextMessageReceived;
                client.OnClientMoved         += OnClientMoved;
                client.OnClientEnterView     += OnClientEnterView;
                var          _identity = ids.Select(x => x.Split(',')).ToList();
                IdentityData ID;
                try {
                    ID = Ts3Crypt.LoadIdentity(_identity[i][0], ulong.Parse(_identity[i][1]));
                    if (i > 0)
                    {
                        Thread.Sleep(int.Parse(cfg["general"]["ConnectSleepMS"]));
                    }
                } catch (Exception) {
                    ID = Ts3Crypt.GenerateNewIdentity(int.Parse(cfg["general"]["MinLVL"]));
                    File.AppendAllText(idfile, ID.PrivateKeyString + "," + ID.ValidKeyOffset + "\r\n");
                }
                Console.WriteLine("#" + i + " UID: " + ID.ClientUid);
                con.Identity = ID;
                //Array values = Enum.GetValues(typeof(VersionSign));
                //Random random = new Random();
                //con.VersionSign = (VersionSign)values.GetValue(random.Next(values.Length));
                //var t = typeof(VersionSign).GetFields();
                con.VersionSign = VersionSign.VER_WIN_3_UNKNOWN;
                //con.VersionSign = new VersionSign("YaTQA-3.9pre [Build: 32503680000]", "ServerQuery", String.Empty);
                con.HWID = $"{Clientlib.RandomString(32)},{Clientlib.RandomString(32)}";
                Console.WriteLine("#" + i + " HWID: " + con.HWID);
                client.Connect(con);
                clients.Add(client);
            }
            AntiAFK = new Timer(OnTick, "on", 114 * 10000, 114 * 10000);
            Console.WriteLine("End");
            Console.ReadLine();
            Dispose();
        }
Ejemplo n.º 21
0
 public static Password FromPlain(string pass) => new Password(Ts3Crypt.HashPassword(pass));
Ejemplo n.º 22
0
 public string CommandHashPassword(ExecutionInformation info, string pw)
 {
     return(Ts3Crypt.HashPassword(pw));
 }
Ejemplo n.º 23
0
 public void VersionSelfCheck()
 {
     Ts3Crypt.VersionSelfCheck();
 }
Ejemplo n.º 24
0
        public static void Main()
        {
            foreach (var ver in vers.Skip(0))
            {
                Ts3Server serv = null;
                Process   ts3  = null;
                try
                {
                    serv = new Ts3Server();
                    serv.Listen(new IPEndPoint(IPAddress.Any, 9987));
                    // http://ftp.4players.de/pub/hosted/ts3/updater-images/client/
                    // .\CAnydate.exe C:\TS\Any http://files.teamspeak-services.com/updater-images/client/1516349129 win32

                    Process anyd = new Process()
                    {
                        StartInfo = new ProcessStartInfo
                        {
                            FileName  = @"C:\TS\CAnydate.exe",
                            Arguments = $@"C:\TS\Any http://ftp.4players.de/pub/hosted/ts3/updater-images/client/{ver} win32"
                        }
                    };
                    anyd.Start();
                    anyd.WaitForExit();

                    ts3 = new Process()
                    {
                        StartInfo = new ProcessStartInfo
                        {
                            FileName = @"C:\TS\Any\ts3client_win32.exe",
                        }
                    };
                    ts3.Start();

                    for (int i = 0; i < 240; i++)
                    {
                        if (serv.Init)
                        {
                            break;
                        }
                        Thread.Sleep(1000);
                    }

                    if (!serv.Init)
                    {
                        Console.WriteLine("ERR! {0}", ver);
                        File.WriteAllText("sign.out", $"ERR! {ver}");
                        continue;
                    }
                }
                catch (Exception)
                {
                }
                finally
                {
                    try
                    {
                        ts3?.Kill();
                    }
                    catch { }
                    serv?.Dispose();
                }
            }

            //var crypt = new Ts3Crypt();
            //crypt.Test();
            //return;

            var clients = new List <Ts3FullClient>();

            //for (int i = 0; i < 50; i++)
            {
                var client = new Ts3FullClient(EventDispatchType.AutoThreadPooled);
                client.OnConnected       += Client_OnConnected;
                client.OnDisconnected    += Client_OnDisconnected;
                client.OnErrorEvent      += Client_OnErrorEvent;
                client.OnEachTextMessage += Client_OnTextMessageReceived;
                var data = Ts3Crypt.LoadIdentity("MCkDAgbAAgEgAiBPKKMIrHtAH/FBKchbm4iRWZybdRTk/ZiehtH0gQRg+A==", 64, 0);
                var con  = new ConnectionDataFull()
                {
                    Address = "127.0.0.1", Username = "******", Identity = data.Unwrap(), ServerPassword = "******", VersionSign = VersionSign.VER_WIN_3_1_8
                };
                client.Connect(con);
                clients.Add(client);
            }

            Console.WriteLine("End");
            Console.ReadLine();
        }