Exemplo n.º 1
0
        protected List <int> FindBytesInVicinity(List <Tuple <byte, byte> > bytePairs, int range)
        {
            var data = new DiscData();

            data.LoadData(RawData);
            var indices         = data.FindTwoByteValue(bytePairs[0].Item2, bytePairs[0].Item1);
            var matchingIndices = new List <int>();

            foreach (var index in indices)
            {
                bool match = true;
                foreach (var bytePair in bytePairs)
                {
                    var matches = data.SearchVicinityForTwoBytes(index, range, bytePair.Item2, bytePair.Item1);
                    if (matches.Count == 0)
                    {
                        match = false;
                        break;
                    }
                }
                if (!match)
                {
                    continue;
                }
                matchingIndices.Add(index);
            }
            return(matchingIndices);
        }