public static boolean testExtraction(BinaryReader reader, CartV1File cartFile, byte[] arc4Key)
			throws IOException, CartInvalidCartException, CartInvalidARC4KeyException,
			CancelledException {
		if (cartFile.getDataOffset() <= 0) {
			throw new CartInvalidCartException("Bad CaRT payload data offset");
		}

		int length = (int) (cartFile.getPackedSize());

		// limit the length being used to just the first 64 bytes
		if (length > 64) {
			length = 64;
		}

		byte[] encryptedAndCompressedData = reader.readByteArray(cartFile.getDataOffset(), length);

		byte[] compressedData = CartV1Decryptor.decrypt(arc4Key, encryptedAndCompressedData);

		if (compressedData != null) {
			// Trim down to the first two bytes for comparison
			compressedData = Arrays.copyOfRange(compressedData, 0, 2);

			for (byte[] zlibBytes : CartV1Constants.ZLIB_HEADER_BYTES) {
				// On the first match, return true
				if (Arrays.equals(compressedData, zlibBytes)) {
					return true;
				}
			}
		}

		// If data didn't decompress or we didn't find matching header bytes then return
		// false
		return false;
	}
Test that the first two bytes of the CaRT payload data decrypts to a valid
ZLIB prefix.

@param reader   The little-endian binary reader from with to read
@param cartFile The CaRT file being read
@param arc4Key  The ARC4 key being tested.
@return True if decryption of the first 64 bytes succeeds and the first two
        bytes match zlib header bytes.
@throws IOException                 If there is a failure to read the data.
@throws CartInvalidCartException    If there is a format error to the data
@throws CartInvalidARC4KeyException If the decryption fails.
@throws CancelledException          If the user cancels the UI. For this function the UI
                                    isn't shown so this isn't expected to happen.
Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/cart/CartV1PayloadExtractor.java