lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> I have undumped a compiled lua 4 file using a modified version of 
> LuaC.exe. I am having trouble understanding the text output and was 
> hoping someone might explain to me what all the values mean.

The only real documentation is the source. Starte here:
	http://www.lua.org/source/4.0.1/src_lopcodes.h.html#OP_END
	http://www.lua.org/source/4.0.1/src_lvm.c.html#luaV_execute

BTW, what was modified in your version of luac?

> The reason I am interested is because I would like to write a 
> converter that translates the outputted text back into readable lua 
> code. This converter is intended as a replacement for the buggy lua 4 
> decompiler that exists already.

Perhaps it'd be easier if you told us what is wrong with the existing 
Lua 4 decompiler. I assume you mean LuaDC. I could not find 

I used to have a decompiler for Lua 3 but it does not work with Lua 4.
On the other hand, the file you mentioned is pretty simple to decompile,
even by hand. Here is the first few lines. Ignore the -- comments.

--      1	[11]	GETGLOBAL  	0	; aitrace
--      2	[11]	PUSHSTRING 	1	; "CPU: CLASSDEF LOADED"
--      3	[11]	CALL       	0 0
aitrace("CPU: CLASSDEF LOADED")
--      4	[15]	CREATETABLE	0
--      5	[15]	SETGLOBAL  	2	; squadclass
squadclass={}
...

--lhf