How to detect where strings begin in Lua Bytecode using C#? I would like to list all the strings in a Lua Bytecode file.
You need to parse the file. There are no special markers. See the source code in lundump.c.
Can't find the reference to the same statement on LUA's site, but here is a quote I found elsewhere:
there is no official specification of the Lua virtual machine instruction set, there is no need for one; the only official specification is of the Lua language
This document does try to break up the instruction set and provide a pseudo-spec from reverse engineering:
http://luaforge.net/docman/index.php?group_id=83&selected_doc_group_id=102&language_id=1
In that doc, it says that strings are constants attached to each function (w/ the exception of globals, which are in a table).
As far as I know, literal strings are stored in bytecode in the same format as they are in sourcecode- that is, "sometexthere". However, I suggest that you just compile a Lua file with nothing but a function with a string returned and see what it looks like in bytecode.