Example #1
0
        private void AccountPanelTimer_Tick(object sender, EventArgs e)
        {
            string botOnline = Others.GetRequest("http://tech.thenoobbot.com/auth.php", "botOnline=true");

            if (LoginServer.IsFreeVersion)
            {
                int timeLeftSec = (LoginServer.StartTime + 1000 * 60 * 20) - Others.Times;
                AccountName.Text = LoginServer.Login;
                TimeLeft.Text    = Others.SecToHour(timeLeftSec / 1000);
                OnlineBot.Text   = botOnline;
            }
            else
            {
                string timeLeft = Others.GetReqWithAuthHeader("http://tech.thenoobbot.com/auth.php?TimeSubscription=true", LoginServer.Login, LoginServer.Password)[0];
                AccountName.Text           = LoginServer.Login;
                TimeLeft.Text              = timeLeft;
                OnlineBot.Text             = nManager.Translate.Get(nManager.Translate.Id.OnlineBots) + " " + botOnline;
                AccountPanelTimer.Interval = 5000;
            }
            if (Remote.RemoteActive)
            {
                RemoteSessionInfo.Text = nManager.Translate.Get(nManager.Translate.Id.SessionInfo) + " " + Remote.SessionKey;
            }
            else
            {
                RemoteSessionInfo.Text = "";
            }
        }
Example #2
0
        private static string Decrypt(string cipherString, int random)
        {
            try
            {
                const string UrlWebServer     = "http://tech.thenoobbot.com/";
                const string ScriptServerMyIp = UrlWebServer + "myIp.php";

                // KeyDecrypt
                string ip         = Others.GetRequest(ScriptServerMyIp, "null=null").Replace(".", "");
                int    keyDecrypt = 0;
                for (int i = 0; i <= ip.Length - 1; i++)
                {
                    if (ip[i].ToString(CultureInfo.InvariantCulture) == "0" || ip[i].ToString(CultureInfo.InvariantCulture) == "1" ||
                        ip[i].ToString(CultureInfo.InvariantCulture) == "2" ||
                        ip[i].ToString(CultureInfo.InvariantCulture) == "3" || ip[i].ToString(CultureInfo.InvariantCulture) == "4" ||
                        ip[i].ToString(CultureInfo.InvariantCulture) == "5" ||
                        ip[i].ToString(CultureInfo.InvariantCulture) == "6" || ip[i].ToString(CultureInfo.InvariantCulture) == "7" ||
                        ip[i].ToString(CultureInfo.InvariantCulture) == "8" ||
                        ip[i].ToString(CultureInfo.InvariantCulture) == "9")
                    {
                        keyDecrypt += Others.ToInt32(ip[i].ToString(CultureInfo.InvariantCulture));
                    }
                }


                string[]    listByteS = cipherString.Split(' ');
                List <byte> retList   = new List <byte>();
                foreach (string s in listByteS)
                {
                    try
                    {
                        if (s != string.Empty)
                        {
                            retList.Add(Convert.ToByte(Convert.ToInt64(s) - keyDecrypt - (random * 2)));
                        }
                    }
                    catch (Exception e)
                    {
                        Logging.WriteError("DVFrezfDFSESFfdgvbd#1: " + e);
                    }
                }

                return(new UTF8Encoding().GetString(retList.ToArray()));
            }
            catch (Exception e)
            {
                Logging.WriteError("DVFrezfDFSESFfdgvbd#2: " + e);
            }
            return("");
        }
Example #3
0
 private static bool ServerIsOnline()
 {
     try
     {
         string resultReq = Others.GetRequest(Others.GetMonitoringScriptLink, "null=null");
         if (resultReq != null)
         {
             if (resultReq.Count() < 10)
             {
                 if (resultReq == "true")
                 {
                     return(true);
                 }
             }
         }
     }
     catch (Exception e)
     {
         Logging.WriteError("FDSfzefDSVSVFEFsdfsfvzs: " + e);
     }
     return(false);
 }
Example #4
0
        internal static void LoadScript()
        {
            try
            {
                const string httpAddress = "http://tech.thenoobbot.com/script.php";
                string       sr;
                int          random = Others.Random(0, 5000);
                try
                {
                    string srCrypted = Others.GetRequest(httpAddress, "r=" + random);
                    if (srCrypted.Replace(" ", "") == "")
                    {
                        Logging.WriteError("grzGRDSFfezfsgfvsdg server.");
                        return;
                    }
                    sr = Decrypt(srCrypted, random);
                    if (sr.Replace(" ", "") == string.Empty)
                    {
                        Logging.WriteError("grzGRDSFfezfsgfvsdg decrypt.");
                        return;
                    }
                }
                catch (Exception e)
                {
                    Logging.WriteError("grzGRDSFfezfsgfvsdg#1: " + e);
                    return;
                }


                _instanceFromOtherAssembly = null;
                _assembly = null;
                _obj      = null;


                CodeDomProvider      cc         = new CSharpCodeProvider();
                CompilerParameters   cp         = new CompilerParameters();
                IEnumerable <string> assemblies = AppDomain.CurrentDomain
                                                  .GetAssemblies()
                                                  .Where(
                    a =>
                    !a.IsDynamic &&
                    !a.CodeBase.Contains((Process.GetCurrentProcess().ProcessName + ".exe")))
                                                  .Select(a => a.Location);
                cp.ReferencedAssemblies.AddRange(assemblies.ToArray());
                string          toCompile = sr;
                CompilerResults cr        = cc.CompileAssemblyFromSource(cp, toCompile);
                if (cr.Errors.HasErrors)
                {
                    //String text = cr.Errors.Cast<CompilerError>().Aggregate("Compilator Error :\n", (current, err) => current + (err + "\n"));
                    //MessageBox.Show(text);
                    return;
                }

                _assembly = cr.CompiledAssembly;

                _obj = _assembly.CreateInstance("Main", true);
                _instanceFromOtherAssembly = _obj as IScriptOnlineManager;


                if (_instanceFromOtherAssembly != null)
                {
                    _instanceFromOtherAssembly.Initialize();
                }
                //else
                //Logging.WriteError("grzGRDSFfezfsgfvsdg error");
            }
            catch /*(Exception e)*/
            {
                //Logging.WriteError("grzGRDSFfezfsgfvsdg#2: " + e);
            }
        }
Example #5
0
        private static void CheckUpdateThread()
        {
            try
            {
// ReSharper disable ConditionIsAlwaysTrueOrFalse
                if (Others.EncrypterMD5(Information.Version) == "5006678f64f53edfaa26f2587c559d1e")
                {
// ReSharper restore ConditionIsAlwaysTrueOrFalse
                    return;
                }
#pragma warning disable 162
// ReSharper disable HeuristicUnreachableCode
                string resultReq = Others.GetRequest(Others.GetUpdateScriptLink, "null=null");
                Application.DoEvents();
                if (resultReq != null)
                {
                    if (resultReq.Count() < 100 && resultReq.Any())
                    {
                        if (resultReq != Information.Version)
                        {
                            string       resultDesc = Others.GetRequest(Others.GetUpdateScriptLink, "show=desc");
                            string       resultLog  = Others.GetRequest(Others.GetUpdateScriptLink, "show=changelog");
                            DialogResult dr         =
                                MessageBox.Show(
                                    string.Format("{0}{1}{4}{4}{2}{4}{3}{4}{5}", Translate.Get(Translate.Id.LatestUpdateVersion), resultReq,
                                                  Translate.Get(Translate.Id.LatestUpdateDescription), resultDesc, Environment.NewLine, Translate.Get(Translate.Id.ConfirmUpdate)),
                                    Translate.Get(Translate.Id.LatestUpdateTitle), MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                            switch (dr)
                            {
                            case DialogResult.Yes:
                                Others.OpenWebBrowserOrApplication(resultLog);
                                Others.OpenWebBrowserOrApplication("http://thenoobbot.com/downloads/latest.php");

                                try
                                {
                                    foreach (
                                        Process process in
                                        Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName))
                                    {
                                        if (process.Id != Process.GetCurrentProcess().Id)
                                        {
                                            process.Kill();
                                        }
                                    }
                                }
                                catch
                                {
                                }
                                EndInformation();
                                break;

                            case DialogResult.No:
                                break;
                            }
                        }
                    }
                }
// ReSharper restore HeuristicUnreachableCode
#pragma warning restore 162
            }
            catch /*(Exception e)*/
            {
                //Logging.WriteError("LoginServer > CheckUpdateThread(): " + e);
            }
        }