1

Is it possible to assemble back the ChunkSpy's dissembled LUA files? Here's an example:

0B50  05000000           [001] getglobal  0   0        ; script
0B54  C63E0000           [002] gettable   0   0   251  ; "reload"
0B58  81000001           [003] loadk      1   2        ; "player/common.lua"
0B5C  59000100           [004] call       0   2   1  

(And this is how it's actually supposed to look like.)

script.reload("player/common.lua")

I tried to use Unluac and Luadec for files I want to decompile, but ChunkSpy is the only program that manages to open them. And these 3 tools are the ones I can use eventually, since all other tools were designed to work with LUB versions 5.1, 5.2 or 5.3. But, the version of my files is 5.0.2. I've searched everywhere for any suggestions about my problem, but I couldn't find anything.

Despite the fact that the needed program may not even exist, and absolutely nothing can't be done with these LUB files, I still would like to know, why Unluac and Luadec fail at decompiling those files, while ChunkSpy doesn't have any problems with them?

1

How to assemble back a disassembled ChunkSpy LUA?

You don't. From the ChunckSpy website:

ChunkSpy is a tool to disassemble a Lua 5 binary chunk into a verbose listing that can then be studied. Its output bears a resemblance to the output listing of assemblers. ... If you want to disassemble to source code, try LuaDec by Hisham Muhammad.

As for your other question

I still would like to know, why Unluac and Luadec fail at decompiling those files, while ChunkSpy doesn't have any problems with them?

Please note that this is hardly an reverse engineering question and very specific to the internal structure of the mentioned projects. You may be better off posting to the project maintainers themselves.

From the Unluac site:

It requires that debugging information has not been stripped from the chunk.

From the LuaDec site:

LuaDec, in its current form, is not a complete decompiler. It does succeed in decompiling most of the Lua constructs

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.