private void DoSearch() { Form.NTRConnection.SetCurrentOperationText = "Searching Memory"; uint ProcessID = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(CurrentSelectedProcess.Split('|')[0]), 0); uint StartAddress, MemorySize; if (CurrentMemoryRange.Equals("All")) { StartAddress = MemorySize = uint.MaxValue; } else { StartAddress = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Form.MemoryStart.Text).Reverse().ToArray(), 0); MemorySize = BitConverter.ToUInt32(Utilities.GetByteArrayFromByteString(Form.MemorySize.Text).Reverse().ToArray(), 0); } if (Form.ResultsGrid.Rows.Count > 0 || Form.NTRConnection.AddressesFound.Count > 0) { MemorySize = Form.GetSearchMemorySize(); } switch (CurrentSelectedDataType) { case 0: //1 Byte Form.NTRConnection.SendReadMemoryPacket(ProcessID, StartAddress, MemorySize, (byte)uint.Parse(Form.SearchValue.Text)); break; case 1: //2 Bytes Form.NTRConnection.SendReadMemoryPacket(ProcessID, StartAddress, MemorySize, ushort.Parse(Form.SearchValue.Text)); break; case 2: //4 Bytes Form.NTRConnection.SendReadMemoryPacket(ProcessID, StartAddress, MemorySize, uint.Parse(Form.SearchValue.Text)); break; case 3: //8 Bytes Form.NTRConnection.SendReadMemoryPacket(ProcessID, StartAddress, MemorySize, ulong.Parse(Form.SearchValue.Text)); break; case 4: //Float Form.NTRConnection.SendReadMemoryPacket(ProcessID, StartAddress, MemorySize, float.Parse(Form.SearchValue.Text)); break; case 5: //Double Form.NTRConnection.SendReadMemoryPacket(ProcessID, StartAddress, MemorySize, double.Parse(Form.SearchValue.Text)); break; case 6: //Raw Bytes Form.NTRConnection.SendReadMemoryPacket(ProcessID, StartAddress, MemorySize, Utilities.GetByteArrayFromByteString(Form.SearchValue.Text)); break; } Form.ControlEnabledSearchButton = true; }
internal byte[] GetMemoryAtAddress(uint ProcessID, uint Address, DataTypeExact DataType) { SearchCriteria Criteria = new SearchCriteria(); Criteria.ProcessID = ProcessID; Criteria.DataType = DataType; Criteria.StartAddress = Address; Criteria.Length = Criteria.Size = Form.GetSearchMemorySize(DataType); Criteria.SearchType = SearchTypeBase.Unknown; Criteria.SearchValue = new byte[] { 0 }; Form.NTRConnection.SearchCriteria.Add(Criteria); Form.NTRConnection.SendReadMemoryPacket(Criteria); return(Criteria.AddressesFound.Values.First()); }