public List<Address> getVftablesContaining(Function function) throws CancelledException {

		ReferenceManager refMan = program.getReferenceManager();
		List<Address> vftableAddresses = new ArrayList<Address>();

		Address[] functionThunkAddresses = function.getFunctionThunkAddresses(true);

		// add any thunk addresses to the list
		List<Address> functionAddresses = new ArrayList<Address>();

		// add the function itself to the list
		functionAddresses.add(function.getEntryPoint());
		if (functionThunkAddresses != null) {
			// add any thunk addresses to the list
			functionAddresses.addAll(Arrays.asList(functionThunkAddresses));
		}

		if (functionThunkAddresses != null) {
			functionAddresses.addAll(Arrays.asList(functionThunkAddresses));
		}

		for (Address address : functionAddresses) {
			monitor.checkCancelled();

			ReferenceIterator referencesTo = refMan.getReferencesTo(address);

			while (referencesTo.hasNext()) {
				monitor.checkCancelled();

				Reference referenceTo = referencesTo.next();
				if (referenceTo.getReferenceType() != RefType.DATA) {
					continue;
				}

				Address ref = referenceTo.getFromAddress();

				Data dataContaining = api.getDataContaining(ref);
				if (dataContaining == null) {
					continue;
				}

				Address vftableAddress = dataContaining.getAddress();

				Symbol vftableSymbol = api.getSymbolAt(vftableAddress);
				if (vftableSymbol == null || !vftableSymbol.getName().contains("vftable")) {
					continue;
				}

				if (!vftableAddresses.contains(vftableAddress)) {
					vftableAddresses.add(vftableAddress);
				}
			}
		}

		return vftableAddresses;

	}
Return a list of data items that have labels containing "vftable" and refer to the given
function
@param function the given function
@return a list of vftable data addresses that contain references to the given function and
have label containing text "vftable"
@throws CancelledException if cancelled
Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java