/// <summary> /// the enumerated set contains all addresses of Python Objects of the type with the given <paramref name="tp_name"/>. /// /// the addresses are only filtered for appropriate ob_type. /// </summary> /// <param name="MemoryReader"></param> /// <param name="tp_name"></param> /// <returns></returns> static public IEnumerable <UInt32> EnumeratePossibleAddressesOfInstancesOfPythonTypeFilteredByObType( IMemoryReader MemoryReader, string tp_name) { var CandidatesTypeObjectType = PyTypeObject.FindCandidatesTypeObjectTypeAddress(MemoryReader); var TypeObjectType = PyTypeObject.TypeObjectAddressesFilterByTpName(CandidatesTypeObjectType, MemoryReader, "type").FirstOrDefault(); if (null == TypeObjectType) { yield break; } // finds candidate Addresses for Objects of type "type" with only requiring them to have a appropriate value for ob_type. var TypeCandidateAddressesPlus4 = MemoryReader.AddressesHoldingValue32Aligned32((UInt32)TypeObjectType.BaseAddress, 0, Int32.MaxValue) .ToArray(); var TypeCandidateAddresses = TypeCandidateAddressesPlus4 .Select((Address) => (UInt32)(Address - 4)) .ToArray(); var TypeObjectsWithProperName = PyTypeObject.TypeObjectAddressesFilterByTpName(TypeCandidateAddresses, MemoryReader, tp_name) .ToArray(); foreach (var TypeObject in TypeObjectsWithProperName) { // finds candidate Addresses for Objects of type tp_name with only requiring them to have a appropriate value for ob_type. foreach (var CandidateForObjectOfTypeAddressPlus4 in MemoryReader.AddressesHoldingValue32Aligned32((UInt32)TypeObject.BaseAddress, 0, Int32.MaxValue)) { yield return((UInt32)(CandidateForObjectOfTypeAddressPlus4 - 4)); } } }