View Single Post
Old 05-03-2006, 05:15 PM   #14
squeegee
Rookie
 
Join Date: May 2006
Posts: 11
Quote:
Originally Posted by Athanasios
Can't you set a generator for random naming of local variables?

I have no clue of LUA coding, but in C, C++, Java and such this is doable. Either with matrices of strings or pointers.
Actually, my original kluge was pretty stupid. As it turns out, all the crashes I've come across are related to the local vars. All I had to do was before using a local variable check for it being null, and if it was, call the function Mike created. The only other change was to make sure not to free the auto locals on function closure.

So, now, all local variables have distinct names of L0, L1, L2, etc. The best we can do without the local variable information (i.e. not knowing the actual local variable names). The code is quite readable, and I have successfully decompiled all the lua code in config.meg now.

There is one other strange bug in luadec: When a function is declared, the line of code generated is like "name = function()" instead of "function name()". It's annoying, but the code is still readable. I'll look into eventually...

I can make a zip of all the decompiled sources if anybody is interested. As well as the fixed luadec and code if interested.
squeegee is offline   you may: quote & reply,