public List<InstructionMetadata> search(Program program, AddressRange searchBounds,
			TaskMonitor taskMonitor) throws IllegalArgumentException {

		List<InstructionMetadata> searchResults = new ArrayList<>();

		if (program == null) {
			throw new IllegalArgumentException("Program provided to search is null");
		}

		// Do a quick check to make sure the search bounds are within the bounds of the 
		// program.
		if (searchBounds.getMinAddress().compareTo(program.getMinAddress()) < 0 ||
			searchBounds.getMaxAddress().compareTo(program.getMaxAddress()) > 0) {
			throw new IllegalArgumentException(
				"Search bounds are not valid; must be within the bounds of the program.");
		}

		MaskContainer maskContainer = this.getAllMasks();

		if (InstructionSearchUtils.containsOnBit(maskContainer.getMask())) {
			Memory mem = program.getMemory();

			// Get the min and max address positions - we'll use these
			// for iterating.
			Address currentPosition = searchBounds.getMinAddress();
			Address endAddress = searchBounds.getMaxAddress();

			while (currentPosition.compareTo(endAddress) < 0) {

				// Search program memory for the given mask and val.
				currentPosition = mem.findBytes(currentPosition, endAddress,
					maskContainer.getValue(), maskContainer.getMask(), true, taskMonitor);

				// If no match was found, currentPosition will be null.
				if (currentPosition == null) {
					break;
				}

				// Otherwise construct a new entry to put in our results table.
				MaskContainer masks =
					new MaskContainer(maskContainer.getMask(), maskContainer.getValue());
				InstructionMetadata temp = new InstructionMetadata(masks);
				temp.setAddr(currentPosition);
				searchResults.add(temp);

				// And update the position pointer so we'll process the next item.
				currentPosition = currentPosition.next();
			}
		}

		return searchResults;
	}
Searches the given program for a specific byte pattern, returning all
found results

@param program the program to search
@param searchBounds the addresses to search
@param taskMonitor the task monitor
@throws IllegalArgumentException if there's a problem parsing addresses
@return list of found instructions
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/model/InstructionSearchData.java