MODFINDER_STOCK_MODS

Script Decompiler

May 8th, 2024
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | Source Code | 0 0
  1. local httpService = cloneref(game:GetService('HttpService'))
  2.  
  3. local function decompile(scr)
  4.     local s, bytecode = pcall(getscriptbytecode, scr)
  5.     if not s then
  6.         return `failed to get bytecode { bytecode }`
  7.     end
  8.  
  9.     local response = request({
  10.         Url = 'https://unluau.lonegladiator.dev/unluau/decompile',
  11.         Method = 'POST',
  12.         Headers = {
  13.             ['Content-Type'] = 'application/json',
  14.         },
  15.         Body = httpService:JSONEncode({
  16.             version = 5,
  17.             bytecode = crypt.base64.encode(bytecode)
  18.         })
  19.     })
  20.  
  21.     local decoded = httpService:JSONDecode(response.Body)
  22.     if decoded.status ~= 'ok' then
  23.         return `decompilation failed: { decoded.status }`
  24.     end
  25.  
  26.     return decoded.output
  27. end
  28.  
  29. getgenv().decompile = decompile
Add Comment
Please, Sign In to add comment