public EditValueWindow(SearchEntry editEntry, MemoryProcess targetProcess)
        {
            TargetEntry   = editEntry;
            TargetProcess = targetProcess;

            InitializeComponent();

            ValueLabel.Content       = "Value (" + editEntry.ValueTypeString + ")";
            ValueTextBox.Text        = editEntry.Value;
            FrozenCheckBox.IsChecked = editEntry.Frozen;
        }
Beispiel #2
0
        private void OutputSearchEntry(FileStream fs, SearchEntry entry)
        {
            byte[] addressData     = BitConverter.GetBytes(entry.OriginalAddress);
            byte[] valueData       = ASCIIEncoder.GetBytes(entry.Value);
            byte[] valueDataLength = BitConverter.GetBytes((int)valueData.Length);

            fs.WriteByte(entry.Frozen ? (byte)0x01 : (byte)0x00);
            fs.WriteByte((byte)entry.ValueType);
            fs.Write(addressData, 0, addressData.Length);
            fs.Write(valueDataLength, 0, valueDataLength.Length);
            fs.Write(valueData, 0, valueData.Length);
        }
Beispiel #3
0
        private void UpdateSearchEntryFrozen(SearchEntry en)
        {
            byte[] write = SearchTypeConverter.ParseInputToByteArray(en.Value, en.ValueType);
            if (write.Length <= 0)
            {
                return;                 //failed to parse, no messagebox to avoid spam
            }
            if (en.ValueType == SearchType.String)
            {
                List <byte> strList = write.ToList();
                strList.Add((byte)0x00);
                write = strList.ToArray();
            }

            SelectedProcess.WriteBuffer(en.OriginalAddress, write);
        }
Beispiel #4
0
        private void AddressListDataGridRow_DoubleClick(object sender, EventArgs e)
        {
            if (AddressListDataGrid.SelectedItems.Count < 1)
            {
                return;
            }

            if (!ProcessSelected())
            {
                return;
            }

            SearchEntry     entry     = (SearchEntry)AddressListDataGrid.SelectedItem;
            EditValueWindow valWindow = new EditValueWindow(entry, SelectedProcess);

            valWindow.ShowDialog();
            AddressListDataGrid.Items.Refresh();
        }
Beispiel #5
0
        private void SearchResultDataGridRow_DoubleClick(object sender, EventArgs e)
        {
            if (SearchResultDataGrid.SelectedItems.Count < 1)
            {
                return;
            }

            SearchEntry entry = (SearchEntry)SearchResultDataGrid.SelectedItem;

            foreach (SearchEntry se in AddressListDataGrid.Items)
            {
                if (entry.Address == se.Address)
                {
                    return;                     //already exists
                }
            }
            AddressListDataGrid.Items.Add(entry);
        }
Beispiel #6
0
        private void WindowProcessTimer_Tick(object sender, EventArgs e)
        {
            if (!ProcessSelected())
            {
                EnableControls(false);
                return;
            }

            if (Searcher.IsSearching())
            {
                SearchProgressBar.Value = (double)Searcher.GetSearchPercentage() * 100.0;
                EnableControls(false);
                WasSearching = true;
                return;
            }

            if (WasSearching)
            {
                EnableControls(true);
                SearchProgressBar.Value = 100;
                SearchResultDataGrid.Items.Clear();
                WasSearching = false;
                TimerTick    = 4;
                MemorySearchResult res = Searcher.GetLastResult();
                foreach (UInt64 addy in res.Addresses)
                {
                    SearchEntry entry = new SearchEntry()
                    {
                        OriginalAddress = addy, Address = addy.ToString("X8"), Value = "", ValueType = CurrentSearchType, Frozen = false,
                        ValueTypeString = SearchTypeConverter.SearchTypeStrings[(int)CurrentSearchType]
                    };
                    SearchResultDataGrid.Items.Add(entry);
                }
            }

            TimerTick++;
            if (TimerTick % 5 == 0)
            {
                UpdateInfoDataGrid(SearchResultDataGrid);
                TimerTick = 1;
            }
            UpdateInfoDataGrid(AddressListDataGrid);
        }
Beispiel #7
0
        private bool UpdateSearchEntry(SearchEntry en)
        {
            string outValue = en.Value;

            switch (en.ValueType)
            {
            case SearchType.Int8:
                outValue = SelectedProcess.ReadByte(en.OriginalAddress).ToString();
                break;

            case SearchType.Int16:
                outValue = SelectedProcess.ReadInt16(en.OriginalAddress).ToString();
                break;

            case SearchType.Int32:
                outValue = SelectedProcess.ReadInt32(en.OriginalAddress).ToString();
                break;

            case SearchType.Int64:
                outValue = SelectedProcess.ReadInt64(en.OriginalAddress).ToString();
                break;

            case SearchType.Float:
                outValue = SelectedProcess.ReadFloat(en.OriginalAddress).ToString();
                break;

            case SearchType.Double:
                outValue = SelectedProcess.ReadDouble(en.OriginalAddress).ToString();
                break;

            case SearchType.String:
                outValue = SelectedProcess.ReadStringToEnd(en.OriginalAddress);
                break;
            }
            bool ret = outValue != en.Value;

            en.Value = outValue;
            return(ret);
        }