public void extract(TaskMonitor monitor) throws CancelledException, IOException {

		monitor.setMessage("Reading CaRT data");

		ByteProviderWrapper subProvider = new ByteProviderWrapper(reader.getByteProvider(),
			cartFile.getDataOffset(), cartFile.getPackedSize());
		InputStream is = subProvider.getInputStream(0);
		CartV1StreamHasher hashedInputStream = null;
		try {
			is = new CartV1StreamDecryptor(is, cartFile.getDecryptor().getARC4Key());
			is = new CartV1StreamDecompressor(is);

			hashedInputStream = new CartV1StreamHasher(is, cartFile);
		}
		catch (NoSuchAlgorithmException | CartInvalidCartException e) {
			throw new IOException(e);
		}

		FSUtilities.streamCopy(hashedInputStream, tempFos, monitor);

		monitor.setMessage("Checking hashes...");
		try {
			hashedInputStream.checkHashes();
		}
		catch (CartInvalidCartException e) {
			throw new IOException("Invalid CaRT ARC4 hashes: " + e.getMessage());
		}
	}
Callback to perform actual extraction of CaRT payload data to the output
stream.

@param monitor Monitor for status messages and cancellation
@throws CancelledException If the extraction is cancelled
@throws IOException        If an error occurs with the data, CaRT format, or
                           hashes.
Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/cart/CartV1PayloadExtractor.java