@Override
	protected List<Loaded<Program>> loadProgram(ByteProvider provider, String programName,
			Project project, String programFolderPath, LoadSpec loadSpec, List<Option> options,
			MessageLog log, Object consumer, TaskMonitor monitor)
			throws IOException, CancelledException {

		LanguageCompilerSpecPair pair = loadSpec.getLanguageCompilerSpec();
		Language language = getLanguageService().getLanguage(pair.languageID);
		CompilerSpec compilerSpec = language.getCompilerSpecByID(pair.compilerSpecID);

		Address imageBaseAddr = language.getAddressFactory()
				.getDefaultAddressSpace()
				.getAddress(loadSpec.getDesiredImageBase());

		Program program = createProgram(provider, programName, imageBaseAddr, getName(), language,
			compilerSpec, consumer);
		List<Loaded<Program>> loadedList =
			List.of(new Loaded<Program>(program, programName, programFolderPath));

		int transactionID = program.startTransaction("Loading");
		boolean success = false;
		try {
			load(provider, loadSpec, options, program, monitor, log);
			createDefaultMemoryBlocks(program, language, log);
			success = true;
			return loadedList;
		}
		finally {
			program.endTransaction(transactionID, true); // More efficient to commit when program will be discarded
			if (!success) {
				release(loadedList, consumer);
			}
		}
	}
Loads bytes in a particular format into the given {@link Program}.

@param provider The bytes to load.
@param loadSpec The {@link LoadSpec} to use during load.
@param options The load options.
@param program The {@link Program} to load into.
@param monitor A cancelable task monitor.
@param log The message log.
@throws IOException if there was an IO-related problem loading.
@throws CancelledException if the user cancelled the load.
Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/AbstractProgramWrapperLoader.java