Advertisement
Geeneus

Object Finder - Exploit Tool. By RGeeneus

Mar 24th, 2017
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.99 KB | None | 0 0
  1. local names = {} -- Enter names of objects to match here.
  2.  
  3. local classes = { -- Enter classes of objects to match here.
  4.     "RemoteFunction",
  5.     "BindableEvent",
  6.     "BindableFunction",
  7.     "RemoteEvent"
  8. }
  9.  
  10. local caseSensitive = true -- Whether names are case sensitive. Includes names, ignore, and ignoreDescendants.  
  11. local outputParents = true -- Whether to output the parents of matches.
  12. local outputFullLocations = false -- Whether to output each individual match and their locations.
  13.  
  14. local handler = function (match)
  15.     -- Your code here. Do anything to each match. Example: "match:Destroy()." or "match.SoundId = []"
  16. end
  17.  
  18. local ignore = {} -- Enter names of matching objects to ignore.
  19.  
  20. local ignoreDescendants = { -- Enter names of objects whose descendants will be ignored.
  21.     "DefaultChatSystemChatEvents"
  22. }
  23.  
  24. ----------------------------------------------------------------------------------------------------
  25.  
  26. local m = {}
  27. local executions = 0
  28. local cs = caseSensitive
  29. local shouldIgnore = function (comp, desc)
  30.     for i, e in ipairs(desc and ignoreDescendants or ignore) do if ((cs and comp or string.lower(comp)) == (cs and e or string.lower(e))) then return true end end
  31.     return false
  32. end
  33.  
  34. local analyse = function (ch)
  35.     executions = executions + 1
  36.     if executions % 1000 == 0 then wait() end
  37.     local nm, cm = #names == 0 and true or false, #classes == 0 and true or false
  38.     for i, e in ipairs(names) do if ((cs and ch.Name or string.lower(ch.Name)) == (ch and e or string.lower(e))) then nm = true break end end
  39.     for i, e in ipairs(classes) do if ch.ClassName and ch:IsA(e) then cm = true break end end
  40.     if nm and cm and not shouldIgnore(ch.Name, false) then m[#m + 1] = ch end
  41.     if not shouldIgnore(ch.Name, true) and #ch:GetChildren() > 0 then r(ch) end
  42. end
  43.  
  44. r = function (main)
  45.     for i, e in ipairs(main:GetChildren()) do pcall(analyse, e) end
  46. end
  47.  
  48. r(game)
  49.  
  50. warn("Your search returned " .. #m .. " results.")
  51.  
  52. if #m > 0 then
  53.     if outputParents or outputFullLocations then
  54.         local p = {}
  55.         for i, e in ipairs(m) do
  56.             if outputFullLocations then print(e.ClassName .. " \"" .. e.Name .. "\" found with address: " .. e:GetFullName()) end
  57.             if outputParents then          
  58.                 if not p[e.Parent] then p[e.Parent] = {classes = {[e.ClassName] = 1}, classSize = 1}
  59.                 elseif not p[e.Parent].classes[e.ClassName] then p[e.Parent].classes[e.ClassName] = 1 p[e.Parent].classSize = p[e.Parent].classSize + 1
  60.                 else p[e.Parent].classes[e.ClassName] = p[e.Parent].classes[e.ClassName] + 1 end
  61.             end    
  62.         end
  63.         if outputParents then
  64.             for i, e in pairs(p) do
  65.                 local msg = ""
  66.                 local runs = 0
  67.                 for className, v in pairs(e.classes) do
  68.                     runs = runs + 1
  69.                     msg = msg .. v .. " " .. className .. "(s)" .. (runs + 1 < e.classSize and ", " or (runs + 1 == e.classSize and ((e.classSize > 2 and "," or "") .. " and ") or " "))
  70.                 end
  71.                 warn(msg .. "found in: " .. i:GetFullName())
  72.             end
  73.         end
  74.     end
  75.     for i, e in ipairs(m) do handler(e) end
  76. end
  77.  
  78. -- OBJECT FINDER - EXPLOIT TOOL. BY RGEENEUS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement