Advertisement
DragRacer31

Obfuscator2

Sep 19th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.48 KB | None | 0 0
  1.  
  2.  
  3. -- By Sikke
  4. --https://www.youtube.com/watch?v=yjkXSrEYZVg
  5.  
  6. local Script = [[print("hi")]] -- < Put script here
  7.  
  8. --
  9.  
  10. function Encode(Text)
  11.     Text = tostring(Text)
  12.     local Table = {}
  13.     for i = 1, #Text do
  14.         local T = Text:sub(i, i)
  15.         table.insert(Table, T)
  16.     end
  17.     local T = {}
  18.     local MyText = "'"
  19.     for i, v in pairs(Table) do
  20.         local Key = string.byte(v)
  21.         MyText = MyText..math.floor(Key/128)
  22.         Key = Key % 128
  23.         MyText = MyText..math.floor(Key/64)
  24.         Key = Key % 64
  25.         MyText = MyText..math.floor(Key/32)
  26.         Key = Key % 32
  27.         MyText = MyText..math.floor(Key/16)
  28.         Key = Key % 16
  29.         MyText = MyText..math.floor(Key/8)
  30.         Key = Key % 8
  31.         MyText = MyText..math.floor(Key/4)
  32.         Key = Key % 4
  33.         MyText = MyText..math.floor(Key/2)
  34.         Key = Key % 2
  35.         MyText = MyText..math.floor(Key/1)
  36.         Key = Key % 1
  37.         MyText=MyText.."','"
  38.     end
  39.     MyText = MyText:sub(1, #MyText -1)
  40.     if tonumber(MyText) then
  41.         MyText = tonumber(MyText)
  42.     end
  43.     return MyText
  44. end
  45. -- ENCODE
  46. local Encoded = Encode(Script)
  47. 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