/catibo

Rust implementation of the CTB/CBDDLP/PHZ 3d printing file formats.

Primary LanguageRustBSD 2-Clause "Simplified" LicenseBSD-2-Clause

Catibo: read/write/analyze CTB, CBDDLP, and PHZ files

Catibo is a Rust crate for working with the file formats used by low-end resin 3D printers like the Elegoo Mars, CREALITY LD-002R, and Phrozen Sonic Mini. It provides a low-level API for manipulating these files and a set of command line tools.

Catibo is the result of reverse engineering of files produced for those printers, and is not sanctioned or supported by printer manufacturers or the authors of the proprietary printer control software. To my knowledge, it contains the first known decoding and implementation of:

  • Several newly decoded fields in the files,
  • The format of the preview images stored in the files,
  • The PHZ headers.
  • The encryption algorithm used in CTB and PHZ files.

catibo-convert

The catibo-convert tool is included as an example. It can convert between the ctb, cbddlp, and phz formats, clear data from reserved areas of files, and add or remove encryption. It can't currently produce antialiased CBDDLP files from CTB files, because antialiased CBDDLP is really unnecessarily complex and I ran out of steam.

Converting files between printer formats is merely a demonstration that the decodings work, and isn't very useful in day to day life.

Example:

# Strip encryption
$ cargo run --bin catibo-convert -- --key=0 input.ctb input-decrypted.ctb
# Converting between formats
$ cargo run --bin catibo-convert input.ctb output.cbddlp

catibo-inspect

The catibo-inspect tool helps reverse engineering by printing parsed headers from supported file types. If you'd like far too much information about the contents of a file, but don't want to spend hours squinting at a hexdump, this tool may be of interest.