of     1   

fuzzyhed
#60602899Saturday, December 31, 2011 3:09 AM GMT

Hi, I am working on doing some mods for cobalt and need to decompile this (what I believe to be) compiled LuaJIT bytecode, if anyone can tell me how I could get this to the original source it would be much obliged. Note: This was in a lua file in the progam, so if I could decompile the exe and see how that runs the lua file, that would also help: Actually there's a problem, I can't paste the bytecode, because I am viewing it in notepad++ where all I can see is a few words along with a lot of sign-looking characters that say NUL or STX, or SO. ( as well as a few others. ) Any help?
fuzzyhed
#60614854Saturday, December 31, 2011 5:49 AM GMT

Basically I just need to decompile this luaJIT bytecode into a readable source, any suggestions?
Armachedes
#60615631Saturday, December 31, 2011 6:04 AM GMT

How do you decompile a scripted language? Aren't they, per definition, interpreted, not compiled?
eyeontheprizeREBOOT
#60615679Saturday, December 31, 2011 6:05 AM GMT

Lua is converted to bytecode which is run on a virtual machine, much like C is compiled to assembly that is run on a real machine.
stravant
Forum Moderator
#60616710Saturday, December 31, 2011 6:29 AM GMT

" so if I could decompile the exe and see how that runs the lua file, that would also help:" That's silly. LuaJIT is open source, you can see exactly how it runs the code in question without any need for decompilation! As for the bytecode... as I understand it LuaJIT bytecode is _far_ more complicated than normal Lua bytecode, because it's optimized purely for speed, not size. That means you're going to have a hard time decompiling the code that you get, since there's not any decent tools for it, especially pre version 2.0, since before version 2.0 LuaJIT didn't even have a way to decode/encode LuaJIT bytecode from the command line, and you can't just use the 2.0 decoder on the older code, since it's a different format.
fuzzyhed
#60661928Saturday, December 31, 2011 10:29 PM GMT

How do tools that do it work exactly?
booing
#60676722Sunday, January 01, 2012 1:04 AM GMT

He's not going to post 5k lines of C++ code. If you want a tool to decompile it, then google it. ~Atheist, dutch, canadian, programmer, "markuper"

    of     1