goliath32.com - Creating a self booting ZIP archive
In an attempt to create a self-booting ZIP archive, a developer developed a ZIP file that contains its own source code necessary for building itself. The archive includes a file called boot/ZIPHEAD.COM, which contains executable code that runs when the archive is booted. To execute the ZIP archive, users need to modify the execute permissions of a file called mk.sh and run it in the same directory.
The archive also includes a boot loader that can be used to boot directly from a floppy disk, hard drive, or even a real floppy. The archive's creator also included a boot sector that loads additional code from the second sector, setting up high memory and protected mode. The ZIP file's first few bytes contain a valid ZIP local file header, followed by a Multiboot header with a Multiboot magic number.
The boot loader starts at offset 00000050, with the actual code beginning at offset 00000331. Unlike traditional file formats, ZIP files are read from the back, with the footer containing information about the directory and files. ZIP archives are designed to be read from the back, with a footer pointing to the central directory, which in turn points to the files.
ZIP files include a central directory listing all file headers and back references, as well as timestamps, CRC-32 checksums, and no attributes or permission bits. The ZIP format was initially designed to be split over multiple floppies, with the first few bytes containing a boot sector and a Multiboot header.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.