private static Address findAddressSpaceMax(Memory memory, Address minAddr) {
		if (minAddr == null) {
			return null;
		}
		AddressSpace space = minAddr.getAddressSpace();
		Address maxAddr = null;
		for (AddressRange range : memory.getAddressRanges()) {
			if (!range.getAddressSpace().equals(space)) {
				continue;
			}
			Address rangeEnd = range.getMaxAddress();
			if (rangeEnd.compareTo(minAddr) >= 0 &&
				(maxAddr == null || rangeEnd.compareTo(maxAddr) >= 0)) {
				maxAddr = rangeEnd;
			}
		}
		return maxAddr;
	}
Returns the address range of the bytes of this provider.

@return address range of first byte to last byte of this provider
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/MemoryByteProvider.java