Пример #1
0
        private void SetMemoryDomain(string name)
        {
            _currentDomain = MemoryDomains[name];
            _bigEndian     = MemoryDomains[name].EndianType == MemoryDomain.Endian.Big;

            MaximizeAddressBox.SetHexProperties(_currentDomain.Size);
            TieBreaker1Box.SetHexProperties(_currentDomain.Size);
            TieBreaker2Box.SetHexProperties(_currentDomain.Size);
            TieBreaker3Box.SetHexProperties(_currentDomain.Size);
        }
Пример #2
0
        private bool CanStart()
        {
            if (!ControlProbabilities.Any(cp => cp.Value > 0))
            {
                return(false);
            }

            if (!MaximizeAddressBox.ToRawInt().HasValue)
            {
                return(false);
            }

            if (FrameLengthNumeric.Value == 0)
            {
                return(false);
            }

            return(true);
        }
Пример #3
0
        private void SetupControlsAndProperties()
        {
            MaximizeAddressBox.SetHexProperties(_currentDomain.Size);
            TieBreaker1Box.SetHexProperties(_currentDomain.Size);
            TieBreaker2Box.SetHexProperties(_currentDomain.Size);
            TieBreaker3Box.SetHexProperties(_currentDomain.Size);

            StartFromSlotBox.SelectedIndex = 0;

            const int starty       = 0;
            const int lineHeight   = 30;
            const int marginLeft   = 15;
            int       accumulatedy = 0;
            int       count        = 0;

            ControlProbabilityPanel.SuspendLayout();
            ControlProbabilityPanel.Controls.Clear();
            foreach (var button in Emulator.ControllerDefinition.BoolButtons)
            {
                var control = new BotControlsRow
                {
                    ButtonName  = button,
                    Probability = 0.0,
                    Location    = new Point(marginLeft, starty + accumulatedy),
                    TabIndex    = count + 1,
                    ProbabilityChangedCallback = AssessRunButtonStatus
                };
                control.Scale(UIHelper.AutoScaleFactor);

                ControlProbabilityPanel.Controls.Add(control);
                accumulatedy += lineHeight;
                count++;
            }
            ControlProbabilityPanel.ResumeLayout();

            if (Settings.RecentBotFiles.AutoLoad)
            {
                LoadFileFromRecent(Settings.RecentBotFiles.MostRecent);
            }

            UpdateBotStatusIcon();
        }