Advertisement
V3rmLua33

My bypass creation:made for injector:

Mar 5th, 2015
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.45 KB | None | 0 0
  1. --This was made by chucky4523:AKA in rl Pedro Brooks:
  2. local needssandboxing = function(i) end
  3. sandbox = {}
  4.  
  5. sandbox.cache = {}  
  6.  
  7. sandbox.mt = {
  8.     __index = function(self, k)
  9.         local original = sandbox.cache[self]
  10.  
  11.         local v = original[k]
  12.  
  13.         return sandbox.any(v)
  14.     end,
  15.     __newindex = function(self, k, v)
  16.         local original = sandbox.cache[self]
  17.  
  18.         original[k] = unsandbox.any(v)
  19.     end
  20. }
  21. --sandbox any object
  22. function sandbox.any(a)
  23.     if sandbox.cache[a] then
  24.         -- already sandboxed
  25.         return a
  26.     elseif type(a) == "function" then
  27.         return sandbox.func(a)
  28.     elseif type(a) == "table" then
  29.         return sandbox.table(a)
  30.     elseif needssandboxing(a) then
  31.         return sandbox.object(a)
  32.     else
  33.         --doesn't need sandboxing
  34.         return value
  35.     end
  36. end
  37. --sandbox instances and events
  38. function sandbox.object(o)
  39.     local sandboxed = setmetatable({}, sandbox.mt)
  40.     sandbox.cache[sandboxed] = o
  41.     return sandboxed
  42. end
  43. --sandbox a function
  44. function sandbox.func(f)
  45.     local sandboxed = function(...)
  46.         return sandbox(f(unsandbox(...)))
  47.     end
  48.     sandbox.cache[sandboxed] = f
  49.     return sandboxed
  50. end
  51. function sandbox.table(t)
  52.     local sandboxed = {}
  53.     for k, v in pairs(t) do
  54.         --by sandboxing every key and every value
  55.         sandboxed[sandbox.any(k)] = sandbox.any(v)
  56.     end
  57.     return sandboxed
  58. end
  59. unsandbox = {}
  60. --unsandbox any objects
  61. unsandbox.any = function(a)
  62.     if sandbox.cache[a] then
  63.         --if we have it cached, return it
  64.         return sandbox.cache[a]
  65.     elseif type(a) == "function" then
  66.         return unsandbox.func(a)
  67.     elseif type(a) == "table"
  68.         return unsandbox.table(a)
  69.     else
  70.         return a
  71.     end
  72. end
  73. unsandbox.table = function(t)
  74.     local unsandboxed = {}
  75.     for k, v in pairs(t) do
  76.         --by unsandboxing every key and every value
  77.         unsandboxed[unsandbox.any(k)] = unsandbox.any(v)
  78.     end
  79.     return unsandboxed
  80. end
  81. unsandbox.func = function(f)
  82.     local raw = function(...)
  83.         return unsandbox(f(sandbox(...)))
  84.     end
  85.     sandbox.cache[f] = raw
  86.     return raw
  87. end
  88. local callable_mt = {
  89.    __call = function(self, first, ...)
  90.        if select('#', ...) == 0 then
  91.            return self.any(first)
  92.        else
  93.            return self.any(first), self(...)
  94.        end
  95.    end
  96. }
  97.  
  98. setmetatable(sandbox, callable_mt)
  99. setmetatable(unsandbox, callable_mt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement