Пример #1
0
        private void EstimateMapSize(MetaMap map, uint mapAddress, MemoryMap memMap, int entryCount)
        {
            bool alreadyVisited = map.HasSizeEstimates;

            int newSize = memMap.EstimateBlockSize(mapAddress);

            map.EstimateSize(newSize / entryCount);
            map.Truncate(newSize);

            if (alreadyVisited)
            {
                return;
            }

            foreach (MetaValueGuess guess in map.Guesses)
            {
                if (guess.Type != MetaValueType.Reflexive)
                {
                    continue;
                }

                MetaMap subMap = map.GetSubMap(guess.Offset);
                if (subMap != null)
                {
                    EstimateMapSize(subMap, guess.Pointer, memMap, (int)guess.Data1);
                }
            }
        }