Exemplo n.º 1
0
        private static void MessageReceived(string message)
        {
            string requestedAction = message.Split('[', ']')[1];

            message = message.Replace(String.Format("[{0}]", requestedAction), "");

            switch (requestedAction.ToLower())
            {
            case "get":
                SetCookieContainer(false);
                break;

            case "set":
                if (File.Exists(message))
                {
                    using (Stream fileStream = File.OpenRead(message))
                    {
                        BinaryFormatter formatter = new BinaryFormatter();
                        CookieContainer = (CookieContainer)formatter.Deserialize(fileStream);
                    }

                    File.Delete(message);
                }
                else
                {
                    ByteGuardHelper.ThrowException(new FileNotFoundException("The specified file could not be found."));
                }
                break;

            case "setid":
                Hwid = message;
                break;
            }
        }
Exemplo n.º 2
0
        public static void InitializeByteGuard()
        {
            try
            {
                // TODO: Enable
                Hwid            = GetHwid();
                CookieContainer = GetCookieContainer();

                GetDecryptionKey();

                if (DecryptionKey == null)
                {
                    Environment.Exit(0);
                }
            }
            catch (Exception ex)
            {
                ByteGuardHelper.ThrowException(ex);
            }
        }