commit abac85a73f6244d1e8105320ac092d146a207c4b from: Omar Polo date: Sat Aug 21 11:03:36 2021 UTC typo commit - a15a77bc02a62ad3aeb926b630f9cd34b5edb8e2 commit + abac85a73f6244d1e8105320ac092d146a207c4b blob - 09784a8f637c32bd9b6036ef8bb6aa1c2dd7149f blob + 9e4cbab17f06d8de91f87a17421e5795dafa3676 --- resources/posts/extracting-from-zips.gmi +++ resources/posts/extracting-from-zips.gmi @@ -1,4 +1,4 @@ -=> /posts/inspecting-zips.gmi The first part “Inspecting zip files” +=> /post/inspecting-zips.gmi The first part “Inspecting zip files” Now that we know how to navigate inside a zip file let’s see how to extract files from it. But before looking into the decompression routines (spoiler: we’ll need zlib, so make sure it’s installed) we need to do a bit of refactoring, the reason will be clear in a second. @@ -22,7 +22,7 @@ next(uint8_t *zip, size_t len, uint8_t *entry) next = entry + 46 + flen + xlen + clen; end = zip + len; if (entry >= end - 46 || - memcmp(entry, "\x50\x4b\x01\x02", 0) != 0) + memcmp(entry, "\x50\x4b\x01\x02", 4) != 0) return NULL; return next; }