Rar Format
Use this skill for RAR container-format work. It provides a local, SharpCompress-oriented reference for RAR 5.0 archive blocks, older RAR header compatibility, UnRAR source behavior, and current SharpCompress Rar implementation boundaries.
Reference
- Read references/rar-format.md when the task depends on RAR binary layout, RAR4 vs RAR5 signatures, RAR5 vint encoding, block/header flags, file and service header fields, extra records, encrypted headers, solid archives, split volumes, redirection records, or current SharpCompress Rar support boundaries.
- Treat the reference as an implementation guide, not a standards replacement. It summarizes
reference/RAR 5.0 archive format.htmand selected files underreference/unrar/, especiallyheaders5.hpp,headers.hpp,arcread.cpp,rawread.*,crypt*.cpp,qopen.*,volume.*,recvol*.cpp,unpack*.cpp, andblake2sp.*. - Prefer the SharpCompress support matrix in the reference over generic RAR assumptions when changing code. RAR is a read-only format in SharpCompress, and metadata/service-header support is intentionally partial.
Workflow
- Identify which layer is involved: signature detection, RAR4 headers, RAR5 headers, vint parsing, block flags, extra records, file/service metadata, encrypted headers, multivolume handling, decompression, reader/archive API behavior, or tests.
- Open the relevant section in
references/rar-format.mdand use the source-file pointers before changing code. - For header parsing changes, cross-check sync and async implementations:
MarkHeader.cs,RarHeader.cs,RarHeaderFactory.cs,FileHeader.cs,Flags.cs, and their async counterparts. - For extraction changes, verify split and solid archive behavior with
RarArchive,RarReader,RarStream, and the unpacker files undersrc/SharpCompress/Compressors/Rar/. - For support claims, keep unsupported or partial features explicit: RAR writing, pre-RAR4 archives, complete service-header semantics, quick-open use, recovery reconstruction, and encryption/version constraints.