Ejemplo n.º 1
0
 void compare_with_filter_list_2_bytes(byte[] match_value, ulong address, byte[] mem, AddressList filtered_list)
 {
     Byte[] bytes = new byte[8];
     for (int i = 0; i + 2 < mem.LongLength; i += 2)
     {
         Buffer.BlockCopy(mem, i, bytes, 0, 2);
         if (CompareInFilter(match_value, bytes))
         {
             Address addr = new Address();
             addr.AddressOffset = (uint)i;
             addr.MemoryValue   = BytesToUlong(bytes);
             filtered_list.Add(addr);
         }
     }
 }
Ejemplo n.º 2
0
        public AddressList Intersect(MemoryHelper memoryHelper, AddressList filteredList, string default_compare_value)
        {
            AddressList new_address_list = new AddressList();
            int         idx_i            = 0;
            int         idx_j            = 0;

            while (idx_i < address_list.Count && idx_j < filteredList.Count)
            {
                Address address  = address_list[idx_i];
                Address filtered = filteredList[idx_j];

                if (address.AddressOffset == filtered.AddressOffset)
                {
                    byte[] value = memoryHelper.UlongToBytes(filtered.MemoryValue);

                    byte[] compare_value = memoryHelper.GetCompareBytes(address, default_compare_value);

                    if (memoryHelper.Compare(compare_value, value))
                    {
                        new_address_list.Add(filtered);
                    }

                    idx_j++;
                    idx_i++;
                }
                else if (address.AddressOffset > filtered.AddressOffset)
                {
                    idx_j++;
                }
                else
                {
                    idx_i++;
                }
            }

            return(new_address_list);
        }