Skip to main content
100%

Dissecting ZIP file structure in Power Query M following explanation from https://users.cs.jmu.edu/buchhofp/forensics/formats/pkzip.html

✓ Published0🌍 Public
HHugoberry
Last edited Feb 22, 2017
Created on Feb 10, 2017

This example dissects the binary structure of ZIP files using Power Query’s M language, following the PKZIP format specification from James Madison University. It visually parses a ZIP file’s local file headers, central directory entries, and end-of-central-directory records, revealing metadata like compression method, timestamps, and file names. The code leverages `BinaryFormat` combinators—such as `BinaryFormat.Record`, `BinaryFormat.Choice`, and `BinaryFormat.List`—to sequentially read and interpret byte streams, with `Binary.Decompress` handling deflate decompression. The visualization highlights how raw bytes map to structured fields, making the format’s internal layout explicit. Data originates from a sample ZIP file provided as a binary input.

AI-generated description

Similar vizzes