Kaitai Struct is really great. I've used it several times over the years to quickly pull in a parser that I'd otherwise have to hand-roll (and almost certainly get subtly wrong).

Their reference parsers for Mach-O and DER work quite nicely in abi3audit[1].

[1]: https://github.com/pypa/abi3audit/tree/main/abi3audit/_vendo...