private AddressSet searchForByteArray(byte[] byteArray) throws CancelledException {

		AddressSet addressSet = new AddressSet();

		Address start = currentProgram.getMinAddress();
		Address found = find(start, byteArray);
		while (found != null) {
			monitor.checkCancelled();
			addressSet.add(found);
			start = found.add(1);
			found = find(start, byteArray);
		}

		return addressSet;
	}
Method to search for the given byte array and print the address(es) where it is found
@param byteArray the given byte array
@throws CancelledException if cancelled
Ghidra/Features/Base/ghidra_scripts/SearchForImageBaseOffsetsScript.java