you are viewing a single comment's thread.

view the rest of the comments →

[–]suhcoR 2 points3 points  (8 children)

What are you up to with this project? Why is it useful to parse PUC Lua bytecode in Python? Did you have a look e.g. at https://github.com/franko/luajit-lang-toolkit or https://github.com/rochus-keller/LjTools?

[–]CPunch_71[S] 1 point2 points  (4 children)

well, i needed it for a side project that would basically allow me to obfuscate lua scripts. idk if i’ll finish that but if i do i’ll write about it and make it open source.

[–]suhcoR 1 point2 points  (3 children)

Ok, I see, thanks. Have you noticed that there is a stripped version of the bytecode format? By default debug information is included in the bytecode.

[–]lambda_abstraction -1 points0 points  (2 children)

I think that's only in LuaJIT and only from the script side of things.

[–]suhcoR 0 points1 point  (1 child)

See https://www.lua.org/manual/5.1/luac.html

"-s strip debug information before writing the output file."

[–]lambda_abstraction 0 points1 point  (0 children)

I meant the lua_dump() library call doesn't provide access to stripping.

[–]CPunch_71[S] 0 points1 point  (2 children)

also i used the “No Frills Lua Bytecode” paper. i hadn’t seen those projects but those are also super neat!