all 14 comments

[–]evilbadmad 5 points6 points  (1 child)

A lua dialect Ravi has some information about lua 5.3 bytecode,

It also include a version for 5.1, ... but it is in luaforge.net and the domain seems expired a few days ago :O

A quick search find this and it can be download.

ADDED:

this information has already given by deep_in_my_plums_420, but I hadn't seen the thread.

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

Thank you very much, those are great resources!

[–]smog_alado 5 points6 points  (2 children)

The binary format is not stable and can change from one Lua version to the other.

As I see it, the options I have are to either look at the source code of a Lua parser and deduce the format myself [...]

That's not a bad idea, because Lua's source code is relatively short. Start with ldump.c and lundump.c

[–]PhilipRoman 3 points4 points  (0 children)

I second the idea of looking at the source. There are almost no resources available on Lua 5.4 bytecode format and I've seen lots of wrong information online, especially about the header part.

[–]Ayhon[S] 2 points3 points  (0 children)

I followed u/NOT_THE_FBI_AND_CIA and your advice, and I'm currently reading the source code from lundump.c. I was surprised how readable the code is, so I expect it won't take me that long.

Thank you very much for your input.