--- trunk/RomCheater/Docking/MemorySearch/SearchPatcher.cs 2012/06/02 19:12:20 230 +++ trunk/RomCheater/Docking/MemorySearch/SearchPatcher.cs 2012/06/03 12:51:40 239 @@ -8,6 +8,7 @@ using System.Windows.Forms; using RomCheater.Docking.MemorySearch; using System.Diagnostics; using RomCheater.Logging; +using Sojaner.MemoryScanner.MemoryProviers; namespace RomCheater.Docking.MemorySearch @@ -97,26 +98,24 @@ namespace RomCheater.Docking.MemorySearc { uint Address = txtAddress.ToUInt32(); - Sojaner.MemoryScanner.ProcessMemoryReader reader = new Sojaner.MemoryScanner.ProcessMemoryReader(); - reader.ReadProcess = Process.GetProcessById(pid); - if (reader.ReadProcess == null) { logger.Error.WriteLine("Could not attach to process: {0}", pid); return; } + GenericMemoryProvider provider = new GenericMemoryProvider(null, Process.GetProcessById(pid)); switch (DataType) { case SearchDataTypes._8bits: - if (Unsigned) { reader.PatchMemory(Address, txtValue.ToByte()); } - else { reader.PatchMemory(Address, txtValue.ToSByte()); } + if (Unsigned) { provider.PatchMemory(Address, txtValue.ToByte()); } + else { provider.PatchMemory(Address, txtValue.ToSByte()); } break; case SearchDataTypes._16bits: - if (Unsigned) { reader.PatchMemory(Address, txtValue.ToUInt16()); } - else { reader.PatchMemory(Address, txtValue.ToInt16()); } + if (Unsigned) { provider.PatchMemory(Address, txtValue.ToUInt16()); } + else { provider.PatchMemory(Address, txtValue.ToInt16()); } break; case SearchDataTypes._32bits: - if (Unsigned) { reader.PatchMemory(Address, txtValue.ToUInt32()); } - else { reader.PatchMemory(Address, txtValue.ToInt32()); } + if (Unsigned) { provider.PatchMemory(Address, txtValue.ToUInt32()); } + else { provider.PatchMemory(Address, txtValue.ToInt32()); } break; case SearchDataTypes._64bits: - if (Unsigned) { reader.PatchMemory(Address, txtValue.ToUInt64()); } - else { reader.PatchMemory(Address, txtValue.ToInt64()); } + if (Unsigned) { provider.PatchMemory(Address, txtValue.ToUInt64()); } + else { provider.PatchMemory(Address, txtValue.ToInt64()); } break; } this.Close(); |