LuaDec for LuaJIT?

Tell me how to adapt the Luadec decompiler to LuaJIT scripts One guy somehow decompiles LuaJIT scripts using this decompiler, but doesn't want to say how

LuaJIT 2.1.0-beta3

>luadec Fram.luac
luadec: Fram.luac: not a precompiled chunk
Author: zed, 2019-12-13

1 answers

It seems that LuaDec does not know how to decompile LuaJIT scripts out of the box, despite the fact that the wiki contains a description of the bytecode.

But the good news is that LuaJIT has its own working decompiler: https://gitlab.com/znixian/luajit-decompiler

To decompile the script, install python3 and run the command in the console:

python3 ./main.py -f Fram.luac > Fram.lua

With your script copes with a bang:

script_name("\\xd2\\xe5\\xeb\\xe5\\xef\\xee\\xf0\\xf2 \\xed\\xe0 \\xec\\xe5\\xf2\\xea\\xf3: Evolve-Rp")
script_version("Latest Version")
script_author("Ded_Fedot")
require("lib.moonloader")
require("lib.sampfuncs")

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then
        return
    end

    while not isSampAvailable() do
        wait(200)
    end

    sampRegisterChatCommand("dedtp", teleport)
    sampAddChatMessage("{00D5FF}[Evolve-Rp] {FFFFFF}\\xd2\\xe5\\xeb\\xe5\\xef\\xee\\xf0\\xf2 \\xed\\xe0 {FFE741}\\xec\\xe5\\xf2\\xea\\xf3", 54783)
    sampAddChatMessage("{00D5FF}[Evolve-Rp] {FFFFFF}\\xc0\\xe2\\xf2\\xee\\xf0: {EE0047}Ded_Fedot", 54783)

    while true do
        wait(0)

        if activ == true then
            tpoot = true
            stpoot = true

            wait(1000)
            requestCollision(posX, posY)
            loadScene(posX, posY, posZ)

            posZ = getGroundZFor3dCoord(posX, posY, 500)

            setCharCoordinates(playerPed, posX, posY, posZ)
            wait(2000)

            tpoot = false

            wait(1000)

            stpoot = false
            activ = false

            addOneOffSound(0, 0, 0, 1139)
            printStringNow("~w~Teleport ~g~Successful~n~~y~by ~p~Ded_Fedot", 3000)
        end
    end
end

function teleport()
    metka, posX, posY, posZ = getTargetBlipCoordinates()

    if metka then
        activ = true
        tpoot = true
        stpoot = true
    else
        sampAddChatMessage("\\xcf\\xee\\xf1\\xf2\\xe0\\xe2\\xfc \\xec\\xe5\\xf2\\xea\\xf3... {EE0047}\\xcc\\xf3\\xe4\\xe8\\xeb\\xe0", -1)
        addOneOffSound(0, 0, 0, 1138)
    end
end

function onSendPacket(slot0)
    if slot0 == 207 and tpoot == true then
        return false
    end
end

function onReceiveRpc(slot0)
    if slot0 == 12 and stpoot == true then
        return false
    end
end
 1
Author: zed, 2019-12-13 17:06:31