diff --git a/saveinstance.luau b/saveinstance.luau index 53efa43..9a09a4e 100644 --- a/saveinstance.luau +++ b/saveinstance.luau @@ -3,18 +3,6 @@ --!divine-intellect -- https://discord.gg/wx4ThpAsmw -local service = setmetatable({}, { - __index = function(self, serviceName) - local o, s = pcall(Instance.new, serviceName) - local Service = o and s - or game:GetService(serviceName) - or settings():GetService(serviceName) - or UserSettings():GetService(serviceName) - self[serviceName] = Service - return Service - end, -}) - local function string_find(s, pattern) return string.find(s, pattern, nil, true) end @@ -78,6 +66,7 @@ do -- readbinarystring = 'string.find(...,"bin",nil,true)', -- ! Could match some unwanted stuff (getbinaryindex) -- request = 'string.find(...,"request",nil,true) and not string.find(...,"internal",nil,true)', base64encode = 'local a={...}local b=a[1]local function c(a,b)return string.find(a,b,nil,true)end;return c(b,"encode")and(c(b,"base64")or c(string.lower(tostring(a[2])),"base64"))', + cloneref = 'string.find(...,"clone",nil,true) and string.find(...,"ref",nil,true)', decompile = '(string.find(...,"decomp",nil,true) and string.sub(...,#...) ~= "s")', gethiddenproperty = 'string.find(...,"get",nil,true) and string.find(...,"h",nil,true) and string.find(...,"prop",nil,true) and string.sub(...,#...) ~= "s"', gethui = 'string.find(...,"get",nil,true) and string.find(...,"h",nil,true) and string.find(...,"ui",nil,true)', @@ -93,6 +82,7 @@ local identify_executor = identifyexecutor or getexecutorname or whatexecutor local EXECUTOR_NAME = identify_executor and identify_executor() or "" +local cloneref = global_container.cloneref local gethiddenproperty = global_container.gethiddenproperty -- These should be universal enough @@ -104,6 +94,23 @@ local getscriptbytecode = global_container.getscriptbytecode -- * A lot of assum local base64encode = global_container.base64encode local sha384 +local service = setmetatable({}, { + __index = function(self, serviceName) + local o, s = pcall(Instance.new, serviceName) + local Service = o and s + or game:GetService(serviceName) + or settings():GetService(serviceName) + or UserSettings():GetService(serviceName) + + if cloneref then + Service = cloneref(Service) + end + + self[serviceName] = Service + return Service + end, +}) + local gethiddenproperty_fallback do -- * Load Region of Déjà Vu local UGCValidationService = service.UGCValidationService