private static void findBytePattern(Memory memory, List<MemoryBlock> blocks, byte[] bytePattern,
			int alignment, Set<Address> foundList, TaskMonitor monitor) throws CancelledException {

		byte maskBytes[] = null;

		if (blocks == null) {
			blocks = Arrays.asList(memory.getBlocks());
		}

		for (MemoryBlock memBlock : blocks) {
			if (!memBlock.isInitialized()) {
				continue;
			}

			Address start = memBlock.getStart();
			Address end = memBlock.getEnd();
			while (true) {
				monitor.checkCancelled();

				Address found = memory.findBytes(start, end, bytePattern, maskBytes, true, monitor);
				if (found == null) {
					break;
				}

				start = found.add(1);
				if ((found.getOffset() % alignment) == 0) {
					foundList.add(found);
				}
			}
		}
	}
Checks a programs memory for 32 bit image base offset references to the address 
indicated.  These relative references are only found at addresses that match the 
indicated alignment. 

@param program the program whose memory is to be checked.
@param alignment 32 bit image base offset relative references are to only be found 
at the indicated alignment in memory.
@param toAddress address that we are interested in finding references to.
@param monitor a task monitor for progress or to allow canceling.
@return list of addresses with 32 bit image base offset relative references to the 
toAddress

@throws CancelledException if the user cancels via the monitor.
Ghidra/Features/Base/src/main/java/ghidra/program/util/ProgramMemoryUtil.java