#archive #caff

caff-archive

a library for manipulating CAFF archives

1 unstable release

0.1.0 Nov 28, 2023

#1434 in Parser implementations

Download history 44/week @ 2023-11-28 10/week @ 2023-12-05 7/week @ 2023-12-12 8/week @ 2023-12-19 10/week @ 2023-12-26 7/week @ 2024-01-02 6/week @ 2024-01-09 8/week @ 2024-01-16 5/week @ 2024-01-23 8/week @ 2024-01-30 12/week @ 2024-02-06 21/week @ 2024-02-13 37/week @ 2024-02-20

78 downloads per month
Used in 2 crates (via orphism)

MIT license

32KB
949 lines

caff-archive Latest Version

What is it?

A library for working with binary CAFF archives. This is the format used for .cmo3 and .can3 files.

How do I obtain this majestic tool?

Run the following Cargo command in your project directory (assuming you have cargo-edit installed):

cargo add caff-archive

Or add the following line to your Cargo.toml (in the [dependencies] array):

caff-archive = "^ 0.1"

How do I use it?

fn main() {
  let mut file = File::open(&archive).expect("failed to open archive for reading");
  let mut archive = caff_archive::Archive::read(&mut file).expect("failed to read archive from input data");
}

Optional Features

  • logging enables tracing and debugging logs when reading and writing archives.
  • discovery implies logging and enables additional logging of potentially interesting scenarios, from the perspective of this library. It will report things like raw values that were parsed into fallback values in enums, or data sections that are expected to be padding but contain non-zero bytes, along with different potential ways those bytes could be parsed, among other things.

How was this made?

  • Carefully, without using or referencing any code or libraries from the format vendor.
  • The ImHex highlighting patterns from the MOC3ingbird Exploit (CVE-2023-27566) was instrumental in understanding this format.
  • The discovery process for undocumented binary formats is described here.

License

caff-archive is available under the MIT License. See LICENSE.txt for the full text.

While the license is short, it's still written in fancy lawyer-speak. If you prefer more down-to-earth language, consider the following:

  • tl;drLegal has a simple visual summary available here.
  • FOSSA has a more in-depth overview available here.

Dependencies

~1.5MB
~36K SLoC