Advertisement
Charliezkie

Lua Obfuscator Code

Aug 31st, 2019
1,393
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.40 KB | None | 0 0
  1. local Script = [[Put Your Script Here]]
  2.  
  3. function Encode(Text)
  4.     Text = tostring(Text)
  5.     local Table = {}
  6.     for i = 1, #Text do
  7.         local T = Text:sub(i, i)
  8.         table.insert(Table, T)
  9.     end
  10.     local T = {}
  11.     local MyText = "'"
  12.     for i, v in pairs(Table) do
  13.         local Key = string.byte(v)
  14.         MyText = MyText..math.floor(Key/128)
  15.         Key = Key % 128
  16.         MyText = MyText..math.floor(Key/64)
  17.         Key = Key % 64
  18.         MyText = MyText..math.floor(Key/32)
  19.         Key = Key % 32
  20.         MyText = MyText..math.floor(Key/16)
  21.         Key = Key % 16
  22.         MyText = MyText..math.floor(Key/8)
  23.         Key = Key % 8
  24.         MyText = MyText..math.floor(Key/4)
  25.         Key = Key % 4
  26.         MyText = MyText..math.floor(Key/2)
  27.         Key = Key % 2
  28.         MyText = MyText..math.floor(Key/1)
  29.         Key = Key % 1
  30.         MyText=MyText.."','"
  31.     end
  32.     MyText = MyText:sub(1, #MyText -1)
  33.     if tonumber(MyText) then
  34.         MyText = tonumber(MyText)
  35.     end
  36.     return MyText
  37. end
  38. -- ENCODE
  39. local Encoded = Encode(Script)
  40. print([[local BinaryEncrypted = ]].."table.concat({"..Encoded.."})"..[[ function decode(str) local function binary_to_string(bin) return string.char(tonumber(bin, 2));end;return (str:gsub("(".. ("[01]"):rep(8) .. ")", binary_to_string));end;local Binary = BinaryEncrypted _G.EncodedBinary = decode(Binary);loadstring(_G.EncodedBinary)()]])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement