2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-12-06 03:07:48 +00:00

chore: dump fastfile data when xenon t6 fastfile is detected

This commit is contained in:
Jan Laupetin
2025-08-19 13:22:39 +02:00
parent facb95f1cb
commit 802b0f244a
19 changed files with 226 additions and 152 deletions

View File

@@ -2,10 +2,12 @@
#include "XChunkException.h"
#include <format>
#include <iostream>
#include <zlib.h>
#include <zutil.h>
size_t XChunkProcessorInflate::Process(int streamNumber, const uint8_t* input, const size_t inputLength, uint8_t* output, const size_t outputBufferSize)
size_t XChunkProcessorInflate::Process(unsigned streamNumber, const uint8_t* input, const size_t inputLength, uint8_t* output, const size_t outputBufferSize)
{
z_stream stream{};
stream.zalloc = Z_NULL;
@@ -23,7 +25,10 @@ size_t XChunkProcessorInflate::Process(int streamNumber, const uint8_t* input, c
ret = inflate(&stream, Z_FULL_FLUSH);
if (ret != Z_STREAM_END)
throw XChunkException("Zone has invalid or unsupported compression. Inflate failed");
{
std::cerr << std::format("inflate of stream failed with error code {}: {}\n", streamNumber, ret, stream.msg);
throw XChunkException(std::format("Zone has invalid or unsupported compression: {}", stream.msg));
}
const size_t outputSize = stream.total_out;