Skip to content

Add Support for Parity Archives (PAR/PAR2) #1123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
qkaiser opened this issue Feb 11, 2025 · 0 comments · May be fixed by #1166
Open

Add Support for Parity Archives (PAR/PAR2) #1123

qkaiser opened this issue Feb 11, 2025 · 0 comments · May be fixed by #1166
Labels
format:archive format request Format support request by 3rd party. good first issue Good for newcomers

Comments

@qkaiser
Copy link
Contributor

qkaiser commented Feb 11, 2025

Description
Parchive, commonly known as PAR (v1) or PAR2, is a format for creating redundant data that helps detect and repair corrupted files. These archives typically accompany split-file sets (like multi-volume RAR or ZIP archives).

References

How to Craft

  1. Install par2cmdline (e.g., sudo apt-get install par2 on Debian/Ubuntu).
  2. Create a PAR2 set with:
    par2 create test.par2 file_to_protect
  3. You can verify it with:
    par2 verify test.par2

Magic Value / Signature

  • PAR2: Often begins with PAR2\0PKT (i.e., PAR2 + 0x00 + PKT).
  • PAR (v1): Older .par files don’t have a well-defined signature but may contain identifiable metadata blocks.

How to Extract / Decompress

  • Tool: Use par2cmdline for verification and recovery.
  • Python Library: There’s no widely adopted Python library for PAR2 extraction. Typically, par2cmdline is used.

Determining End Offset

  • Each PAR2 file is composed of multiple “packets.” Each packet header includes a length field.
  • Summing the lengths of these packets gives the total file size.
  • In unblob, parse the packet structure to find where each one ends and the next begins.
@qkaiser qkaiser added format request Format support request by 3rd party. format:archive good first issue Good for newcomers labels Feb 11, 2025
@qkaiser qkaiser added this to the Internship 2025 milestone Feb 11, 2025
@qkaiser qkaiser linked a pull request Apr 9, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format:archive format request Format support request by 3rd party. good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant