private void NewScanButton_Click(object sender, EventArgs e)
        {
            this.TabControl.SelectedIndex = 2;
            this.ScanHistoryListBox.Items.Clear();
            this.ScanHistoryListBox.Items.Add((object)(this.ValueTextBox.Text + " " + this.ScanTypeComboBox.Text.ToLower()));
            this.ScanDataGridView.Rows.Clear();
            MemoryScanner.SCAN_TYPE type = MemoryScanner.StringToType(this.ScanTypeComboBox.Text);
            string str = MemoryScanner.TypeToString(type);

            byte[] numArray = (byte[])null;

            if (isSearchValueInvalid(type))
            {
                return;
            }

            Task.Factory.StartNew(() => searchMemeoryForValue(type, numArray, str));
        }
 public static uint GetTypeLength(string type)
 {
     return(MemoryScanner.GetTypeLength(MemoryScanner.StringToType(type)));
 }
        private void recheckSavedValues()
        {
            List <string[]> strArrayList = new List <string[]>();

            this.ScanProgressBar.Invoke(s => s.Maximum = this.ScanDataGridView.Rows.Count);
            this.ScanProgressBar.Invoke(s => s.Value   = 0);

            foreach (DataGridViewRow row in (IEnumerable)this.ScanDataGridView.Rows)
            {
                ulong uint64 = Convert.ToUInt64(row.Cells[0].Value.ToString().Replace("0x", ""), 16);
                MemoryScanner.SCAN_TYPE type = MemoryScanner.StringToType(row.Cells[1].Value.ToString());
                bool flag = false;
                switch (type)
                {
                case MemoryScanner.SCAN_TYPE.BYTE:
                    if ((int)this.ps4.ReadMemory(this.attachpid, uint64, 1)[0] ==
                        (int)Convert.ToByte(this.ValueTextBox.Text))
                    {
                        flag = true;
                        break;
                    }

                    break;

                case MemoryScanner.SCAN_TYPE.SHORT:
                    if ((int)BitConverter.ToInt16(this.ps4.ReadMemory(this.attachpid, uint64, 2), 0) ==
                        (int)Convert.ToUInt16(this.ValueTextBox.Text))
                    {
                        flag = true;
                        break;
                    }

                    break;

                case MemoryScanner.SCAN_TYPE.INTEGER:
                    if ((int)BitConverter.ToInt32(this.ps4.ReadMemory(this.attachpid, uint64, 4), 0) ==
                        (int)Convert.ToUInt32(this.ValueTextBox.Text))
                    {
                        flag = true;
                        break;
                    }

                    break;

                case MemoryScanner.SCAN_TYPE.LONG:
                    if ((long)BitConverter.ToInt64(this.ps4.ReadMemory(this.attachpid, uint64, 8), 0) ==
                        (long)Convert.ToUInt64(this.ValueTextBox.Text))
                    {
                        flag = true;
                        break;
                    }

                    break;

                case MemoryScanner.SCAN_TYPE.FLOAT:
                    if (BitConverter.ToSingle(ps4.ReadMemory(this.attachpid, uint64, 4), 0) ==
                        (double)Convert.ToSingle(this.ValueTextBox.Text))
                    {
                        flag = true;
                        break;
                    }

                    break;

                case MemoryScanner.SCAN_TYPE.DOUBLE:
                    if (BitConverter.ToDouble(this.ps4.ReadMemory(this.attachpid, uint64, 8), 0) ==
                        Convert.ToDouble(this.ValueTextBox.Text))
                    {
                        flag = true;
                        break;
                    }

                    break;
                }

                if (flag)
                {
                    string[] strArray = new string[3]
                    {
                        row.Cells[0].Value.ToString(),
                        row.Cells[1].Value.ToString(),
                        this.ValueTextBox.Text
                    };
                    strArrayList.Add(strArray);
                }

                this.ScanProgressBar.Invoke(s => s.Increment(1));
            }

            this.ScanDataGridView.Invoke(s => s.Rows.Clear());
            foreach (string[] strArray in strArrayList)
            {
                this.ScanDataGridView.Invoke(s => s.Rows.Add((object)strArray[0], (object)strArray[1], (object)strArray[2]));
            }
            this.ScanProgressBar.Invoke(s => s.Value = 0);
            reEnableInterfaceAfterDoneSearching();
        }