Skip to content

Commit 5da1751

Browse files
committed
Zanzarah: Fix unpacking (fixes #25)
1 parent 66a0069 commit 5da1751

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

src/modules/zanzarah/zanzarah.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,12 @@ namespace extractor
6565
const auto block_offset = read_positive_or_zero_int32(stream);
6666
const auto block_size = read_positive_int32(stream);
6767

68-
[[maybe_unused]] constexpr int32_t data_block_footer = 0x202;
69-
[[maybe_unused]] constexpr int32_t data_block_header = 0x101;
70-
constexpr int32_t header_size = sizeof(data_block_header);
71-
constexpr int32_t footer_size = sizeof(data_block_footer);
68+
constexpr int32_t attr_size = 4;
7269

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

8176
files.push_back(std::move(new_file));

0 commit comments

Comments
 (0)