[lua.expert]

/docs

api docs.

endpoint post https://api.lua.expert/decompile
content-type application/json
returns decompiled luau
rate limit 500 requests / minute

reference

decompile api

one endpoint

request body

send one json field named script containing the base64-encoded luauc file contents.

{
  "script": "<base64-encoded-luauc>"
}

response

successful requests return decompiled luau as plain text.

-- https://lua.expert/
print('lua.expert')

example request (luau)

an example of how to use the decompilation api from luau.

local HttpService = game:GetService('HttpService')

local luaSource = HttpService:PostAsync(
  'https://api.lua.expert/decompile',
  HttpService:JSONEncode({
    script = bytecodeBase64,
  }),
  Enum.HttpContentType.ApplicationJson
)

print(luaSource)

script.lua

download the helper directly from /script.lua.

assert(getscriptbytecode, "exploit does not support getscriptbytecode.")

local last = 0

getgenv().decompile = function(scr)
    local ok, bytecode = pcall(getscriptbytecode, scr)
    if not ok then
        return "-- failed to read script bytecode\n--[[\n" .. tostring(bytecode) .. "\n--]]"
    end

    local elapsed = os.clock() - last
    if elapsed < 0.6 then
        task.wait(0.6 - elapsed)
    end

    local encoder = base64_encode
    if not encoder then
        encoder = function(data)
            local b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
            return ((data:gsub('.', function(x)
                local r,byte = '',x:byte()
                for i=8,1,-1 do
                    r = r .. (byte % 2^i - byte % 2^(i-1) > 0 and '1' or '0')
                end
                return r
            end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x)
                if #x < 6 then return '' end
                local c = 0
                for i=1,6 do
                    c = c + (x:sub(i,i) == '1' and 2^(6-i) or 0)
                end
                return b:sub(c+1,c+1)
            end)..({ '', '==', '=' })[#data % 3 + 1])
        end
    end

    local res = request({
        Url = "https://api.lua.expert/decompile",
        Method = "POST",
        Headers = {
            ["content-type"] = "application/json"
        },
        Body = game:GetService("HttpService"):JSONEncode({
            script = encoder(bytecode)
        })
    })

    last = os.clock()

    if not res or res.StatusCode ~= 200 then
        return "-- api request error\n--[[\n" .. (res and res.Body or "no response") .. "\n--]]"
    end

    return res.Body
end