8 |
using RomCheater.Docking.MemorySearch; |
using RomCheater.Docking.MemorySearch; |
9 |
using System.Diagnostics; |
using System.Diagnostics; |
10 |
using RomCheater.Logging; |
using RomCheater.Logging; |
11 |
|
using Sojaner.MemoryScanner.MemoryProviers; |
12 |
|
|
13 |
|
|
14 |
namespace RomCheater.Docking.MemorySearch |
namespace RomCheater.Docking.MemorySearch |
98 |
{ |
{ |
99 |
uint Address = txtAddress.ToUInt32(); |
uint Address = txtAddress.ToUInt32(); |
100 |
|
|
101 |
Sojaner.MemoryScanner.ProcessMemoryReader reader = new Sojaner.MemoryScanner.ProcessMemoryReader(); |
GenericMemoryProvider provider = new GenericMemoryProvider(null, Process.GetProcessById(pid)); |
|
reader.ReadProcess = Process.GetProcessById(pid); |
|
|
if (reader.ReadProcess == null) { logger.Error.WriteLine("Could not attach to process: {0}", pid); return; } |
|
102 |
switch (DataType) |
switch (DataType) |
103 |
{ |
{ |
104 |
case SearchDataTypes._8bits: |
case SearchDataTypes._8bits: |
105 |
if (Unsigned) { reader.PatchMemory(Address, txtValue.ToByte()); } |
if (Unsigned) { provider.PatchMemory(Address, txtValue.ToByte()); } |
106 |
else { reader.PatchMemory(Address, txtValue.ToSByte()); } |
else { provider.PatchMemory(Address, txtValue.ToSByte()); } |
107 |
break; |
break; |
108 |
case SearchDataTypes._16bits: |
case SearchDataTypes._16bits: |
109 |
if (Unsigned) { reader.PatchMemory(Address, txtValue.ToUInt16()); } |
if (Unsigned) { provider.PatchMemory(Address, txtValue.ToUInt16()); } |
110 |
else { reader.PatchMemory(Address, txtValue.ToInt16()); } |
else { provider.PatchMemory(Address, txtValue.ToInt16()); } |
111 |
break; |
break; |
112 |
case SearchDataTypes._32bits: |
case SearchDataTypes._32bits: |
113 |
if (Unsigned) { reader.PatchMemory(Address, txtValue.ToUInt32()); } |
if (Unsigned) { provider.PatchMemory(Address, txtValue.ToUInt32()); } |
114 |
else { reader.PatchMemory(Address, txtValue.ToInt32()); } |
else { provider.PatchMemory(Address, txtValue.ToInt32()); } |
115 |
break; |
break; |
116 |
case SearchDataTypes._64bits: |
case SearchDataTypes._64bits: |
117 |
if (Unsigned) { reader.PatchMemory(Address, txtValue.ToUInt64()); } |
if (Unsigned) { provider.PatchMemory(Address, txtValue.ToUInt64()); } |
118 |
else { reader.PatchMemory(Address, txtValue.ToInt64()); } |
else { provider.PatchMemory(Address, txtValue.ToInt64()); } |
119 |
break; |
break; |
120 |
} |
} |
121 |
this.Close(); |
this.Close(); |