public ByteBlockInfo getByteBlockInfo(Address address) {

		if (!program.getMemory().contains(address)) {
			// this block set is out of date...eventually a new
			// ProgramByteBlockSetImpl will be created
			return null;
		}

		for (int i = 0; i < blocks.length; i++) {
			if (!memBlocks[i].contains(address)) {
				continue;
			}

			try {
				long off = address.subtract(memBlocks[i].getStart());
				BigInteger offset =
					(off < 0)
							? BigInteger.valueOf(off + 0x8000000000000000L)
									.subtract(
										BigInteger.valueOf(0x8000000000000000L))
							: BigInteger.valueOf(off);
				return new ByteBlockInfo(blocks[i], offset);
			}
			catch (Exception e) {
				return null;
			}
		}
		return null;
	}
Given an address, get the byte block info.
Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ProgramByteBlockSet.java