> This entire genre of tools has been a long time point of interest for me.
Same for me! It turned into a long journey and I am working on a solution that I am very happy about. I am yet to announce it publicly, but i been meaning to for so long already.
If you would like to check it out I would be happy!
You can use it to map / view content from a format there is a template for. Alot of common formats is already included and you can extend it using your own templates.
Re:Fq: Jq for Binary Formats
by joshspankit on Saturday June 03, 2023 @06:18PM
(#36181058)
As someone who had a great time with Kaitai, may I suggest that you write an interface so that fq can be used with any format that Kaitai understands (and any that people add in future)
Re:Fq: Jq for Binary Formats
by mindv0rtex on Sunday June 04, 2023 @08:14PM
(#36190816)
The functionality that I am personally interested in from a binary parsing framework like Kaitai is generating an encoder implementation in addition to a decoder one. In other words, given a description of a binary format, I would like to be able to construct an instance of a class whose memory layout matches the format. For instance, if the format has an int n, then an array `a` of size `n`, and then a double `d`, it would be awesome to be able to construct a corresponding object with fields `n`, `a` and `d` and when I change `n`, then the size of `a` changes accordingly. And then, if I pass a pointer to this object to the decoder, it would be able to parse it correctly, as if the memory representation of the object came from some external buffer.
Kaitai support for serialization has been a long time issue. It's obviously non-trivial given that it has at least one case that doesn't exist today (instantiating a structure without loading any existing data.)
That said, it does exist in some form.
https://doc.kaitai.io/serialization.html
Restruct supports serialization. I use it all the time to hack on proprietary formats.
This entire genre of tools has been a long time point of interest for me. In addition to making a couple OSDs and contributing some tiny improvements to Kaitai, I also have my own binary schema library for Go, restruct, which, biased or not, remains my favorite way to poke at arbitrary formats, since it's really easy to sketch stuff out and read and write to files quickly. It's basically Go's encoding/binary but with struct tags for more advanced things.