Interval Parsing Grammars for File Format Parsing (2023) [pdf]

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • dogma

    Dogma: A modernized metalanguage with better expressiveness and binary grammar support (by kstenerud)

  • I made a grammar to tackle these sorts of problems when I had trouble writing formal grammar notations for my binary data format.

    https://dogma-lang.org/

    So far it's been able to describe 90% of what's out there. Some examples:

    - 802.3 layer 2 Ethernet: https://github.com/kstenerud/dogma/blob/master/v1/examples/8...

    - Microsoft ICO format: https://github.com/kstenerud/dogma/blob/master/v1/examples/i...

    - Android Dex v39: https://github.com/kstenerud/dogma/blob/master/v1/examples/d...

    - IPv4: https://github.com/kstenerud/dogma/blob/master/v1/examples/i...

    - DNS query: https://github.com/kstenerud/dogma/blob/master/v1/examples/d...

    - Microsoft Minidump: https://github.com/kstenerud/dogma/blob/master/v1/examples/m...

  • binarylang

    Binary parser/encoder DSL

  • BinaryLang (for Nim) has similar features[1]. I've written a very compact ELF parser with it[2]. Notice that the last struct has array elements that skip over content based on offsets specified in the header.

    [1] https://github.com/sealmove/binarylang

    [2] https://github.com/khaledh/elfdump/blob/master/elfparse.nim

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • elfdump

    Dump ELF file information.

  • BinaryLang (for Nim) has similar features[1]. I've written a very compact ELF parser with it[2]. Notice that the last struct has array elements that skip over content based on offsets specified in the header.

    [1] https://github.com/sealmove/binarylang

    [2] https://github.com/khaledh/elfdump/blob/master/elfparse.nim

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts