Skip to content

hymkor/uncozip

Repository files navigation

uncozip

License Go Reference

This is a command and package to UNzip COrrupted ZIP files that do not have central directory records.

Even when an archive is so large that zip -FF Corrupted.zip --out New.zip fails, uncozip sometimes succeeds. (For example, when Corrupted.zip is larger than 4 GB.)

uncozip is also useful on non-Windows systems for unpacking archives that contain filenames encoded in non-UTF8 encodings such as Shift_JIS. (Example: uncozip -decode Shift_JIS foo.zip)

Usage

uncozip {OPTIONS} ZIPFILENAME [list...]

uncozip {OPTIONS} - [list...] < ZIPFILENAME

uncozip {OPTIONS} < ZIPFILENAME
  • -d string Directory to extract into
  • -debug Enable debug output
  • -strict Quit immediately on CRC error
  • -t Test CRC32 only
  • -decode IANA-NAME Specify an IANA-registered name used to decode filenames when the UTF-8 flag is not set (for example: -decode Shift_JIS)

Install

Download the binary package from the Releases page and extract the executable.

For scoop

scoop install https://raw.githubusercontent.com/hymkor/uncozip/master/uncozip.json

or

scoop bucket add hymkor https://github.com/hymkor/scoop-bucket
scoop install uncozip

package "github.com/hymkor/uncozip"

Unlike the standard archive/zip package, uncozip can:

  • read an archive from an io.Reader (archive/zip requires the archive's filename1 or an io.ReaderAt plus the size2)
  • handle encrypted archives (you need to call [RegisterPasswordHandler])
  • decode filenames using any encoding (you need to call [RegisterNameDecoder])

Footnotes

  1. See also https://pkg.go.dev/archive/zip#OpenReader

  2. See also https://pkg.go.dev/archive/zip#NewReader

About

UNzip COrrupted ZIP files that do not have central directory records.

Topics

Resources

License

Stars

Watchers

Forks