public InstructionMetadata search(ProgramPlugin plugin, AddressRange searchBounds,
			TaskMonitor taskMonitor, boolean forwardSearch) {

		if (plugin == null || plugin.getCurrentProgram() == 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(
					plugin.getCurrentProgram().getMinAddress()) < 0 ||
			searchBounds.getMaxAddress()
					.compareTo(
						plugin.getCurrentProgram().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())) {
			if (forwardSearch) {
				return searchForward(plugin, searchBounds, taskMonitor, maskContainer);
			}

			return searchBackward(plugin, searchBounds, taskMonitor, maskContainer);

		}

		return null;
	}
Searches through instructions in the given program for a specific byte
pattern. If found, returns the instruction. i

@param program the program to search
@param searchBounds the addresses to search
@param taskMonitor the task monitor
@param forwardSearch if true, search through addresses forward
@throws IllegalArgumentException if there's a problem parsing addresses
@return the instruction, or null if not found
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/model/InstructionSearchData.java