Ejemplo n.º 1
0
        private void SearchButton_Click(object sender, EventArgs e)
        {
            MemoryStart.Text = MemoryStart.Text.PadLeft(8, '0');
            MemorySize.Text  = MemorySize.Text.PadLeft(8, '0');
            uint StartAddress = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(MemoryStart.Text).Reverse().ToArray(), 0);
            uint EndAddress   = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(TextEndAddress.Text).Reverse().ToArray(), 0);

            if (!MemoryRange.Text.Equals("All") && (!IsValidMemoryAddress(StartAddress) || !IsValidMemoryAddress(EndAddress)))
            {
                NTRConnection.SetCurrentOperationText = "Invalid start address or size!";
                return;
            }
            SearchButton.Enabled = ControlEnabledSearchButton = ControlEnabledDataType = ControlEnabledMemoryRange = false;
            ThreadEventDispatcher.CurrentSelectedDataType   = DataTypeExactTool.GetValue(ComboDataType.SelectedItem.ToString());
            ThreadEventDispatcher.CurrentSelectedSearchType = SearchTypeBaseTool.GetValue(ComboSearchType.SelectedItem.ToString());
            ThreadEventDispatcher.CurrentMemoryRange        = this.MemoryRange.Text;
            ThreadEventDispatcher.DispatchSearch            = true;
        }
Ejemplo n.º 2
0
        private void ComboSearchType_SelectedValueChanged(object sender, EventArgs e)
        {
            string CurrentDataType = ComboDataType.SelectedItem == null ? null : ComboDataType.SelectedItem.ToString();

            switch (SearchTypeBaseTool.GetValue(ComboSearchType.SelectedItem.ToString()))
            {
            case SearchTypeBase.Exact:
                ComboDataType.Items.Clear();
                ComboDataType.Items.AddRange(DataTypeExactTool.GetValues());
                SearchValue.Width    = 286;
                SearchValue2.Visible = LabelDash.Visible = false;
                break;

            case SearchTypeBase.Range:
                ComboDataType.Items.Clear();
                ComboDataType.Items.AddRange(DataTypeNumericTool.GetValues());
                SearchValue.Width    = 136;
                SearchValue2.Visible = LabelDash.Visible = true;
                break;

            case SearchTypeBase.IncreasedBy:
            case SearchTypeBase.DecreasedBy:
            case SearchTypeBase.Increased:
            case SearchTypeBase.Decreased:
            case SearchTypeBase.Unknown:
                ComboDataType.Items.Clear();
                ComboDataType.Items.AddRange(DataTypeNumericTool.GetValues());
                SearchValue.Width    = 286;
                SearchValue2.Visible = LabelDash.Visible = false;
                break;
            }
            if (CurrentDataType != null && ComboDataType.Items.Contains(CurrentDataType))
            {
                ComboDataType.SelectedIndex = ComboDataType.Items.IndexOf(CurrentDataType);
                ComboDataType.SelectedItem  = ComboDataType.SelectedValue = CurrentDataType;
            }
            else
            {
                ComboDataType.SelectedIndex = 0;
                ComboDataType.SelectedItem  = ComboDataType.SelectedValue = ComboDataType.Items[0];
            }
        }