How to obfuscate lua code?

I cannot find anything on Google for some tool that encrypts / obfuscates my lua files, so I decided to ask here. Maybe some professional knows how to do this? (Is free).

Now I made a simple game in lua, and I don’t want people to see the code, otherwise they can easily cheat. How can I make all the text inside the .lua file just random letters, etc.?

I used the program in C # and I had this obfuscator.NET called SmartAssembly which works very well. When someone tries to check the code of my applications, it will be just a bunch of letters and numbers along with Chinese characters, etc.

Does anyone know any program that can do this for lua? Just upload the file you want to encrypt, click "Encrypt" or "Match" and "bam! Does it work !?

For instance:

print('Hello world!')

will turn into something like

sdf9sd@@@&/sdfsdd9fd0f0fsf/&
+4
source share
4 answers

Just pre-copy your files (chunks) and download the binary chunks. luacallows you to disable debugging information. If this is not enough, define your own conversions in the compiled lua language, where names can be removed if possible. There really is not much demand for loofah obfuscators, though ...

, : .

+5

loadstring, , string.dump, , , .. . .

, , "" Lua, , . C/++, , , , Lua, require . : , , ( ), AFAIK.

Lua, C, (, Release ), , , .

?:)

+4

Lua, , : (1) (2) Lua , , , .

, , () .

, , LuaJIT -, ( LuaJIT); , - LuaJIT - Lua, Lua.

(, ), ( ) , -, . - , , , , .

+4

, , , . lua, - . , load (str), lua ​​ string.dump. "" , . , , , Lua.

function tftp.SaveToMSI( tbl, msiPath )
    assert(type(tbl) == "table")
    assert(type(msiPath) == "string")

    local localName = _GetFileNameFromPath( msiPath )
    local file,err = io.open(localName, "wb")
    assert(file, err)
    -- convert the table into a string
    local str = serializer.Serialize( tbl )

    -- create a lua chunk from the string.  this allows some amount of 
    -- obfuscation, because it looks like gobblygook in a text editor
    local chunk = string.dump(load(str), true)

    file:write(chunk)
    file:close()

    -- send from /usr to the MSI folder
    local sendResult = tftp.SendFile( localName, msiPath )
    -- remove from the /usr folder
    os.remove(localName)

    return sendResult
end

Notepad ++:

LuaS

Vx @w (@? K└J┴ J @ ? Coulombmetervalue? ╘ ў

0

Source: https://habr.com/ru/post/1534049/


All Articles