| Crates.io | crabstep |
| lib.rs | crabstep |
| version | 0.3.2 |
| created_at | 2025-06-23 22:47:59.786258+00 |
| updated_at | 2025-08-29 18:41:36.829048+00 |
| description | Cross-platform, zero-dependency Apple/NeXTSTEP typedstream deserializer |
| homepage | |
| repository | https://github.com/ReagentX/crabstep |
| max_upload_size | |
| id | 1723638 |
| size | 1,212,695 |
crabstep is a Rust library that deserializes Apple's typedstream data into cross-platform data structures.
The typedstream format is a binary serialization protocol designed for C and Objective-C data structures. It is primarily used in Apple's Foundation framework, specifically within the NSArchiver and NSUnarchiver classes.
This library is available on crates.io.
Documentation is available on docs.rs.
use std::{env::current_dir, fs::File, io::Read};
use crabstep::TypedStreamDeserializer;
// Read the typedstream file into memory
let typedstream_path = current_dir()
.unwrap()
.as_path()
.join("path/to/typedstream/file");
let mut file = File::open(typedstream_path).unwrap();
let mut bytes = vec![];
file.read_to_end(&mut bytes).unwrap();
// Create a deserializer
let mut typedstream = TypedStreamDeserializer::new(&bytes);
// Iterate over the typedstream's properties
typedstream.iter_root()
.unwrap()
.for_each(|prop| println!("{:#?}", prop))
This crate is heavily leveraged by imessage-database's body module.
The typedstream format is derived from the data structure used by NeXTSTEP's NXTypedStream APIs.
typedstream dataTypedStreamDeserializer with resolve_properties iterator for exploring object graphsA blog post describing the reverse engineering of typedstream is available as an in-depth article.
