Interpreting Lua Code
I'm trying to see what this file has inside of it (written in Lua) for a
MUD I play, so that I can learn and see how it is done. But at the
beginning it has functions defined that make everything unreadable - This
is the code:
local ungz = (function ()local
base_char,keywords=128,{"and","break","do","else\
","elseif","end","false","for","function","if","in","local","nil","not","or","r\
epeat","return","then","true","until","while","read","nbits","nbits_left_in_byt\
e","wnd_pos","output","val","input",}; function prettify(code) return
code:gsub\
("["..string.char(base_char).."-"..string.char(base_char+#keywords).."]",
function (c) return keywords[c:byte()-base_char]; end) end return
asser\
t(loadstring(prettify[===[\214
i,h,b,m,l,d,e,y,r,w,u,v,l,l=assert,error,ipairs,\
pairs,tostring,type,setmetatable,io,math,table.sort,math.max,string.char,io.ope\
n,_G;\214 \211 p(n)\214 l={};\214 e=e({},l)\211 l:__index(l)\214
n=n(l);e[l]=n
\221 n
\206
\221 e
\206
\214 \211 l(n,l)l=l \217 1
h({n},l+1)\206
\214 \211 _(n)\214 l={}l.outbs=n
l.wnd={}l.\231=1
\221 l
\206
\214 \211 t(l,e)\214 n=l.\231
l.outbs(e)l.wnd[n]=e
And as the code goes on you get more "prettified" coding with ###. Could
someone tell me how to make it so it is readable again?
No comments:
Post a Comment