<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
        <title>LuaObfuscator Dumper</title>
    </head>

    <body style="background-color: rgb(25,25,25);text-align: center;justify-items: center;">
        <h1 style="color:white">LuaObfuscator Dumper</h1>
        <h6 style="color: red;">this was made for educational pruposes</h6>
        <input id="string" style="margin: 20px; border-radius: 10px; width: 38vh;" type="text" placeholder="Enter The Encrypted string (that starts with LOL!)"> <button class="a" onclick="dump()" style="border-radius: 10px; border: 10px; background-color: green; color: white;">Dump</button>
        <br>
        <textarea readonly="readonly" rows="10" cols="30" style="margin: 20px; border-radius: 10px; width: 150vh; height: 58vh; background-color: gray; margin-left: 20vh;color: white;" id="output" name="output1" cols="10" rows="60"></textarea>
        <br>
        <h6>Made by @iatteimacheater discord</h6>
    </body>
    <style>
        .a:hover {
            cursor: pointer;
            background-color: rgb(25,50,25);
            transition: all 25ms;
        }
    </style>
    <script>
        const label = document.getElementById("output")
        const input = document.getElementById("string")
        let output = ""
        function dump() {
            "use strict";
            function GetFEnv() {
                return globalThis;
            }
            function Unpack(arr, start, end) {
                return arr.slice(start, end);
            }

            function VMCall(ByteString, vmenv, ...args) {
                ByteString = ByteString.substring(4);
                let repeatNext = null;
                let processedByteString = "";
                for (let i = 0; i < ByteString.length; i += 2) {
                    let bytePair = ByteString.substr(i, 2);
                    if (bytePair.length < 2) break;
                    if (bytePair.charCodeAt(1) === 81) {
                        repeatNext = parseInt(bytePair.charAt(0), 16);
                        continue;
                    } else {
                        let a = String.fromCharCode(parseInt(bytePair, 16));
                        if (repeatNext !== null) {
                            a = a.repeat(repeatNext);
                            repeatNext = null;
                        }
                        processedByteString += a;
                    }
                }
                ByteString = processedByteString;
                let DIP = 0;
                function gBit(Bit, Start, End) {
                    if (End !== undefined) {
                        let res = (Bit / Math.pow(2, Start - 1)) % Math.pow(2, ((End - 1) - (Start - 1)) + 1);
                        return res - (res % 1);
                    } else {
                        let Plc = Math.pow(2, Start - 1);
                        return ((Bit % (Plc + Plc)) >= Plc) ? 1 : 0;
                    }
                }
                function gBits8() {
                    let result = ByteString.charCodeAt(DIP);
                    DIP += 1;
                    return result;
                }
                function gBits16() {
                    let a = ByteString.charCodeAt(DIP);
                    let b = ByteString.charCodeAt(DIP + 1);
                    DIP += 2;
                    return (b * 256) + a;
                }
                function gBits32() {
                    let a = ByteString.charCodeAt(DIP);
                    let b = ByteString.charCodeAt(DIP + 1);
                    let c = ByteString.charCodeAt(DIP + 2);
                    let d = ByteString.charCodeAt(DIP + 3);
                    DIP += 4;
                    return (d * 16777216) + (c * 65536) + (b * 256) + a;
                }
                function gFloat() {
                    let Left = gBits32();
                    let Right = gBits32();
                    let IsNormal = 1;
                    let Mantissa = (gBit(Right, 1, 20) * Math.pow(2, 32)) + Left;
                    let Exponent = gBit(Right, 21, 31);
                    let Sign = (gBit(Right, 32) === 1) ? -1 : 1;
                    if (Exponent === 0) {
                        if (Mantissa === 0) {
                            return Sign * 0;
                        } else {
                            Exponent = 1;
                            IsNormal = 0;
                        }
                    } else if (Exponent === 2047) {
                        return (Mantissa === 0) ? (Sign * (1 / 0)) : (Sign * NaN);
                    }
                    return Sign * Math.pow(2, Exponent - 1023) * (IsNormal + (Mantissa / Math.pow(2, 52)));
                }
                function gString(Len) {
                    if (Len === undefined) {
                        Len = gBits32();
                        if (Len === 0) {
                            return "";
                        }
                    }
                    let Str = ByteString.substring(DIP, DIP + Len);
                    DIP += Len;
                    let FStr = "";
                    for (let idx = 0; idx < Str.length; idx++) {
                        FStr += String.fromCharCode(Str.charCodeAt(idx));
                    }
                    return FStr;
                }
                let gInt = gBits32;
                function _R(...innerArgs) {
                    return [innerArgs, innerArgs.length];
                }
                function Deserialize() {
                    let Instrs = [];
                    let Functions = [];
                    let Lines = [];
                    let Chunk = [Instrs, Functions, null, Lines];
                    let ConstCount = gBits32();
                    let Consts = [];
                    for (let idx = 0; idx < ConstCount; idx++) {
                        let Type = gBits8();
                        let Cons;
                        if (Type === 1) {
                            Cons = (gBits8() !== 0);
                        } else if (Type === 2) {
                            Cons = gFloat();
                        } else if (Type === 3) {
                            Cons = gString();
                        }
                        Consts.push(Cons);
                    }
                    Chunk[2] = gBits8();
                    let InstrCount = gBits32();
                    for (let idx = 0; idx < InstrCount; idx++) {
                        let Descriptor = gBits8();
                        if (gBit(Descriptor, 1, 1) === 0) {
                            let Type = gBit(Descriptor, 2, 3);
                            let Mask = gBit(Descriptor, 4, 6);
                            let Inst = [gBits16(), gBits16(), null, null];
                            if (Type === 0) {
                                Inst[2] = gBits16();
                                Inst[3] = gBits16();
                            } else if (Type === 1) {
                                Inst[2] = gBits32();
                            } else if (Type === 2) {
                                Inst[2] = gBits32() - Math.pow(2, 16);
                            } else if (Type === 3) {
                                Inst[2] = gBits32() - Math.pow(2, 16);
                                Inst[3] = gBits16();
                            }
                            if (gBit(Mask, 1, 1) === 1) {
                                Inst[1] = Consts[Inst[1]];
                            }
                            if (gBit(Mask, 2, 2) === 1) {
                                Inst[2] = Consts[Inst[2]];
                            }
                            if (gBit(Mask, 3, 3) === 1) {
                                Inst[3] = Consts[Inst[3]];
                            }
                            Instrs[idx] = Inst;
                        }
                    }
                    let FuncCount = gBits32();
                    for (let idx = 0; idx < FuncCount; idx++) {
                        Functions[idx] = Deserialize();
                    }
                    return Chunk;
                }
                function Wrap(Chunk, Upvalues, Env) {
                    let Instr = Chunk[0];
                    let Proto = Chunk[1];
                    let Params = Chunk[2];
                    return function(...innerArgs) {
                        let VIP = 0; 
                        let Top = -1;
                        let Vararg = [];
                        let Args = innerArgs;
                        let PCount = innerArgs.length - 1;
                        let Lupvals = {};
                        let Stk = [];
                        for (let Idx = 0; Idx <= PCount; Idx++) {
                            if (Idx >= Params) {
                                Vararg[Idx - Params] = Args[Idx];
                            } else {
                                Stk[Idx] = Args[Idx];
                            }
                        }
                        let Varargsz = (PCount - Params) + 1;
                        let Inst, Enum;
                        while (true) {
                            Inst = Instr[VIP];
                            Enum = Inst[0];
                            if (Enum <= 29) {
                                if (Enum <= 14) {
                                    if (Enum <= 6) {
                                        if (Enum <= 2) {
                                            if (Enum <= 0) {
                                                Stk[Inst[1]] = Inst[2];
                                            } else if (Enum === 1) {
                                                Stk[Inst[1]] = Stk[Inst[2]] + Inst[3];
                                            } else {
                                                let A = Inst[1];
                                                let C = Inst[3];
                                                let CB = A + 2;
                                                let Result = Stk[A](Stk[A + 1], Stk[CB]);
                                                Result = Array.isArray(Result) ? Result : [Result];
                                                for (let Idx = 1; Idx <= C; Idx++) {
                                                    Stk[CB + Idx] = Result[Idx - 1];
                                                }
                                                let R = Result[0];
                                                if (R) {
                                                    Stk[CB] = R;
                                                    VIP = Inst[2];
                                                    continue;
                                                } else {
                                                    VIP++;
                                                    continue;
                                                }
                                            }
                                        } else if (Enum <= 4) {
                                            if (Enum > 3) {
                                                Stk[Inst[1]][Stk[Inst[2]]] = Inst[3];
                                            } else {
                                                Stk[Inst[1]] = Wrap(Proto[Inst[2]], null, Env);
                                            }
                                        } else if (Enum === 5) {
                                            let A = Inst[1];
                                            let Step = Stk[A + 2];
                                            let Index = Stk[A] + Step;
                                            Stk[A] = Index;
                                            if (Step > 0) {
                                                if (Index <= Stk[A + 1]) {
                                                    VIP = Inst[2];
                                                    Stk[A + 3] = Index;
                                                    continue;
                                                }
                                            } else if (Index >= Stk[A + 1]) {
                                                VIP = Inst[2];
                                                Stk[A + 3] = Index;
                                                continue;
                                            }
                                            VIP++;
                                            continue;
                                        } else if (Stk[Inst[1]] < Stk[Inst[3]]) {
                                            VIP++;
                                            continue;
                                        } else {
                                            VIP = Inst[2];
                                            continue;
                                        }
                                    } else if (Enum <= 10) {
                                        if (Enum <= 8) {
                                            if (Enum > 7) {
                                                Stk[Inst[1]] = Stk[Inst[2]];
                                            } else {
                                                let A = Inst[1];
                                                let resultsAndLimit = _R(Stk[A](Stk[A + 1]));
                                                let Results = resultsAndLimit[0], Limit = resultsAndLimit[1];
                                                Top = (Limit + A) - 1;
                                                let Edx = 0;
                                                for (let Idx = A; Idx <= Top; Idx++) {
                                                    Stk[Idx] = Results[Edx++];
                                                }
                                            }
                                        } else if (Enum > 9) {
                                            let A = Inst[1];
                                            let Step = Stk[A + 2];
                                            let Index = Stk[A] + Step;
                                            Stk[A] = Index;
                                            if (Step > 0) {
                                                if (Index <= Stk[A + 1]) {
                                                    VIP = Inst[2];
                                                    Stk[A + 3] = Index;
                                                    continue;
                                                }
                                            } else if (Index >= Stk[A + 1]) {
                                                VIP = Inst[2];
                                                Stk[A + 3] = Index;
                                                continue;
                                            }
                                            VIP++;
                                            continue;
                                        } else if (Stk[Inst[1]]) {
                                            VIP++;
                                            continue;
                                        } else {
                                            VIP = Inst[2];
                                            continue;
                                        }
                                    } else if (Enum <= 12) {
                                        if (Enum > 11) {
                                            let A = Inst[1];
                                            Stk[A] = Stk[A](Stk[A + 1]);
                                        } else {
                                            Stk[Inst[1]] = Inst[2] + Stk[Inst[3]];
                                        }
                                    } else if (Enum > 13) {
                                        let A = Inst[1];
                                        Stk[A] = Stk[A](Stk[A + 1]);
                                    } else {
                                        Stk[Inst[1]] = {};
                                    }
                                } else if (Enum <= 21) {
                                    if (Enum <= 17) {
                                        if (Enum <= 15) {
                                            Stk[Inst[1]][Stk[Inst[2]]] = Stk[Inst[3]];
                                        } else if (Enum === 16) {
                                            return;
                                        } else if (Stk[Inst[1]]) {
                                            VIP++;
                                            continue;
                                        } else {
                                            VIP = Inst[2];
                                            continue;
                                        }
                                    } else if (Enum <= 19) {
                                        if (Enum > 18) {
                                            Stk[Inst[1]][Stk[Inst[2]]] = Stk[Inst[3]];
                                        } else {
                                            let B = Inst[2];
                                            let K = Stk[B];
                                            for (let Idx = B + 1; Idx <= Inst[3]; Idx++) {
                                                K = K + Stk[Idx];
                                            }
                                            Stk[Inst[1]] = K;
                                        }
                                    } else if (Enum > 20) {
                                        Stk[Inst[1]] = Stk[Inst[2]];
                                    } else {
                                        Stk[Inst[1]] = Stk[Inst[2]][Stk[Inst[3]]];
                                    }
                                } else if (Enum <= 25) {
                                    if (Enum <= 23) {
                                        if (Enum === 22) {
                                            let A = Inst[1];
                                            let Index = Stk[A];
                                            let Step = Stk[A + 2];
                                            if (Step > 0) {
                                                if (Index > Stk[A + 1]) {
                                                    VIP = Inst[2];
                                                    continue;
                                                } else {
                                                    Stk[A + 3] = Index;
                                                }
                                            } else if (Index < Stk[A + 1]) {
                                                VIP = Inst[2];
                                                continue;
                                            } else {
                                                Stk[A + 3] = Index;
                                            }
                                        } else {
                                            Env[Inst[2]] = Stk[Inst[1]];
                                        }
                                    } else if (Enum > 24) {
                                        let A = Inst[1];
                                        let resultsAndLimit = _R(Stk[A](Stk[A + 1]));
                                        let Results = resultsAndLimit[0], Limit = resultsAndLimit[1];
                                        Top = (Limit + A) - 1;
                                        let Edx = 0;
                                        for (let Idx = A; Idx <= Top; Idx++) {
                                            Stk[Idx] = Results[Edx++];
                                        }
                                    } else {
                                        VIP = Inst[2];
                                        continue;
                                    }
                                } else if (Enum <= 27) {
                                    if (Enum > 26) {
                                        Stk[Inst[1]] = Inst[2] + Stk[Inst[3]];
                                    } else {
                                        Stk[Inst[1]][Stk[Inst[2]]] = Inst[3];
                                    }
                                } else if (Enum === 28) {
                                    if (Inst[1] === Stk[Inst[3]]) {
                                        VIP++;
                                        continue;
                                    } else {
                                        VIP = Inst[2];
                                        continue;
                                    }
                                } else {
                                    return Stk[Inst[1]];
                                }
                                VIP++;
                                continue;
                            } else if (Enum <= 44) {
                                if (Enum <= 36) {
                                    if (Enum <= 32) {
                                        if (Enum <= 30) {
                                            Stk[Inst[1]] = (Inst[2] !== 0);
                                        } else if (Enum > 31) {
                                            Env[Inst[2]] = Stk[Inst[1]];
                                        } else if (Stk[Inst[1]] < Stk[Inst[3]]) {
                                            VIP++;
                                            continue;
                                        } else {
                                            VIP = Inst[2];
                                            continue;
                                        }
                                    } else if (Enum <= 34) {
                                        if (Enum > 33) {
                                            Stk[Inst[1]] = Env[Inst[2]];
                                        } else {
                                            let A = Inst[1];
                                            let Results = Stk[A](Stk[A + 1]);
                                            Results = Array.isArray(Results) ? Results : [Results];
                                            let Edx = 0;
                                            for (let Idx = A; Idx <= Inst[3]; Idx++) {
                                                Stk[Idx] = Results[Edx++];
                                            }
                                        }
                                    } else if (Enum === 35) {
                                        let A = Inst[1];
                                        Stk[A] = Stk[A](...Unpack(Stk, A + 1, Top));
                                    } else {
                                        Stk[Inst[1]] = Stk[Inst[2]][Stk[Inst[3]]];
                                    }
                                } else if (Enum <= 40) {
                                    if (Enum <= 38) {
                                        if (Enum > 37) {
                                            let A = Inst[1];
                                            Stk[A] = Stk[A](...Unpack(Stk, A + 1, Top));
                                        } else if (Inst[1] === Stk[Inst[3]]) {
                                            VIP++;
                                            continue;
                                        } else {
                                            VIP = Inst[2];
                                            continue;
                                        }
                                    } else if (Enum > 39) {
                                        Stk[Inst[1]] = Env[Inst[2]];
                                    } else {
                                        Stk[Inst[1]] = (Inst[2] !== 0);
                                    }
                                } else if (Enum <= 42) {
                                    if (Enum > 41) {
                                        let A = Inst[1];
                                        Stk[A](Stk[A + 1]);
                                    } else {
                                        Stk[Inst[1]] = Stk[Inst[2]] + Inst[3];
                                    }
                                } else if (Enum > 43) {
                                    Stk[Inst[1]] = Stk[Inst[2]][Inst[3]];
                                } else {
                                    Stk[Inst[1]] = Stk[Inst[2]] * Stk[Inst[3]];
                                }
                                VIP++;
                                continue;
                            } else if (Enum <= 52) {
                                if (Enum <= 48) {
                                    if (Enum <= 46) {
                                        if (Enum > 45) {
                                            Stk[Inst[1]] = {};
                                        } else {
                                            Stk[Inst[1]] = (Inst[2] !== 0);
                                            VIP++;
                                            continue;
                                        }
                                    } else if (Enum === 47) {
                                        Stk[Inst[1]] = (Inst[2] !== 0);
                                        VIP++;
                                        continue;
                                    } else {
                                        Stk[Inst[1]] = Stk[Inst[2]][Inst[3]];
                                    }
                                } else if (Enum <= 50) {
                                    if (Enum === 49) {
                                        VIP = Inst[2];
                                        continue;
                                    } else {
                                        let B = Inst[2];
                                        let K = Stk[B];
                                        for (let Idx = B + 1; Idx <= Inst[3]; Idx++) {
                                            K = K + Stk[Idx];
                                        }
                                        Stk[Inst[1]] = K;
                                    }
                                } else if (Enum > 51) {
                                    let A = Inst[1];
                                    return Unpack(Stk, A, A + Inst[2]);
                                } else {
                                    Stk[Inst[1]] = Inst[2];
                                }
                                VIP++;
                                continue;
                            } else if (Enum <= 56) {
                                if (Enum <= 54) {
                                    if (Enum === 53) {
                                        Stk[Inst[1]] = Wrap(Proto[Inst[2]], null, Env);
                                    } else {
                                        let A = Inst[1];
                                        let Index = Stk[A];
                                        let Step = Stk[A + 2];
                                        if (Step > 0) {
                                            if (Index > Stk[A + 1]) {
                                                VIP = Inst[2];
                                                continue;
                                            } else {
                                                Stk[A + 3] = Index;
                                            }
                                        } else if (Index < Stk[A + 1]) {
                                            VIP = Inst[2];
                                            continue;
                                        } else {
                                            Stk[A + 3] = Index;
                                        }
                                    }
                                } else if (Enum > 55) {
                                    Stk[Inst[1]] = Stk[Inst[2]] * Stk[Inst[3]];
                                } else {
                                    let A = Inst[1];
                                    Stk[A](Stk[A + 1]);
                                }
                                VIP++;
                                continue;
                            } else if (Enum <= 58) {
                                if (Enum === 57) {
                                    let A = Inst[1];
                                    let resultsAndLimit = _R(Stk[A](Stk[A + 1]));
                                    let Results = resultsAndLimit[0], Limit = resultsAndLimit[1];
                                    let Edx = 0;
                                    for (let Idx = A; Idx <= Inst[3]; Idx++) {
                                        Stk[Idx] = Results[Edx++];
                                    }
                                } else {
                                    return;
                                }
                                VIP++;
                                continue;
                            } else if (Enum > 59) {
                                return Stk[Inst[1]];
                            } else {
                                let A = Inst[1];
                                let C = Inst[3];
                                let CB = A + 2;
                                let Result = Stk[A](Stk[A + 1], Stk[CB]);
                                Result = Array.isArray(Result) ? Result : [Result];
                                for (let Idx = 1; Idx <= C; Idx++) {
                                    Stk[CB + Idx] = Result[Idx - 1];
                                }
                                let R = Result[0];
                                if (R) {
                                    Stk[CB] = R;
                                    VIP = Inst[2];
                                    continue;
                                } else {
                                    VIP++;
                                    continue;
                                }
                            }
                        }
                    };
                } 
                let deserialized = Deserialize();
                for (let i = 0; i < deserialized.length; i++) {
                    let v = deserialized[i];
                    if (v !== null && typeof v === "object") {
                        for (let h in v) {
                            if (v.hasOwnProperty(h)) {
                                if (v[h] !== null && typeof v[h] === "object") {
                                    for (let j in v[h]) {
                                        if (v[h].hasOwnProperty(j)) {
                                            let a = (v[h][j])
                                            if (a == null || undefined) {
                                                output = output + "nil" + " \n";
                                            }else {
                                                output = output + (v[h][j]) + " \n";
                                            }
                                        }
                                    }
                                } else {
                                    let a = (v[h])
                                    if (a == null || undefined) {
                                        output = output + "nil" + " \n";
                                    }else {
                                        output = output + (v[h]) + " \n";
                                    }
                                }
                            }
                        }
                    } else {
                        let a = (v)
                        if (a == null || undefined) {
                            output = output + "nil" + " \n";
                        }else {
                            output = output + (v) + " \n";
                        }
                    }
                }
            }

            VMCall(input.value, GetFEnv(), "...");
            label.value = output
            output = ""
        }

    </script>
</html>