LinuxCommandLibrary

zipdetails

Display detailed information about zip archives

SYNOPSIS

zipdetails [options] <zipfile>

PARAMETERS

-v
    Show verbose output, including more detailed information about structures.

-s
    Show the contents of specific structures within the ZIP file.

-l
    Show the exact byte location (offset) of structures within the ZIP file.

-e
    Show the contents of extra fields associated with file entries and central directory records.

-c
    Show the uncompressed contents of file entries. Be cautious with large files as it prints to stdout.

-p
    Show the contents of password-protected entries. The command will prompt for the password interactively.

-d
    Attempt to decrypt contents if they are encrypted. This requires the Crypt::Zip Perl module and the correct password.

-P password
    Provide the password on the command line. Note that this is less secure as the password may be visible in process listings.

-z
    Do not verify the CRC (Cyclic Redundancy Check) of uncompressed data. Useful for inspecting malformed archives.

-o offset
    Start reading the ZIP file from a specific byte offset. Useful for embedded ZIP archives or concatenated files.

-L
    List all possible command-line options and their descriptions, then exit.

-m num
    Show a maximum of num bytes when displaying data or content, preventing excessive output for large sections.

-x structure_type,...
    Exclude specified structure types from the output. Possible types include local, cdir, eocd, data, info, all, name, extra, comment.

DESCRIPTION

zipdetails is a powerful Perl script designed to meticulously display the internal structure of a ZIP file. Unlike simpler tools like unzip -v that provide a high-level list of files, zipdetails delves deep into the various low-level headers and records that constitute a ZIP archive. It can reveal details about the local file headers (which precede each compressed file entry), the central directory (a comprehensive index of all files, typically found at the end of the archive), and the end of central directory record. This capability makes it an invaluable utility for anyone needing to debug corrupted ZIP files, gain a deeper understanding of the official ZIP file format specification, or analyze how different software applications construct ZIP archives. It can precisely show byte offsets, sizes, compression flags, and even portions of the actual compressed data and extended fields, providing an x-ray view into the archive's internals.

CAVEATS

zipdetails is implemented as a Perl script, requiring a Perl interpreter to be installed on the system.
The decryption functionality via the -d option depends on the Crypt::Zip Perl module, which may need to be installed separately via CPAN or your distribution's package manager.
Providing passwords directly on the command line using -P is generally insecure, as the password could be exposed in system process lists (e.g., `ps`).

UNDERSTANDING ZIP FILE STRUCTURE

zipdetails is an indispensable tool for anyone seeking a deep understanding of the intricate ZIP file format. It provides a visual breakdown of elements like the local file headers (for individual entries), the central directory (a master index of all files and their attributes, typically at the end of the archive), and the end of central directory record (marking the end of the archive). This tool brings these normally hidden structural components to light, making complex format details accessible.

DEBUGGING CORRUPTED ARCHIVES

When a ZIP file exhibits unexpected behavior, is unreadable by standard tools, or is suspected of corruption, zipdetails can be instrumental in diagnosis. By revealing the byte-level details of each section, it can help identify missing, malformed, or incorrect headers and records, thereby aiding in the understanding of the corruption and potential strategies for repair or data recovery.

HISTORY

zipdetails is distributed as part of the Archive::Zip Perl module, a comprehensive library for creating, manipulating, and reading ZIP archives programmatically. Its development is intrinsically linked to this module's evolution within the Perl ecosystem. It has served as a robust diagnostic utility for low-level ZIP file inspection for a significant period, providing a crucial command-line tool for developers and system administrators working with ZIP data, particularly for debugging and format analysis.

SEE ALSO

zip(1), unzip(1), jar(1), 7z(1)

Copied to clipboard