sticklerm3 / homebrew-pourhouse

My homebrew tap, serving up casks from EclecticLightCo!
https://sticklerm3.github.io/homebrew-pourhouse/
BSD 2-Clause "Simplified" License
117 stars 8 forks source link

Alias/bookmark data structure? #129

Open danielbayley opened 5 months ago

danielbayley commented 5 months ago

Hey @sticklerm3, just wondering if you could hopefully offer me some insight into how I can more accurately parse the raw binary data from a macOS alias/bookmark? This is with Node, using JavaScript fs.createReadStream, and a DataView operating on the Uint8Array (unsigned 8-bit integer TypedArray) buffer… I can scan the book....mark.... signature chunk no problem, and sort of hack together the file path elements a bit later in the stream, although it’s not clear where that section consistently ends, exactly…

I found conflicting (probably outdated) information about endianess and offsets:

https://mac-alias.readthedocs.io/en/latest/alias_fmt.html https://metacpan.org/release/AJNN/Mac-Alias-1.01/view/lib/Mac/Alias/Format.pod

As with their stance on repairing/replacing things on their hardware, Apple doesn’t make things easy to reverse-engineer…