First time here? Check out the FAQ!
THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

Parsing ASN.1 in Lua

I'm looking for an ASN.1 parser for Lua, does this exist or can it be done? My knowledge of C is zero hence the preference to use Lua.

marty84's avatar
1
marty84
asked 2018-10-18 07:42:27 +0000
cmaynard's avatar
11.1k
cmaynard
updated 2019-01-30 17:24:09 +0000
edit flag offensive 0 remove flag close merge delete

Comments

Which asn1 module?

Anders's avatar Anders (2018-10-18 15:25:32 +0000) edit

X.680 module

marty84's avatar marty84 (2018-10-18 21:14:47 +0000) edit

I meant what is the protocol you want to dissect.

Anders's avatar Anders (2018-10-19 07:42:47 +0000) edit

It's proprietary

marty84's avatar marty84 (2018-10-21 07:05:31 +0000) edit
add a comment see more comments

3 Answers

0

In Wireshark we have a script that generates a C dissector from an ASN.1 description with help of conformance files and a template. The resulting C code makes use of basic PER or BER helper dissectors. Unfortunately nothing similar exists for LUA. So if you were to write a LUA dissector for your protocol you would have to write it for the serialized data sent on the wire.

Anders's avatar
5k
Anders
answered 2018-10-21 18:10:56 +0000
Jaap's avatar
13.7k
Jaap
updated 2018-10-22 06:38:17 +0000
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0
wborkowsk's avatar
1
wborkowsk
answered 2019-07-29 14:34:14 +0000
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

Don't know if it is going to be repetitive, but in such case, I'd suggest to write a parser (in any language you want - I've used MATLAB) from your format to LUA.

Note that there are many tricks that it is advised to use to make it easier/more generic. For example - you are limited to 200 variables. However, there is solution if you need much more - define one global variable and make it "as struct" which contains all the variables. In such way you can have it generic.

BMWE's avatar
1
BMWE
answered 2020-10-16 14:55:10 +0000
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer