Esempio n. 1
0
 private void Forward_Click(object sender, RoutedEventArgs e)
 {
     GetInput FBTN = new GetInput();
     string var = FBTN.Show("Forward Messages", "Enter steamID (STEAM_0:0:00000000) of the account the below", false);
     FBTN.Close();
     SteamTwoProperties.jsonSetting.forwardSetting = var;
     SteamTwoProperties.updateSettingFile();
     updateGUI();
 }
Esempio n. 2
0
        //change pass key button pressed
        private void changeKeyClicked()
        {
            GetInput GI = new GetInput();
            string temp = GI.Show("Encryption", "Please enter the passkey below", false);
            GI.Close();
            MainWindow.setEncryptionKey(temp);
            MainWindow.writeAccountData();

        }
Esempio n. 3
0
        static void OnLoggedOn(SteamUser.LoggedOnCallback callback)
        {
            bool isSteamGuard = callback.Result == EResult.AccountLogonDenied;
            bool is2FA        = callback.Result == EResult.AccountLoginDeniedNeedTwoFactor;

            if (isSteamGuard || is2FA)
            {
                Console.WriteLine("This account is SteamGuard protected!");

                if (is2FA)
                {
                    Application.Current.Dispatcher.Invoke((Action) delegate
                    {
                        //Console.Write("Please enter your 2 factor auth code from your authenticator app: ");
                        // MainWindow.currentHandle.Show();
                        GetInput GI   = new GetInput();
                        twoFactorAuth = GI.Show("Authentication", "Please enter your 2 factor auth code from your authenticator app below", false);
                        GI.Close();
                    });
                }
                else
                {
                    Application.Current.Dispatcher.Invoke((Action) delegate
                    {
                        //Console.Write("Please enter the auth code sent to the email at {0}: ", callback.EmailDomain);
                        //MainWindow.currentHandle.Show();
                        GetInput GI = new GetInput();
                        authCode    = GI.Show("Authentication", "Please enter the auth code sent to the email at " + callback.EmailDomain, false);
                        GI.Close();
                    });
                }

                return;
            }

            if (callback.Result != EResult.OK)
            {
                Console.WriteLine("Unable to logon to Steam: {0} / {1}", callback.Result, callback.ExtendedResult);

                isRunning = false;
                return;
            }

            Console.WriteLine("Successfully logged on!");
            loggedIn = true;
            // at this point, we'd be able to perform actions on Steam
        }
Esempio n. 4
0
 //gets password and checks if its the right passwords
 private void setupEncryptionKey(int attempts, String discriptionText)
 {
     if (encrypted)
     {
         if (attempts <= 2)
         {
             GetInput GI   = new GetInput();
             String   temp = GI.Show("Encryption", discriptionText, true);
             GI.Close();
             if (temp != "-1" && SteamTwo.Cryptography.Encrypt(DEFUALT_KEY, temp).Equals(SteamTwoProperties.jsonSetting.encryptedKeySetting))
             {
                 encryptionKey = temp;
             }
             else
             {
                 attempts++;
                 discriptionText = "Encryption key is invalid, enter a valid encryption key";
                 setupEncryptionKey(attempts, discriptionText);
             }
         }
         else
         {
             if (SteamTwoProperties.jsonSetting.badAttemptSetting)
             {
                 SteamTwoProperties.jsonSetting.encryptedSetting    = false;
                 SteamTwoProperties.jsonSetting.encryptedKeySetting = DEFUALT_KEY_TEST;
                 Properties.Settings.Default.Save();
                 encryptionKey = DEFUALT_KEY;
                 File.Delete(SAVE_FILE_NAME);
                 System.Windows.Forms.MessageBox.Show("Encryption key will reset back to defualt key and previous account details will be deleted.", "Encryption", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
             }
             else
             {
                 Environment.Exit(0);
             }
         }
     }
     else
     {
         encryptionKey = DEFUALT_KEY;
     }
 }