/[RomCheater]/trunk/RomCheater/Docking/FloatingMemorySearcher.cs
ViewVC logotype

Diff of /trunk/RomCheater/Docking/FloatingMemorySearcher.cs

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

--- trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2013/06/05 08:03:28	526
+++ trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2013/06/05 08:09:59	527
@@ -2191,6 +2191,7 @@
                     }
                     else
                     {
+                        Guid new_SearchGuid = SearchGuid;
                         // need to get the address list
                         using (SearchResultReader reader = new SearchResultReader(SearchGuid, false)) // delete the file on dispose
                         {
@@ -2267,384 +2268,384 @@
                             //}
                             //SearchGuid = new_SearchGuid;
                             #endregion
-
-                            byte[] guid = SearchGuid.ToByteArray();
-                            guid[guid.Length - 1]++; // increment the search guid by 1
-                            Guid new_SearchGuid = new Guid(guid);
-
-                            foreach(var k in reader.GetResults(SearchArgs.IsUnsignedDataType,SearchArgs.DataType,new Action<int,string>(UpdateProgress)))
-                            {                                
-                                provider.OpenProvider();
-                                int bytesRead=0;
-                                byte[] data = new byte[STEP_SIZE];
-                                provider.ReadProcessMemory(k.Address, STEP_SIZE, out bytesRead, out data);
-                                provider.CloseProvider();
-
-                                uint address_index = k.Address;
-                                #region comparison and serialization
-                                switch (sdt)
+                            
+                            new_SearchGuid = GuidTools.IncrementGuid(SearchGuid);
+                            using (SearchResultWriter writer = new SearchResultWriter(0, new_SearchGuid))
+                            {
+                                foreach (var k in reader.GetResults(SearchArgs.IsUnsignedDataType, SearchArgs.DataType, new Action<int, string>(UpdateProgress)))
                                 {
-                                    case SearchDataTypes._8bits:
-                                        if (unsigned)
-                                        {
-                                            #region 8bits - unsigned
-                                            var t_data = BitTools.ConvertByteArray<byte>(data);
-                                            foreach (var Value in t_data)
+                                    provider.OpenProvider();
+                                    int bytesRead = 0;
+                                    byte[] data = new byte[STEP_SIZE];
+                                    provider.ReadProcessMemory(k.Address, STEP_SIZE, out bytesRead, out data);
+                                    provider.CloseProvider();
+
+                                    uint address_index = k.Address;
+                                    #region comparison and serialization
+                                    switch (sdt)
+                                    {
+                                        case SearchDataTypes._8bits:
+                                            if (unsigned)
                                             {
-                                                if (SearchWorkerThread.CancellationPending) { break; }
-                                                using (_8bit_unsigned_comparer_ comparer = new _8bit_unsigned_comparer_(SearchArgs, address_index))
+                                                #region 8bits - unsigned
+                                                var t_data = BitTools.ConvertByteArray<byte>(data);
+                                                foreach (var Value in t_data)
                                                 {
-                                                    byte value = 0;
-                                                    if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                    if (SearchWorkerThread.CancellationPending) { break; }
+                                                    using (_8bit_unsigned_comparer_ comparer = new _8bit_unsigned_comparer_(SearchArgs, address_index))
                                                     {
-                                                        using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                        byte value = 0;
+                                                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
                                                         {
-                                                            try
+                                                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
                                                             {
-                                                                gmp.OpenProvider();
-                                                                gmp.ReadMemory(address_index, out value);
-                                                                gmp.CloseProvider();
-                                                            }
-                                                            catch (Exception ex)
-                                                            {
-                                                                logger.VerboseError.WriteLine(ex.ToString());
+                                                                try
+                                                                {
+                                                                    gmp.OpenProvider();
+                                                                    gmp.ReadMemory(address_index, out value);
+                                                                    gmp.CloseProvider();
+                                                                }
+                                                                catch (Exception ex)
+                                                                {
+                                                                    logger.VerboseError.WriteLine(ex.ToString());
+                                                                }
                                                             }
+                                                            comparer.Value = value;
+                                                        }
+                                                        else
+                                                        {
+                                                            value = Convert.ToByte(SearchArgs.CompareStartValue);
+                                                            comparer.Value = value;
+                                                        }
+                                                        if (comparer.Compare(Convert.ToByte(Value), value))
+                                                        {
+                                                            writer.WriteResult<byte>(comparer.Address, comparer.Value);
                                                         }
-                                                        comparer.Value = value;
-                                                    }
-                                                    else
-                                                    {
-                                                        value = Convert.ToByte(SearchArgs.CompareStartValue);
-                                                        comparer.Value = value;
-                                                    }
-                                                    if (comparer.Compare(Convert.ToByte(Value), value))
-                                                    {
-                                                        writer.WriteResult<byte>(comparer.Address, comparer.Value);
                                                     }
+                                                    address_index += STEP_SIZE;
                                                 }
-                                                address_index += STEP_SIZE;
+                                                #endregion
                                             }
-                                            #endregion
-                                        }
-                                        else
-                                        {
-                                            #region 8bits - signed
-                                            var t_data = BitTools.ConvertByteArray<sbyte>(data);
-                                            foreach (var Value in t_data)
+                                            else
                                             {
-                                                if (SearchWorkerThread.CancellationPending) { break; }
-                                                using (_8bit_signed_comparer_ comparer = new _8bit_signed_comparer_(SearchArgs, address_index))
+                                                #region 8bits - signed
+                                                var t_data = BitTools.ConvertByteArray<sbyte>(data);
+                                                foreach (var Value in t_data)
                                                 {
-                                                    sbyte value = 0;
-                                                    if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                    if (SearchWorkerThread.CancellationPending) { break; }
+                                                    using (_8bit_signed_comparer_ comparer = new _8bit_signed_comparer_(SearchArgs, address_index))
                                                     {
-                                                        using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                        sbyte value = 0;
+                                                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
                                                         {
-                                                            try
+                                                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
                                                             {
-                                                                gmp.OpenProvider();
-                                                                gmp.ReadMemory(address_index, out value);
-                                                                gmp.CloseProvider();
-                                                            }
-                                                            catch (Exception ex)
-                                                            {
-                                                                logger.VerboseError.WriteLine(ex.ToString());
+                                                                try
+                                                                {
+                                                                    gmp.OpenProvider();
+                                                                    gmp.ReadMemory(address_index, out value);
+                                                                    gmp.CloseProvider();
+                                                                }
+                                                                catch (Exception ex)
+                                                                {
+                                                                    logger.VerboseError.WriteLine(ex.ToString());
+                                                                }
                                                             }
+                                                            comparer.Value = value;
+                                                        }
+                                                        else
+                                                        {
+                                                            value = Convert.ToSByte(SearchArgs.CompareStartValue);
+                                                            comparer.Value = value;
+                                                        }
+                                                        if (comparer.Compare(Convert.ToSByte(Value), value))
+                                                        {
+                                                            writer.WriteResult<sbyte>(comparer.Address, comparer.Value);
                                                         }
-                                                        comparer.Value = value;
-                                                    }
-                                                    else
-                                                    {
-                                                        value = Convert.ToSByte(SearchArgs.CompareStartValue);
-                                                        comparer.Value = value;
-                                                    }
-                                                    if (comparer.Compare(Convert.ToSByte(Value), value))
-                                                    {
-                                                        writer.WriteResult<sbyte>(comparer.Address, comparer.Value);
                                                     }
+                                                    address_index += STEP_SIZE;
                                                 }
-                                                address_index += STEP_SIZE;
-                                            }
-                                            #endregion
-                                        } break;
-                                    case SearchDataTypes._16bits:
-                                        if (unsigned)
-                                        {
-                                            #region 16bits - unsigned
-                                            var t_data = BitTools.ConvertByteArray<ushort>(data);
-                                            foreach (var Value in t_data)
+                                                #endregion
+                                            } break;
+                                        case SearchDataTypes._16bits:
+                                            if (unsigned)
                                             {
-                                                if (SearchWorkerThread.CancellationPending) { break; }
-                                                using (_16bit_unsigned_comparer_ comparer = new _16bit_unsigned_comparer_(SearchArgs, address_index))
+                                                #region 16bits - unsigned
+                                                var t_data = BitTools.ConvertByteArray<ushort>(data);
+                                                foreach (var Value in t_data)
                                                 {
-                                                    ushort value = 0;
-                                                    if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                    if (SearchWorkerThread.CancellationPending) { break; }
+                                                    using (_16bit_unsigned_comparer_ comparer = new _16bit_unsigned_comparer_(SearchArgs, address_index))
                                                     {
-                                                        using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                        ushort value = 0;
+                                                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
                                                         {
-                                                            try
-                                                            {
-                                                                gmp.OpenProvider();
-                                                                gmp.ReadMemory(address_index, out value);
-                                                                gmp.CloseProvider();
-                                                            }
-                                                            catch (Exception ex)
+                                                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
                                                             {
-                                                                logger.VerboseError.WriteLine(ex.ToString());
+                                                                try
+                                                                {
+                                                                    gmp.OpenProvider();
+                                                                    gmp.ReadMemory(address_index, out value);
+                                                                    gmp.CloseProvider();
+                                                                }
+                                                                catch (Exception ex)
+                                                                {
+                                                                    logger.VerboseError.WriteLine(ex.ToString());
+                                                                }
                                                             }
+                                                            comparer.Value = value;
+                                                        }
+                                                        else
+                                                        {
+                                                            value = Convert.ToUInt16(SearchArgs.CompareStartValue);
+                                                            comparer.Value = value;
+                                                        }
+                                                        if (comparer.Compare(Convert.ToUInt16(Value), value))
+                                                        {
+                                                            writer.WriteResult<ushort>(comparer.Address, comparer.Value);
                                                         }
-                                                        comparer.Value = value;
-                                                    }
-                                                    else
-                                                    {
-                                                        value = Convert.ToUInt16(SearchArgs.CompareStartValue);
-                                                        comparer.Value = value;
-                                                    }
-                                                    if (comparer.Compare(Convert.ToUInt16(Value), value))
-                                                    {
-                                                        writer.WriteResult<ushort>(comparer.Address, comparer.Value);
                                                     }
+                                                    address_index += STEP_SIZE;
                                                 }
-                                                address_index += STEP_SIZE;
+                                                #endregion
                                             }
-                                            #endregion
-                                        }
-                                        else
-                                        {
-                                            #region 16bits - signed
-                                            var t_data = BitTools.ConvertByteArray<short>(data);
-                                            foreach (var Value in t_data)
+                                            else
                                             {
-                                                if (SearchWorkerThread.CancellationPending) { break; }
-                                                using (_16bit_signed_comparer_ comparer = new _16bit_signed_comparer_(SearchArgs, address_index))
+                                                #region 16bits - signed
+                                                var t_data = BitTools.ConvertByteArray<short>(data);
+                                                foreach (var Value in t_data)
                                                 {
-                                                    short value = 0;
-                                                    if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                    if (SearchWorkerThread.CancellationPending) { break; }
+                                                    using (_16bit_signed_comparer_ comparer = new _16bit_signed_comparer_(SearchArgs, address_index))
                                                     {
-                                                        using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                        short value = 0;
+                                                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
                                                         {
-                                                            try
-                                                            {
-                                                                gmp.OpenProvider();
-                                                                gmp.ReadMemory(address_index, out value);
-                                                                gmp.CloseProvider();
-                                                            }
-                                                            catch (Exception ex)
+                                                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
                                                             {
-                                                                logger.VerboseError.WriteLine(ex.ToString());
+                                                                try
+                                                                {
+                                                                    gmp.OpenProvider();
+                                                                    gmp.ReadMemory(address_index, out value);
+                                                                    gmp.CloseProvider();
+                                                                }
+                                                                catch (Exception ex)
+                                                                {
+                                                                    logger.VerboseError.WriteLine(ex.ToString());
+                                                                }
                                                             }
+                                                            comparer.Value = value;
+                                                        }
+                                                        else
+                                                        {
+                                                            value = Convert.ToInt16(SearchArgs.CompareStartValue);
+                                                            comparer.Value = value;
+                                                        }
+                                                        if (comparer.Compare(Convert.ToSByte(Value), value))
+                                                        {
+                                                            writer.WriteResult<short>(comparer.Address, comparer.Value);
                                                         }
-                                                        comparer.Value = value;
-                                                    }
-                                                    else
-                                                    {
-                                                        value = Convert.ToInt16(SearchArgs.CompareStartValue);
-                                                        comparer.Value = value;
-                                                    }
-                                                    if (comparer.Compare(Convert.ToSByte(Value), value))
-                                                    {
-                                                        writer.WriteResult<short>(comparer.Address, comparer.Value);
                                                     }
+                                                    address_index += STEP_SIZE;
                                                 }
-                                                address_index += STEP_SIZE;
-                                            }
-                                            #endregion
-                                        } break;
-                                    case SearchDataTypes._32bits:
-                                        if (unsigned)
-                                        {
-                                            #region 32bits - unsigned
-                                            var t_data = BitTools.ConvertByteArray<uint>(data);
-                                            foreach (var Value in t_data)
+                                                #endregion
+                                            } break;
+                                        case SearchDataTypes._32bits:
+                                            if (unsigned)
                                             {
-                                                if (SearchWorkerThread.CancellationPending) { break; }
-                                                using (_32bit_unsigned_comparer_ comparer = new _32bit_unsigned_comparer_(SearchArgs, address_index))
+                                                #region 32bits - unsigned
+                                                var t_data = BitTools.ConvertByteArray<uint>(data);
+                                                foreach (var Value in t_data)
                                                 {
-                                                    uint value = 0;
-                                                    if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                    if (SearchWorkerThread.CancellationPending) { break; }
+                                                    using (_32bit_unsigned_comparer_ comparer = new _32bit_unsigned_comparer_(SearchArgs, address_index))
                                                     {
-                                                        using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                        uint value = 0;
+                                                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
                                                         {
-                                                            try
-                                                            {
-                                                                gmp.OpenProvider();
-                                                                gmp.ReadMemory(address_index, out value);
-                                                                gmp.CloseProvider();
-                                                            }
-                                                            catch (Exception ex)
+                                                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
                                                             {
-                                                                logger.VerboseError.WriteLine(ex.ToString());
+                                                                try
+                                                                {
+                                                                    gmp.OpenProvider();
+                                                                    gmp.ReadMemory(address_index, out value);
+                                                                    gmp.CloseProvider();
+                                                                }
+                                                                catch (Exception ex)
+                                                                {
+                                                                    logger.VerboseError.WriteLine(ex.ToString());
+                                                                }
                                                             }
+                                                            comparer.Value = value;
+                                                        }
+                                                        else
+                                                        {
+                                                            value = Convert.ToUInt32(SearchArgs.CompareStartValue);
+                                                            comparer.Value = value;
+                                                        }
+                                                        if (comparer.Compare(Convert.ToUInt32(Value), value))
+                                                        {
+                                                            writer.WriteResult<uint>(comparer.Address, comparer.Value);
                                                         }
-                                                        comparer.Value = value;
-                                                    }
-                                                    else
-                                                    {
-                                                        value = Convert.ToUInt32(SearchArgs.CompareStartValue);
-                                                        comparer.Value = value;
-                                                    }
-                                                    if (comparer.Compare(Convert.ToUInt32(Value), value))
-                                                    {
-                                                        writer.WriteResult<uint>(comparer.Address, comparer.Value);
                                                     }
+                                                    address_index += STEP_SIZE;
                                                 }
-                                                address_index += STEP_SIZE;
+                                                #endregion
                                             }
-                                            #endregion
-                                        }
-                                        else
-                                        {
-                                            #region 32bits - signed
-                                            var t_data = BitTools.ConvertByteArray<int>(data);
-                                            foreach (var Value in t_data)
+                                            else
                                             {
-                                                if (SearchWorkerThread.CancellationPending) { break; }
-                                                using (_32bit_signed_comparer_ comparer = new _32bit_signed_comparer_(SearchArgs, address_index))
+                                                #region 32bits - signed
+                                                var t_data = BitTools.ConvertByteArray<int>(data);
+                                                foreach (var Value in t_data)
                                                 {
-                                                    int value = 0;
-                                                    if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                    if (SearchWorkerThread.CancellationPending) { break; }
+                                                    using (_32bit_signed_comparer_ comparer = new _32bit_signed_comparer_(SearchArgs, address_index))
                                                     {
-                                                        using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                        int value = 0;
+                                                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
                                                         {
-                                                            try
-                                                            {
-                                                                gmp.OpenProvider();
-                                                                gmp.ReadMemory(address_index, out value);
-                                                                gmp.CloseProvider();
-                                                            }
-                                                            catch (Exception ex)
+                                                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
                                                             {
-                                                                logger.VerboseError.WriteLine(ex.ToString());
+                                                                try
+                                                                {
+                                                                    gmp.OpenProvider();
+                                                                    gmp.ReadMemory(address_index, out value);
+                                                                    gmp.CloseProvider();
+                                                                }
+                                                                catch (Exception ex)
+                                                                {
+                                                                    logger.VerboseError.WriteLine(ex.ToString());
+                                                                }
                                                             }
+                                                            comparer.Value = value;
+                                                        }
+                                                        else
+                                                        {
+                                                            value = Convert.ToInt32(SearchArgs.CompareStartValue);
+                                                            comparer.Value = value;
+                                                        }
+                                                        if (comparer.Compare(Convert.ToInt32(Value), value))
+                                                        {
+                                                            writer.WriteResult<int>(comparer.Address, comparer.Value);
                                                         }
-                                                        comparer.Value = value;
-                                                    }
-                                                    else
-                                                    {
-                                                        value = Convert.ToInt32(SearchArgs.CompareStartValue);
-                                                        comparer.Value = value;
-                                                    }
-                                                    if (comparer.Compare(Convert.ToInt32(Value), value))
-                                                    {
-                                                        writer.WriteResult<int>(comparer.Address, comparer.Value);
                                                     }
+                                                    address_index += STEP_SIZE;
                                                 }
-                                                address_index += STEP_SIZE;
-                                            }
-                                            #endregion
-                                        } break;
-                                    case SearchDataTypes._64bits:
-                                        if (unsigned)
-                                        {
-                                            #region 64bits - unsigned
-                                            var t_data = BitTools.ConvertByteArray<ulong>(data);
-                                            foreach (var Value in t_data)
+                                                #endregion
+                                            } break;
+                                        case SearchDataTypes._64bits:
+                                            if (unsigned)
                                             {
-                                                if (SearchWorkerThread.CancellationPending) { break; }
-                                                using (_64bit_unsigned_comparer_ comparer = new _64bit_unsigned_comparer_(SearchArgs, address_index))
+                                                #region 64bits - unsigned
+                                                var t_data = BitTools.ConvertByteArray<ulong>(data);
+                                                foreach (var Value in t_data)
                                                 {
-                                                    ulong value = 0;
-                                                    if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                    if (SearchWorkerThread.CancellationPending) { break; }
+                                                    using (_64bit_unsigned_comparer_ comparer = new _64bit_unsigned_comparer_(SearchArgs, address_index))
                                                     {
-                                                        using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                        ulong value = 0;
+                                                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
                                                         {
-                                                            try
+                                                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
                                                             {
-                                                                gmp.OpenProvider();
-                                                                gmp.ReadMemory(address_index, out value);
-                                                                gmp.CloseProvider();
-                                                            }
-                                                            catch (Exception ex)
-                                                            {
-                                                                logger.VerboseError.WriteLine(ex.ToString());
+                                                                try
+                                                                {
+                                                                    gmp.OpenProvider();
+                                                                    gmp.ReadMemory(address_index, out value);
+                                                                    gmp.CloseProvider();
+                                                                }
+                                                                catch (Exception ex)
+                                                                {
+                                                                    logger.VerboseError.WriteLine(ex.ToString());
+                                                                }
                                                             }
+                                                            comparer.Value = value;
+                                                        }
+                                                        else
+                                                        {
+                                                            value = Convert.ToUInt64(SearchArgs.CompareStartValue);
+                                                            comparer.Value = value;
+                                                        }
+                                                        if (comparer.Compare(Convert.ToUInt64(Value), value))
+                                                        {
+                                                            writer.WriteResult<ulong>(comparer.Address, comparer.Value);
                                                         }
-                                                        comparer.Value = value;
-                                                    }
-                                                    else
-                                                    {
-                                                        value = Convert.ToUInt64(SearchArgs.CompareStartValue);
-                                                        comparer.Value = value;
-                                                    }
-                                                    if (comparer.Compare(Convert.ToUInt64(Value), value))
-                                                    {
-                                                        writer.WriteResult<ulong>(comparer.Address, comparer.Value);
                                                     }
+                                                    address_index += STEP_SIZE;
                                                 }
-                                                address_index += STEP_SIZE;
+                                                #endregion
                                             }
-                                            #endregion
-                                        }
-                                        else
-                                        {
-                                            #region 64bits - signed
-                                            var t_data = BitTools.ConvertByteArray<long>(data);
-                                            foreach (var Value in t_data)
+                                            else
                                             {
-                                                if (SearchWorkerThread.CancellationPending) { break; }
-                                                using (_64bit_signed_comparer_ comparer = new _64bit_signed_comparer_(SearchArgs, address_index))
+                                                #region 64bits - signed
+                                                var t_data = BitTools.ConvertByteArray<long>(data);
+                                                foreach (var Value in t_data)
                                                 {
-                                                    long value = 0;
-                                                    if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                    if (SearchWorkerThread.CancellationPending) { break; }
+                                                    using (_64bit_signed_comparer_ comparer = new _64bit_signed_comparer_(SearchArgs, address_index))
                                                     {
-                                                        using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                        long value = 0;
+                                                        if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
                                                         {
-                                                            try
-                                                            {
-                                                                gmp.OpenProvider();
-                                                                gmp.ReadMemory(address_index, out value);
-                                                                gmp.CloseProvider();
-                                                            }
-                                                            catch (Exception ex)
+                                                            using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
                                                             {
-                                                                logger.VerboseError.WriteLine(ex.ToString());
+                                                                try
+                                                                {
+                                                                    gmp.OpenProvider();
+                                                                    gmp.ReadMemory(address_index, out value);
+                                                                    gmp.CloseProvider();
+                                                                }
+                                                                catch (Exception ex)
+                                                                {
+                                                                    logger.VerboseError.WriteLine(ex.ToString());
+                                                                }
                                                             }
+                                                            comparer.Value = value;
+                                                        }
+                                                        else
+                                                        {
+                                                            value = Convert.ToInt64(SearchArgs.CompareStartValue);
+                                                            comparer.Value = value;
+                                                        }
+                                                        if (comparer.Compare(Convert.ToInt64(Value), value))
+                                                        {
+                                                            writer.WriteResult<long>(comparer.Address, comparer.Value);
                                                         }
-                                                        comparer.Value = value;
-                                                    }
-                                                    else
-                                                    {
-                                                        value = Convert.ToInt64(SearchArgs.CompareStartValue);
-                                                        comparer.Value = value;
-                                                    }
-                                                    if (comparer.Compare(Convert.ToInt64(Value), value))
-                                                    {
-                                                        writer.WriteResult<long>(comparer.Address, comparer.Value);
                                                     }
+                                                    address_index += STEP_SIZE;
                                                 }
-                                                address_index += STEP_SIZE;
-                                            }
-                                            #endregion
-                                        } break;
+                                                #endregion
+                                            } break;
 
-                                }
-                                #endregion
-
-                            }
+                                    }
+                                    #endregion
 
+                                }
 
-                            //ISerializedResult sr = (reader as ISerializedResult);
-                            //if (sr == null)
-                            //{
-                            //    throw new ArgumentNullException("sr", string.Format("Unable to cast: '{0}' to '{1}'", reader.GetType().Name, typeof(ISerializedResult).Name));
-                            //}
-                            //int sr_index = 0;
-                            //try
-                            //{
-                            //    if (sr.ContainsAddress(obre_CurrentIndex, obre_unsigned, obre_sdt, new Action<int, string>(this.UpdateProgress), out sr_index))
-                            //    {
-                            //        StructResultType<ulong> result = StructResultType<ulong>.Empty;
-                            //        sr.GetResultAtIndex(sr_index, obre_unsigned, obre_sdt, new Action<int, string>(this.UpdateProgress), out result);
-                            //        if (Debugger.IsAttached)
-                            //        {
-                            //            Debugger.Break();
-                            //        }
-                            //    }
-                            //}
 
+                                //ISerializedResult sr = (reader as ISerializedResult);
+                                //if (sr == null)
+                                //{
+                                //    throw new ArgumentNullException("sr", string.Format("Unable to cast: '{0}' to '{1}'", reader.GetType().Name, typeof(ISerializedResult).Name));
+                                //}
+                                //int sr_index = 0;
+                                //try
+                                //{
+                                //    if (sr.ContainsAddress(obre_CurrentIndex, obre_unsigned, obre_sdt, new Action<int, string>(this.UpdateProgress), out sr_index))
+                                //    {
+                                //        StructResultType<ulong> result = StructResultType<ulong>.Empty;
+                                //        sr.GetResultAtIndex(sr_index, obre_unsigned, obre_sdt, new Action<int, string>(this.UpdateProgress), out result);
+                                //        if (Debugger.IsAttached)
+                                //        {
+                                //            Debugger.Break();
+                                //        }
+                                //    }
+                                //}
 
+                            }
 
                         }
+                        SearchGuid = new_SearchGuid; // update with out new guid
                     }
                 }
                 provider_st.Stop();

 

  ViewVC Help
Powered by ViewVC 1.1.22