cab

Pure Rust library for reading and writing Windows cabinet (.cab) archive files.

Library
Cargo
v0.6.0
22stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
43/100Fair
Development Activity56
Maintenance24
Community20
Maturity60
Momentum12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture84
Code Quality82
Innovation72
Learning Curve78

Cab is a pure Rust library for reading and writing Windows cabinet (CAB) files, the archive format used by Windows installers and system packages. It parses the cabinet structure, exposes the contained folders and files, and supports the compression schemes commonly found in real-world cabinets.

The crate provides both a reader that streams entries out of an existing cabinet and a builder that assembles new cabinets from source data, handling MSZIP compression, file metadata, and datetime fields without any C dependencies.

What You Get

  • A Cabinet reader that parses cabinet structure and streams file contents
  • A builder API for assembling new cabinet archives from source files
  • MSZIP (deflate) compression and decompression support
  • Access to folders, file entries, attributes, and datetime metadata
  • Pure Rust implementation with no C or system dependencies
  • Checksum handling for cabinet integrity

Common Use Cases

  • Extracting files from Windows installer or driver cabinet archives
  • Programmatically building .cab files for packaging or distribution
  • Inspecting cabinet contents and metadata in cross-platform tooling
  • Decompressing MSZIP-compressed cabinet data in Rust services

Under The Hood

Architecture - The crate is split by cabinet concept: cabinet.rs drives reading, builder.rs handles writing, and supporting modules model the format’s pieces (folder.rs, file.rs, all_files.rs, ctype.rs, datetime.rs, checksum.rs, consts.rs), with mszip.rs and string.rs implementing compression and encoding details. lib.rs ties the public reader/builder surface together. Tech Stack - Pure Rust on edition 2024, depending on byteorder for binary parsing, flate2 (pure-Rust backend) for deflate, lzxd for LZX decompression, and time for datetime handling. Code Quality - The source is modular with a dedicated tests directory and example binaries; binary format parsing is centralized behind typed helpers rather than scattered byte math. API Design - The reader/builder split mirrors how developers think about consuming versus producing archives, and iterating folders and files uses idiomatic Rust iterators, keeping the common extract-and-list workflow concise.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search