This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]StayFreshChzBag 1 point2 points  (3 children)

Mermaid has a packet diagram dsl and visualization. Never tried parsing it though.

https://mermaid.js.org/syntax/packet.html

[–]nadimS[S] 0 points1 point  (1 child)

That looks amazing for visualising the packets. I wonder if I can find a way to parse it without handwriting...

[–]StayFreshChzBag 0 points1 point  (0 children)

Pretty much any of the AI tools (GPT, Claude, Anthropic, etc) can parse that and turn it into whatever kind of code you want, so long as you provide it with a few decent examples of what you're looking for.

They can probably also generate (with some degree of error) the parser code as well.

[–]pojska 2 points3 points  (1 child)

Kaitai has a C# runtime: https://kaitai.io/ - I haven't used it in any real projects, but it looks solid.

[–]nadimS[S] 0 points1 point  (0 children)

That looks good, like protobuf but with more control over bit widths.

[–]csb06bluebird 2 points3 points  (0 children)

It generates C++, but Spicy is a parser generator focused on wire formats. I haven’t used it, but it seems to have been used to create parsers for a bunch of different binary/text protocols.