asn.1 parser in C/Python

后端 未结 7 2101
借酒劲吻你
借酒劲吻你 2021-02-02 00:41

I am looking for a solution to parse asn.1 spec files and generate a decoder from those.

Ideally I would like to work with Python modules, but if nothing is available I

7条回答
  •  失恋的感觉
    2021-02-02 00:55

    I'm the author of LEPL, a parser written in Python, and what you want to do is one of the things on my "TODO" list.

    I will not be doing this soon, but you might consider using LEPL to construct your solution because:

    1 - it's a pure Python solution (which makes life simpler)

    2 - it can already parse binary data as well as text, so you would only need to use a single tool - the same parser that you would use to parse the ASN1 spec would then be used to parse the binary data

    The main downsides are that:

    1 - it's a fairly new package, so it may be buggier than some, and the support community is not that large

    2 - it is restricted to Python 2.6 and up (and the binary parser only works with Python 3 and up).

    For more information, please see http://www.acooke.org/lepl - in particular,for binary parsing see the relevant section of the manual (I cannot link directly to that as Stack Overflow seems to think I am spamming)

    Andrew

    PS The main reason this is not something I have already started is that the ASN 1 specs are not freely available, as far as I know. If you have access to them, and it is not illegal(!), a copy would be greatly appreciated (unfortunately I am currently working on another project, so this would still take time to implement, but it would help me get this working sooner...).

提交回复
热议问题