Jump to content

how to convert from luac to lua


FiGo

Recommended Posts

.luac files are made like that for a reason. And the reason is that the authors of those scripts don't want anyone else to edit or steal their code. I myself find such compiled resources pure :~ as most of the times the resource itself is great but I can't change a few simple things like position of the elements for example, thus rendering it unusable at my server :( But you can always try out a compiled resource, see what it does and release an uncompiled version made by yourself for those like me who only want to edit a few things and not steal the script :) 

Edited by koragg
  • Like 1
Link to comment
  • Discord Moderators
On 26/05/2017 at 15:42, koragg said:

.luac files are made like that for a reason. And the reason is that the authors of those scripts don't want anyone else to edit or steal their code.

Mod note: the below explanation only applies to 'clean' luac files (non-obfuscated, but level 0 compilation) such as used in the wide LUA community in different applications. MTA (at https://luac.multitheftauto.com/) also offers obfuscation to additionally encrypt your bytecode LUA with a cryptographic salt, preventing decompilation by traditional methods found on the internet. Therefore, protected LUAC is safe from decompilation for aslong our alghoritm is safe (obviously, nothing in the tech world is uncrackable.. the key can get bruteforced somewhere in the future with some computing power, after which it will fit in the decompiler's keyhole and do its traditional job.. euphemism :)). The use of Luac in MTA isn't focussed on the performance benefit of compiling into and executing from bytecode, but mostly motivated by securing your scripts against theft of source code, as MTA server owners can additionally encrypt said bytecode.

Compiling to bytecode (what a standard .luac file contains) was never intended as any means of obfuscation to make things harder to reverse engineer, as the same way that compiling C code (for example) into assembly is not. However, because people who have an idea on how to translate bytecode back to more human readable Lua code in MTA: SA usually have better things to do than stealing that flashy new script of that DayZ server of yours, most server owners think that compilation is an anti-stealing measure. It just works, but from a security point of view it doesn't make much sense to assume that something is secure just because it's compiled and few people can understand it.

There are ways to translate (mod note: non-obfuscated) MTA: SA .luac files back to standard .lua code, and the answer is lying on the Internet with only doing a quick search on Google and in these forums. However, you need to understand very well how does MTA load a compiled script, what features does Lua offer and how to make it work in a way that gives you the result you want (some code that, while being equivalent to the one you have first, can be translated directly to source code). That's probably what you haven't been able to realize yet, and to not scare server owners so much, don't transform this in a C++/Lua course and because I'm dubious about your intentions, you should continue the research for the answer yourself ;)

Link to comment
  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...