A tool to fix corrupted or incomplete zip files and extract their contents.
- Attempts to repair corrupted ZIP files by finding file signatures
- Recovers files from ZIP archives even when the central directory is damaged
- Extracts files from both original and repaired ZIP archives
- Simple command-line interface
- Python 3.6 or higher
# Basic usage
python zipfix.py your_corrupted_file.zip
# Specify output directory for extracted files
python zipfix.py your_corrupted_file.zip -o extracted_files
# Specify path for the fixed zip file
python zipfix.py your_corrupted_file.zip -f fixed.zip
# Only attempt to repair without extracting
python zipfix.py your_corrupted_file.zip --repair-only
# Only attempt to extract without repairing
python zipfix.py your_corrupted_file.zip --extract-onlyZipFix works by:
- First attempting a normal extraction with the Python zipfile module
- If that fails, scanning the file for ZIP signatures to locate file entries
- Reconstructing the ZIP file structure based on file headers
- Creating a new, fixed ZIP file with the recoverable content
- Extracting files from the repaired archive
python zipfix.py incomplete_download.zippython zipfix.py damaged_archive.zip --extract-only -o recovered_filespython zipfix.py broken.zip --repair-only -f repaired.zip