Advertisement
ExploiterRoblox

Remote Spy [ROBLOX] [REMOTE FINDER]

Nov 9th, 2020
130
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2.  
  3. -Created by Vaeb.
  4. -You can spy remotes!
  5. -And you need to use Dex Explorer to find the remote of anticheat
  6. --]]
  7.  
  8. _G.scanRemotes = true
  9.  
  10. _G.ignoreNames = {
  11.     Event = true;
  12.     MessagesChanged = true;
  13. }
  14.  
  15. setreadonly(getrawmetatable(game), false)
  16. local pseudoEnv = {}
  17. local gameMeta = getrawmetatable(game)
  18.  
  19. local tabChar = "      "
  20.  
  21. local function getSmaller(a, b, notLast)
  22.     local aByte = a:byte() or -1
  23.     local bByte = b:byte() or -1
  24.     if aByte == bByte then
  25.         if notLast and #a == 1 and #b == 1 then
  26.             return -1
  27.         elseif #b == 1 then
  28.             return false
  29.         elseif #a == 1 then
  30.             return true
  31.         else
  32.             return getSmaller(a:sub(2), b:sub(2), notLast)
  33.         end
  34.     else
  35.         return aByte < bByte
  36.     end
  37. end
  38.  
  39. local function parseData(obj, numTabs, isKey, overflow, noTables, forceDict)
  40.     local objType = typeof(obj)
  41.     local objStr = tostring(obj)
  42.     if objType == "table" then
  43.         if noTables then
  44.             return objStr
  45.         end
  46.         local isCyclic = overflow[obj]
  47.         overflow[obj] = true
  48.         local out = {}
  49.         local nextIndex = 1
  50.         local isDict = false
  51.         local hasTables = false
  52.         local data = {}
  53.  
  54.         for key, val in next, obj do
  55.             if not hasTables and typeof(val) == "table" then
  56.                 hasTables = true
  57.             end
  58.  
  59.             if not isDict and key ~= nextIndex then
  60.                 isDict = true
  61.             else
  62.                 nextIndex = nextIndex + 1
  63.             end
  64.  
  65.             data[#data+1] = {key, val}
  66.         end
  67.  
  68.         if isDict or hasTables or forceDict then
  69.             out[#out+1] = (isCyclic and "Cyclic " or "") .. "{"
  70.             table.sort(data, function(a, b)
  71.                 local aType = typeof(a[2])
  72.                 local bType = typeof(b[2])
  73.                 if bType == "string" and aType ~= "string" then
  74.                     return false
  75.                 end
  76.                 local res = getSmaller(aType, bType, true)
  77.                 if res == -1 then
  78.                     return getSmaller(tostring(a[1]), tostring(b[1]))
  79.                 else
  80.                     return res
  81.                 end
  82.             end)
  83.             for i = 1, #data do
  84.                 local arr = data[i]
  85.                 local nowKey = arr[1]
  86.                 local nowVal = arr[2]
  87.                 local parseKey = parseData(nowKey, numTabs+1, true, overflow, isCyclic)
  88.                 local parseVal = parseData(nowVal, numTabs+1, false, overflow, isCyclic)
  89.                 if isDict then
  90.                     local nowValType = typeof(nowVal)
  91.                     local preStr = ""
  92.                     local postStr = ""
  93.                     if i > 1 and (nowValType == "table" or typeof(data[i-1][2]) ~= nowValType) then
  94.                         preStr = "\n"
  95.                     end
  96.                     if i < #data and nowValType == "table" and typeof(data[i+1][2]) ~= "table" and typeof(data[i+1][2]) == nowValType then
  97.                         postStr = "\n"
  98.                     end
  99.                     out[#out+1] = preStr .. string.rep(tabChar, numTabs+1) .. parseKey .. " = " .. parseVal .. ";" .. postStr
  100.                 else
  101.                     out[#out+1] = string.rep(tabChar, numTabs+1) .. parseVal .. ";"
  102.                 end
  103.             end
  104.             out[#out+1] = string.rep(tabChar, numTabs) .. "}"
  105.         else
  106.             local data2 = {}
  107.             for i = 1, #data do
  108.                 local arr = data[i]
  109.                 local nowVal = arr[2]
  110.                 local parseVal = parseData(nowVal, 0, false, overflow, isCyclic)
  111.                 data2[#data2+1] = parseVal
  112.             end
  113.             out[#out+1] = "{" .. table.concat(data2, ", ") .. "}"
  114.         end
  115.  
  116.         return table.concat(out, "\n")
  117.     else
  118.         local returnVal = nil
  119.         if (objType == "string" or objType == "Content") and (not isKey or tonumber(obj:sub(1, 1))) then
  120.             local retVal = '"' .. objStr .. '"'
  121.             if isKey then
  122.                 retVal = "[" .. retVal .. "]"
  123.             end
  124.             returnVal = retVal
  125.         elseif objType == "EnumItem" then
  126.             returnVal = "Enum." .. tostring(obj.EnumType) .. "." .. obj.Name
  127.         elseif objType == "Enum" then
  128.             returnVal = "Enum." .. objStr
  129.         elseif objType == "Instance" then
  130.             returnVal = obj.Parent and obj:GetFullName() or obj.ClassName
  131.         elseif objType == "CFrame" then
  132.             returnVal = "CFrame.new(" .. objStr .. ")"
  133.         elseif objType == "Vector3" then
  134.             returnVal = "Vector3.new(" .. objStr .. ")"
  135.         elseif objType == "Vector2" then
  136.             returnVal = "Vector2.new(" .. objStr .. ")"
  137.         elseif objType == "UDim2" then
  138.             returnVal = "UDim2.new(" .. objStr:gsub("[{}]", "") .. ")"
  139.         elseif objType == "BrickColor" then
  140.             returnVal = "BrickColor.new(\"" .. objStr .. "\")"
  141.         elseif objType == "Color3" then
  142.             returnVal = "Color3.new(" .. objStr .. ")"
  143.         elseif objType == "NumberRange" then
  144.             returnVal = "NumberRange.new(" .. objStr:gsub("^%s*(.-)%s*$", "%1"):gsub(" ", ", ") .. ")"
  145.         elseif objType == "PhysicalProperties" then
  146.             returnVal = "PhysicalProperties.new(" .. objStr .. ")"
  147.         else
  148.             returnVal = objStr
  149.         end
  150.         return returnVal
  151.     end
  152. end
  153.  
  154. function tableToString(t)
  155.     return parseData(t, 0, false, {}, nil, false)
  156. end
  157.  
  158. local detectClasses = {
  159.     BindableEvent = true;
  160.     BindableFunction = true;
  161.     RemoteEvent = true;
  162.     RemoteFunction = true;
  163. }
  164.  
  165. local classMethods = {
  166.     BindableEvent = "Fire";
  167.     BindableFunction = "Invoke";
  168.     RemoteEvent = "FireServer";
  169.     RemoteFunction = "InvokeServer";
  170. }
  171.  
  172. local realMethods = {}
  173.  
  174. for name, enabled in next, detectClasses do
  175.     if enabled then
  176.         realMethods[classMethods[name]] = Instance.new(name)[classMethods[name]]
  177.     end
  178. end
  179.  
  180. for key, value in next, gameMeta do pseudoEnv[key] = value end
  181.  
  182. local incId = 0
  183.  
  184. local function getValues(self, key, ...)
  185.     return {realMethods[key](self, ...)}
  186. end
  187.  
  188. gameMeta.__index, gameMeta.__namecall = function(self, key)
  189.     if not realMethods[key] or _G.ignoreNames[self.Name] or not _G.scanRemotes then return pseudoEnv.__index(self, key) end
  190.     return function(_, ...)
  191.         incId = incId + 1
  192.         local nowId = incId
  193.         local strId = "[RemoteSpy_" .. nowId .. "]"
  194.  
  195.         local allPassed = {...}
  196.         local returnValues = {}
  197.  
  198.         local ok, data = pcall(getValues, self, key, ...)
  199.  
  200.         if ok then
  201.             returnValues = data
  202.             print("\n" .. strId .. " ClassName: " .. self.ClassName .. " | Path: " .. self:GetFullName() .. " | Method: " .. key .. "\n" .. strId .. " Packed Arguments: " .. tableToString(allPassed) .. "\n" .. strId .. " Packed Returned: " .. tableToString(returnValues) .. "\n")
  203.         else
  204.             print("\n" .. strId .. " ClassName: " .. self.ClassName .. " | Path: " .. self:GetFullName() .. " | Method: " .. key .. "\n" .. strId .. " Packed Arguments: " .. tableToString(allPassed) .. "\n" .. strId .. " Packed Returned: [ERROR] " .. data .. "\n")
  205.         end
  206.  
  207.         return unpack(returnValues)
  208.     end
  209. end
  210.  
  211. print("\nRan Vaeb's RemoteSpy\n")
Advertisement
RAW Paste Data Copied
Advertisement