/[RomCheater]/trunk/RomCheater/Docking/MemorySearch/SearchPatcher.cs
ViewVC logotype

Diff of /trunk/RomCheater/Docking/MemorySearch/SearchPatcher.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 378 by william, Tue Jun 19 07:56:36 2012 UTC revision 398 by william, Wed Jun 20 12:16:34 2012 UTC
# Line 108  namespace RomCheater.Docking.MemorySearc Line 108  namespace RomCheater.Docking.MemorySearc
108          {          {
109              uint Address = txtAddress.ToUInt32();              uint Address = txtAddress.ToUInt32();
110    
111              GenericMemoryProvider provider = new GenericMemoryProvider((IAcceptsProcessAndConfig)this);              using (GenericMemoryProvider provider = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
             provider.OpenProvider();  
             switch (DataType)  
112              {              {
113                  case SearchDataTypes._8bits:                  provider.OpenProvider();
114                      if (Unsigned) { provider.PatchMemory(Address, txtValue.ToByte()); }                  switch (DataType)
115                      else { provider.PatchMemory(Address, txtValue.ToSByte()); }                  {
116                      break;                      case SearchDataTypes._8bits:
117                  case SearchDataTypes._16bits:                          if (Unsigned) { provider.PatchMemory(Address, txtValue.ToByte()); }
118                      if (Unsigned) { provider.PatchMemory(Address, txtValue.ToUInt16()); }                          else { provider.PatchMemory(Address, txtValue.ToSByte()); }
119                      else { provider.PatchMemory(Address, txtValue.ToInt16()); }                          break;
120                      break;                      case SearchDataTypes._16bits:
121                  case SearchDataTypes._32bits:                          if (Unsigned) { provider.PatchMemory(Address, txtValue.ToUInt16()); }
122                      if (Unsigned) { provider.PatchMemory(Address, txtValue.ToUInt32()); }                          else { provider.PatchMemory(Address, txtValue.ToInt16()); }
123                      else { provider.PatchMemory(Address, txtValue.ToInt32()); }                          break;
124                      break;                      case SearchDataTypes._32bits:
125                  case SearchDataTypes._64bits:                          if (Unsigned) { provider.PatchMemory(Address, txtValue.ToUInt32()); }
126                      if (Unsigned) { provider.PatchMemory(Address, txtValue.ToUInt64()); }                          else { provider.PatchMemory(Address, txtValue.ToInt32()); }
127                      else { provider.PatchMemory(Address, txtValue.ToInt64()); }                          break;
128                      break;                      case SearchDataTypes._64bits:
129                            if (Unsigned) { provider.PatchMemory(Address, txtValue.ToUInt64()); }
130                            else { provider.PatchMemory(Address, txtValue.ToInt64()); }
131                            break;
132                    }
133                    provider.CloseProvider();
134              }              }
             provider.CloseProvider();  
135              this.Close();              this.Close();
136          }          }
137    

Legend:
Removed from v.378  
changed lines
  Added in v.398

  ViewVC Help
Powered by ViewVC 1.1.22