private async void btnSearchMemory_Click(object sender, EventArgs e) { // start a new search if one hasn't already been started, search through all of memory if (!searchStarted) { // find the heap blocks List <CommittedMemoryBlock> heapBlocks = new List <CommittedMemoryBlock>(); foreach (CommittedMemoryBlock b in console.CommittedMemory) { if (b.Base == 0x82000000) { heapBlocks.Add(b); } } scanner = new XboxMemoryScanner(console, heapBlocks); // grab the user arguments from the UI ulong value = ulong.Parse(txtSearchValue.Text, (rdoHex.Checked) ? NumberStyles.HexNumber : NumberStyles.Integer); BitWidth bitWidth = (BitWidth)Math.Pow(2, cmbxBitwidth.SelectedIndex); // update the UI while searching btnSearchMemory.Enabled = false; // add all of the results to the list view foreach (uint instance in await scanner.FindValue(value, bitWidth)) { lstMemScanResults.Items.Add("0x" + instance.ToString("X8")); } // update the UI so the user can perform another search btnSearchMemory.Enabled = true; tipMemoryScan.SetToolTip(btnSearchMemory, "Search through the results for a new value"); searchStarted = true; } // if a search has already been created then only search through the results already found for the updated value else { btnSearchMemory.Enabled = false; lstMemScanResults.Clear(); foreach (uint address in await scanner.NarrowResults(ulong.Parse(txtSearchValue.Text, (rdoHex.Checked) ? NumberStyles.HexNumber : NumberStyles.Integer))) { lstMemScanResults.Items.Add("0x" + address.ToString("X8")); } btnSearchMemory.Enabled = true; } }
private async void btnSearchMemory_Click(object sender, EventArgs e) { // start a new search if one hasn't already been started, search through all of memory if (!searchStarted) { // find the heap blocks List<CommittedMemoryBlock> heapBlocks = new List<CommittedMemoryBlock>(); foreach (CommittedMemoryBlock b in console.CommittedMemory) if (b.Base == 0x82000000) heapBlocks.Add(b); scanner = new XboxMemoryScanner(console, heapBlocks); // grab the user arguments from the UI ulong value = ulong.Parse(txtSearchValue.Text, (rdoHex.Checked) ? NumberStyles.HexNumber : NumberStyles.Integer); BitWidth bitWidth = (BitWidth)Math.Pow(2, cmbxBitwidth.SelectedIndex); // update the UI while searching btnSearchMemory.Enabled = false; // add all of the results to the list view foreach (uint instance in await scanner.FindValue(value, bitWidth)) lstMemScanResults.Items.Add("0x" + instance.ToString("X8")); // update the UI so the user can perform another search btnSearchMemory.Enabled = true; tipMemoryScan.SetToolTip(btnSearchMemory, "Search through the results for a new value"); searchStarted = true; } // if a search has already been created then only search through the results already found for the updated value else { btnSearchMemory.Enabled = false; lstMemScanResults.Clear(); foreach (uint address in await scanner.NarrowResults(ulong.Parse(txtSearchValue.Text, (rdoHex.Checked) ? NumberStyles.HexNumber : NumberStyles.Integer))) lstMemScanResults.Items.Add("0x" + address.ToString("X8")); btnSearchMemory.Enabled = true; } }