Beispiel #1
0
        static void Main(string[] args)
        {
            string[] validArgs = { "all", "full", "chrome", "firefox", "-p", "edge" };

            bool   getChrome      = false;
            bool   getFireFox     = false;
            bool   getEdge        = false;
            string masterPassword = "";

            if (args.Length == 0)
            {
                Usage();
                return;
            }

            // Parse the arguments.
            for (int i = 0; i < args.Length; i++)
            {
                // Valid arg!
                string arg = args[i].ToLower();
                if (Array.IndexOf(validArgs, arg) != -1)
                {
                    if (arg == "all" || arg == "full")
                    {
                        getChrome  = true;
                        getEdge    = true;
                        getFireFox = true;
                    }
                    else if (arg == "chrome")
                    {
                        getChrome = true;
                    }
                    else if (arg == "firefox")
                    {
                        getFireFox = true;
                    }
                    else if (arg == "edge")
                    {
                        getEdge = true;
                    }
                    else if (arg == "-p")
                    {
                        masterPassword = args[i + 1];
                    }
                }
            }

            if (!getChrome && !getEdge && !getFireFox)
            {
                Usage();
                return;
            }

            if (getChrome)
            {
                Chrome.GetLogins();
            }

            if (getFireFox)
            {
                if (masterPassword != "")
                {
                    FireFox.GetLogins(masterPassword);
                }
                else
                {
                    FireFox.GetLogins();
                }
            }

            if (getEdge)
            {
                Edge.GetLogins();
            }
        }