Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/modules/zanzarah/zanzarah.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,12 @@ namespace extractor
const auto block_offset = read_positive_or_zero_int32(stream);
const auto block_size = read_positive_int32(stream);

[[maybe_unused]] constexpr int32_t data_block_footer = 0x202;
[[maybe_unused]] constexpr int32_t data_block_header = 0x101;
constexpr int32_t header_size = sizeof(data_block_header);
constexpr int32_t footer_size = sizeof(data_block_footer);
constexpr int32_t attr_size = 4;

auto new_file = std::make_unique<file>();
new_file->path = path;
new_file->offset = block_offset + header_size;
// [0x101, data, 0x202], [0x101, data, 0x202], ...
// No idea why we should subtract next data block header, but apparently that's the right way
new_file->compressed_body_size_in_bytes = block_size - 2 * header_size - footer_size;
new_file->offset = block_offset + attr_size;
new_file->compressed_body_size_in_bytes = block_size - attr_size;
new_file->uncompressed_body_size_in_bytes = new_file->compressed_body_size_in_bytes;

files.push_back(std::move(new_file));
Expand Down