while (p != NULL && p < end) {
t = *p;
SZ_SKIP_BYTES(1);
+ msg_debug_archive ("7zip: read pack info %xc", t);
switch (t) {
case kSize:
break;
default:
p = NULL;
- msg_debug_archive ("bad 7zip type: %c; %s", t, G_STRLOC);
+ msg_debug_archive ("bad 7zip type: %xc; %s", t, G_STRLOC);
goto end;
break;
}
* }
*/
t = *p;
- SZ_SKIP_BYTES(1);
- sz = t & 0x7;
+ SZ_SKIP_BYTES (1);
+ sz = t & 0xF;
/* Codec ID */
+ tmp = 0;
+ for (i = 0; i < sz; i++) {
+ tmp <<= 8;
+ tmp += p[i];
+ }
+
+ msg_debug_archive ("7zip: read codec id: %L", tmp);
SZ_SKIP_BYTES (sz);
if (t & (1u << 4)) {
}
gint64 npacked = (gint64)ninstreams - (gint64)noutstreams + 1;
+ msg_debug_archive ("7zip: instreams=%L, outstreams=%L, packed=%L",
+ ninstreams, noutstreams, npacked);
if (npacked > 1) {
/* Gah... */
t = *p;
SZ_SKIP_BYTES(1);
+ msg_debug_archive ("7zip: read coders info %xc", t);
switch (t) {
case kFolder:
SZ_READ_VINT (num_folders);
+ msg_debug_archive ("7zip: nfolders=%L", num_folders);
+
if (*p != 0) {
/* External folders */
SZ_SKIP_BYTES(1);
guint64 tmp;
SZ_READ_VINT (tmp); /* Unpacked size */
+ msg_debug_archive ("7zip: unpacked size (folder=%d, stream=%d) = %L",
+ i, j, tmp);
}
}
else {
break;
default:
p = NULL;
- msg_debug_archive ("bad 7zip type: %c; %s", t, G_STRLOC);
+ msg_debug_archive ("bad 7zip type: %xc; %s", t, G_STRLOC);
goto end;
break;
}
t = *p;
SZ_SKIP_BYTES(1);
+ msg_debug_archive ("7zip: read substream info %xc", t);
+
switch (t) {
case kNumUnPackStream:
for (i = 0; i < num_folders; i ++) {
break;
default:
p = NULL;
- msg_debug_archive ("bad 7zip type: %c; %s", t, G_STRLOC);
+ msg_debug_archive ("bad 7zip type: %xc; %s", t, G_STRLOC);
goto end;
break;
}
while (p != NULL && p < end) {
t = *p;
SZ_SKIP_BYTES(1);
+ msg_debug_archive ("7zip: read main streams info %xc", t);
/*
*
break;
default:
p = NULL;
- msg_debug_archive ("bad 7zip type: %c; %s", t, G_STRLOC);
+ msg_debug_archive ("bad 7zip type: %xc; %s", t, G_STRLOC);
goto end;
break;
}
t = *p;
SZ_SKIP_BYTES (1);
+ msg_debug_archive ("7zip: read file data type %xc", t);
+
if (t == kEnd) {
goto end;
}
break;
default:
p = NULL;
- msg_debug_archive ("bad 7zip type: %c; %s", t, G_STRLOC);
+ msg_debug_archive ("bad 7zip type: %xc; %s", t, G_STRLOC);
goto end;
break;
}
SZ_SKIP_BYTES(1);
+ msg_debug_archive ("7zip: read section %xc", t);
+
switch (t) {
case kHeader:
/* We just skip byte and go further */
case kFilesInfo:
p = rspamd_7zip_read_files_info (task, p, end, arch);
break;
+ case kEnd:
+ p = NULL;
+ msg_debug_archive ("7zip: read final section");
+ break;
default:
p = NULL;
- msg_debug_archive ("bad 7zip type: %c; %s", t, G_STRLOC);
+ msg_debug_archive ("bad 7zip type: %xc; %s", t, G_STRLOC);
break;
}