segb-core 0.2.0

Panic-free reader for Apple SEGB container files (Biome streams) — decodes SEGB v1 and v2 records with state, timestamps, and raw protobuf payload; includes App.MenuItem protobuf field walker
Documentation
  • Coverage
  • 83.18%
    89 out of 107 items documented1 out of 31 items with examples
  • Size
  • Source code size: 79.98 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.25 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • SecurityRonin/segb-forensic
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • h4x0r

segb-core — panic-free reader for Apple SEGB container files.

What is SEGB?

SEGB is Apple's container format used by the Biome subsystem on macOS and iOS to store user-activity streams. Each Biome stream (e.g. ~/Library/Biome/streams/restricted/App.MenuItem/local) is a SEGB file whose records carry a state flag, one or two timestamps, and a raw protobuf payload.

Two variants exist:

Variant Magic location Header size Alignment
SEGB v1 Last 4 bytes of header (offset 52–55) 56 bytes 8 bytes
SEGB v2 First 4 bytes (offset 0–3) 32 bytes 4 bytes

Quick start

use std::fs::File;
use std::io::BufReader;
use segb::{read_segb, SegbRecord, menuitem::decode_app_menu_item};

let f = File::open("/path/to/App.MenuItem/local").unwrap();
let mut r = BufReader::new(f);
for record in read_segb(&mut r).unwrap() {
    let item = decode_app_menu_item(record.payload(), record.timestamp_unix()).unwrap();
    println!("{:?}{:?}", item.application, item.menu_item);
}

References