binarycookies 0.1.3

A package reader for Mac os cookie file
Documentation
  • Coverage
  • 0%
    0 out of 10 items documented0 out of 0 items with examples
  • Size
  • Source code size: 23.46 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.95 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
  • findre/binarycookies-reader
    5 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • findre

About Binarycookies-Reader

binarycookies is a library for decoding .binarycookies files from Safari or WebKit.

The Safari cookies file, also known as the Safari binary cookies file (Cookies.binarycookies) format

More info: https://github.com/libyal/dtformats/blob/main/documentation/Safari%20Cookies.asciidoc

Github

https://github.com/findre/binarycookies-reader

About Errors

  • InvalidIndexOverBounds: cover index out of bounds, format error, cookie version invalid?
  • InvalidSignature: cookie file must start with 'cook'
  • InvalidStartCode: start code start with '[0x00, 0x00, 0x00, 0x00]'
  • EndCodeError
  • EndHeaderCodeError
  • DataOverSize
  • SystemIOError: when use 'new' fuction, cover io error

How to use

1. use 'from_vec' function

use std::{fs::File, io::Read};
use binary_cookies::BinaryCookiesReader;

fn main() {
    let mut target = File::open("/Users/foo/Library/HTTPStorages/boo.binarycookies").unwrap();
    let mut data = Vec::new();
    let _ = target.read_to_end(&mut data).unwrap();
    let mut d = BinaryCookiesReader::from_vec(&data);
    let _ = d.decode().unwrap();
    for pages in d.origin_pages() {
        for cookie in pages.cookies() {
            println!("{} | {} | {} | {}", cookie.domain_str(), cookie.name_str(), cookie.value_str(), cookie.http_only);
        }
    }
}

2. use 'new' function

use binary_cookies::BinaryCookiesReader;

fn main() {
    let target = String::from("/Users/foo/Library/HTTPStorages/boo.binarycookies");
    let mut dec = BinaryCookiesReader::new(&target).unwrap();
    let _ = d.decode().unwrap();
    for pages in d.origin_pages() {
        for cookie in pages.cookies() {
            println!("{} | {} | {} | {}", cookie.domain_str(), cookie.name_str(), cookie.value_str(), cookie.http_only);
        }
    }
}