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

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

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

--- trunk/RomCheater/Docking/MemorySearch/NotInRangeComparer.cs	2012/06/19 07:56:36	378
+++ trunk/RomCheater/Docking/MemorySearch/NotInRangeComparer.cs	2012/06/19 10:15:53	384
@@ -14,9 +14,9 @@
         }
 
         #region IRangeComparer<object> Members
-        public bool Compare(object Start, object End, SearchDataTypes bitsize, bool unsigned, BinaryReader reader)
+        public bool Compare(object Start, object End, SearchDataTypes bitsize, bool unsigned, byte[] buffered_mem)
         {
-            reader.BaseStream.Seek(this.Address, SeekOrigin.Begin);
+            //reader.BaseStream.Seek(this.Address, SeekOrigin.Begin);
 
             ulong start_value, end_value;
             start_value = new DataTypeConverter(Start).ToUInt64();
@@ -26,12 +26,12 @@
             {
                 if (unsigned)
                 {
-                    lookup_value = new DataTypeConverter(reader.ReadByte());
+                    lookup_value = new DataTypeConverter(buffered_mem[this.Address]);
                     if (lookup_value.ToByte() < (byte)start_value || lookup_value.ToByte() > (byte)end_value) { this.Value = lookup_value.Value; return true; }
                 }
                 else
                 {
-                    lookup_value = new DataTypeConverter(reader.ReadSByte());
+                    lookup_value = new DataTypeConverter(buffered_mem[this.Address]);
                     if (lookup_value.ToSByte() < (sbyte)start_value || lookup_value.ToSByte() > (sbyte)end_value) { this.Value = lookup_value.Value; return true; }
                 }
             }
@@ -39,12 +39,12 @@
             {
                 if (unsigned)
                 {
-                    lookup_value = new DataTypeConverter(reader.ReadUInt16());
+                    lookup_value = new DataTypeConverter(BitConverter.ToUInt16(buffered_mem, (int)this.Address));
                     if (lookup_value.ToUInt16() < (ushort)start_value || lookup_value.ToUInt16() > (ushort)end_value) { this.Value = lookup_value.Value; return true; }
                 }
                 else
                 {
-                    lookup_value = new DataTypeConverter(reader.ReadInt16());
+                    lookup_value = new DataTypeConverter(BitConverter.ToInt16(buffered_mem, (int)this.Address));
                     if (lookup_value.ToInt16() < (short)start_value || lookup_value.ToInt16() > (short)end_value) { this.Value = lookup_value.Value; return true; }
                 }
             }
@@ -52,12 +52,12 @@
             {
                 if (unsigned)
                 {
-                    lookup_value = new DataTypeConverter(reader.ReadUInt32());
+                    lookup_value = new DataTypeConverter(BitConverter.ToUInt32(buffered_mem, (int)this.Address));
                     if (lookup_value.ToUInt32() < (uint)start_value || lookup_value.ToUInt32() > (uint)end_value) { this.Value = lookup_value.Value; return true; }
                 }
                 else
                 {
-                    lookup_value = new DataTypeConverter(reader.ReadInt32());
+                    lookup_value = new DataTypeConverter(BitConverter.ToInt32(buffered_mem, (int)this.Address));
                     if (lookup_value.ToInt32() < (int)start_value || lookup_value.ToInt32() > (int)end_value) { this.Value = lookup_value.Value; return true; }
                 }
             }
@@ -65,12 +65,12 @@
             {
                 if (unsigned)
                 {
-                    lookup_value = new DataTypeConverter(reader.ReadUInt64());
+                    lookup_value = new DataTypeConverter(BitConverter.ToUInt64(buffered_mem, (int)this.Address));
                     if (lookup_value.ToUInt64() < (ulong)start_value || lookup_value.ToUInt64() > (ulong)end_value) { this.Value = lookup_value.Value; return true; }
                 }
                 else
                 {
-                    lookup_value = new DataTypeConverter(reader.ReadInt64());
+                    lookup_value = new DataTypeConverter(BitConverter.ToInt64(buffered_mem, (int)this.Address));
                     if (lookup_value.ToInt64() < (long)start_value || lookup_value.ToInt64() > (long)end_value) { this.Value = lookup_value.Value; return true; }
                 }
             }

 

  ViewVC Help
Powered by ViewVC 1.1.22