Example #1
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);
        }