public void search(Program program, AddressSetView searchSet, TaskMonitor monitor)
			throws CancelledException {
		if (root == null) {
			root = SequenceSearchState.buildStateMachine(patternList);
		}

		numToSearch = getNumToSearch(program, searchSet);
		monitor.setMessage(searchName + " Search");
		monitor.initialize(numToSearch);

		MemoryBlock[] blocks = program.getMemory().getBlocks();
		for (MemoryBlock block : blocks) {
			monitor.setProgress(numSearched);
			// check if entire block has anything that is searchable
			if (!block.isInitialized()) {
				continue;
			}
			if (doExecutableBlocksOnly && !block.isExecute()) {
				continue;
			}
			if (searchSet != null && !searchSet.isEmpty() &&
				!searchSet.intersects(block.getStart(), block.getEnd())) {
				continue;
			}

			try {
				searchBlock(root, program, block, searchSet, monitor);
			}
			catch (IOException e) {
				Msg.error(this, "Unable to scan block " + block.getName() + " for " + searchName);
			}
			numSearched += block.getSize();
		}
	}
Search initialized memory blocks for all patterns(bytes/mask/action).
Call associated action for each pattern matched.

@param program to be searched
@param searchSet set of bytes to restrict search, if null or empty then search all memory blocks
@param monitor allow canceling and reporting of progress

@throws CancelledException if canceled
Ghidra/Features/Base/src/main/java/ghidra/util/bytesearch/MemoryBytePatternSearcher.java