5 ms·
Ask HN: Looking for tool/language to describe data/packet structures
I'm looking or a tool that will allow me to textually describe data/packet structures for the purposes of creating visual representations of the structures. If it's capable of expressing constraints or assertations that would be even better. Examples of constraints/assertions:
- This field should always be n bits into the start of the structure
- The size of this structure shouldn't exceed B bits
- This field should never be less than s bits
The capability to output image formats directly is preferred, but I'm not opposed to having to script it and tie it up to an image generation library.
I'd prefer a CLI tool so the flow is all on my local machine.
- jiveturkey 4y agohttp://interactive.blockdiag.com/packetdiag/ http://interactive.blockdiag.com/packetdiag/ https://github.com/arnoldrobbins/dformat https://github.com/arnoldrobbins/dformat
- codegladiator 4y agoCheckout kaitai https://doc.kaitai.io/ https://doc.kaitai.io/ Its not for generating visual structure, but just defining the structure with the constraints like you mentioned
- renewiltord 4y agoProtocol exists but is unmaintained (I think) https://www.luismg.com/protocol/ https://www.luismg.com/protocol/ Wavedrom and ascii wave is for tming https://github.com/Wren6991/asciiwave https://github.com/Wren6991/asciiwave
- cookiengineer 4y agoIn the network security space there's pcap-ng and yara that's pretty common as a network filter ruleset generator. There's also a lof of visual IDEs for the creation of yara rules, which tend to break it down in a flow-based graph so that the logical conditions are easier to understand. Yara is pretty flexible in what you can do with it, a lot of anti malware tools use it for detection, as well as more modern hex editors like ImHex. Older-generation tech used to use snort and its rule format, especially in the Enterprise space it's (sadly) still common.