@Override
	public AddressSet getAddressSet(ByteBlockSelection selection) {
		AddressSet addrSet = new AddressSet();

		for (int i = 0; i < selection.getNumberOfRanges(); i++) {
			ByteBlockRange br = selection.getRange(i);
			ByteBlock block = br.getByteBlock();
			Address start = getAddress(block, br.getStartIndex());
			Address end = getAddress(block, br.getEndIndex());
			addrSet.add(new AddressRangeImpl(start, end));
		}
		return addrSet;
	}
Given an address, get the byte block info.
Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ProgramByteBlockSet.java