public static int getVfTableCount(Program program, Address vfTableBaseAddress) {

		Memory memory = program.getMemory();
		ReferenceManager referenceManager = program.getReferenceManager();
		FunctionManager functionManager = program.getFunctionManager();
		MemoryBlock textBlock = memory.getBlock(".text");
		MemoryBlock nepBlock = memory.getBlock(".nep");
		AddressSetView initializedAddresses = memory.getLoadedAndInitializedAddressSet();
		PseudoDisassembler pseudoDisassembler = new PseudoDisassembler(program);

		// Create pointers starting at the address until reaching a 0 pointer.
		// Terminate the possible table at any entry containing a cross reference that 
		// is beyond the first table entry and don't include it.
		int tableSize = 0;
		Address currentVfPointerAddress = vfTableBaseAddress;
		int defaultPointerSize = program.getDefaultPointerSize();
		while (true) {
			Address referencedAddress = getAbsoluteAddress(program, currentVfPointerAddress);
			if (referencedAddress == null) {
				break; // Cannot get a virtual function address.
			}
			if (referencedAddress.getOffset() == 0) {
				break; // Encountered 0 entry.
			}
			if (!initializedAddresses.contains(referencedAddress)) {
				break; // Not pointing to initialized memory.
			}

			// check in .text and .nep if either exists
			if (textBlock != null || nepBlock != null) {
				MemoryBlock refedBlock = memory.getBlock(referencedAddress);
				boolean inTextBlock = ((textBlock != null) && textBlock.equals(refedBlock));
				boolean inNepBlock = ((nepBlock != null) && nepBlock.equals(refedBlock));
				// if not in either labeled .text/.nep block, then bad vftable pointer
				if (!(inTextBlock || inNepBlock)) {
					break; // Not pointing to good section.
				}
			}

			// any non-computed source type references after the first one ends the table
			if (tableSize > 0 &&
				referenceIndicatesEndOfTable(referenceManager, currentVfPointerAddress)) {
				break;
			}

			Function function = functionManager.getFunctionAt(referencedAddress);

			if (function == null &&
				!pseudoDisassembler.isValidSubroutine(referencedAddress, true, false)) {
				break; // Not pointing to possible function.
			}

			tableSize++; // Count this entry in the table.

			// Advance to the next table entry address.
			currentVfPointerAddress = currentVfPointerAddress.add(defaultPointerSize);
		}
		return tableSize;
	}
Determines the number of vf addresses in the vf table that begins at the specified base 
address.
@param program the program whose memory is providing their addresses
@param vfTableBaseAddress the base address in the program for the vf table
@return the number of virtual function addresses in the vf table
Ghidra/Features/MicrosoftCodeAnalyzer/src/main/java/ghidra/app/cmd/data/rtti/RttiUtil.java