JustAPlayer

ff

Nov 8th, 2024
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.08 KB | None | 0 0
  1.  
  2. getgenv = getgenv or function() return getfenv(2) end
  3. local Logger = {} -- Type = {LastCall=os.time(), CallsPerSec=number}
  4. local Limits = { -- How many times an instance can fire per second
  5. BindableEvent = 3,
  6. BindableFunction = 3,
  7. RemoteFunction = 3,
  8. RemoteEvent = 3
  9. }
  10. local vers = '0.0.1b'
  11. function keyF(a)
  12. return typeof(a) == 'number' and ('[%d] = '):format(a) or ('[\'%s\'] = '):format(tostring(a))
  13. end
  14. function keyE(a, b)
  15. if typeof(b):lower() == 'instance' then
  16. return b.Name:gsub(' ', '_')
  17. elseif typeof(b) == 'boolean' then return 'bool' .. tostring(a) elseif typeof(b) == 'string' then return 'str' .. tostring(a) elseif typeof(b) == 'number' then return 'num' .. tostring(a) elseif typeof(b) == 'table' then return 'tbl' .. tostring(a) else return typeof(b) .. tostring(a) end
  18. end
  19. local BootlegDebug = {}
  20. local Output = print -- Change to setclipboard if you want remotes to be copied to your clipboard
  21. function BootlegDebug.getinfo(thread)
  22. local CurrentLine = tonumber(debug.info(thread, 'l'))
  23. local Source = debug.info(thread, 's')
  24. local name = debug.info(thread, 'n')
  25. local numparams, isvrg = debug.info(thread, 'a')
  26. if #name == 0 then name = nil end
  27. local a, b = debug.info(thread, 'a')
  28. return {
  29. ['currentline'] = CurrentLine,
  30. ['Source'] = Source,
  31. ['name'] = tostring(name),
  32. ['numparams'] = tonumber(numparams),
  33. ['is_vararg'] = isvrg and 1 or 0,
  34. ['short_src'] = tostring(Source:sub(1, 60))
  35. }
  36. end
  37. function GetFullName(instance)
  38. local p = instance
  39. local lo = {}
  40. while (p ~= game and p.Parent ~= nil) do
  41. table.insert(lo, p)
  42. p = p.Parent
  43. end
  44. local fullName
  45. if #lo == 0 then
  46. return "nil --[[ PARENTED TO NIL OR DESTROYED ]]"
  47. end
  48. if lo[#lo].ClassName ~= "Workspace" then
  49. fullName = 'game:GetService("' .. lo[#lo].ClassName .. '")'
  50. else
  51. fullName = "workspace"
  52. end
  53. for i = #lo - 1, 1, -1 do
  54. fullName = fullName .. ':FindFirstChild("' .. lo[i].Name .. '")'
  55. end
  56. return fullName
  57. end
  58. function tableloop(tbl, indent, equal, meta)
  59. meta = meta or 0
  60. indent = indent or 0
  61. local result = (not equal and string.rep(' ', indent) or '') .. '{'
  62. equal = false
  63. if typeof(tbl) ~= 'table' then return Handle(tbl, indent) end
  64. local _AM = 0
  65. for key, value in pairs(tbl) do
  66. _AM = _AM + 1
  67. if typeof(value) == 'table' then
  68. if getmetatable(value) then
  69. result = result .. string.rep(' ', indent) .. 'local meta' .. (meta ~= 0 and tostring(meta) or '') .. ' = ' .. tableloop(getmetatable(value), indent, true, meta+1)
  70. meta = meta + 1
  71. else
  72. result = result .. '\n' .. (not equal and string.rep(' ', indent + 1) or '') .. keyF(key) .. tableloop(value, indent + 1, true, meta)
  73. end
  74. else
  75. result = result .. '\n' .. (not equal and string.rep(' ', indent + 1) or '') .. keyF(key) .. Handle(value, indent + 1, keyE(key, value)) .. ';'
  76. end
  77. end
  78. return _AM > 0 and (result .. '\n' .. string.rep(' ', indent) .. '}') or '{}'
  79. end
  80.  
  81. function Handle(data, indent, identifier)
  82. local dataType = typeof(data)
  83. local constructors = {
  84. ['string'] = function(data) return "'" .. data .. "'" end,
  85. ['table'] = function(data) return tableloop(data, indent and indent + 1 or 1, identifier and true or false) end,
  86. ['function'] = function(data) return string.format('function(%s) --[[ i forgor the source? ]] end', BootlegDebug.getinfo(data).numparams) end,
  87. ['number'] = function(data) return tostring(data) end,
  88. ['Vector3'] = function(data) return string.format("Vector3.new(%f, %f, %f)", data.X, data.Y, data.Z) end,
  89. ['Vector2'] = function(data) return string.format("Vector2.new(%f, %f)", data.X, data.Y) end,
  90. ['UDim'] = function(data) return string.format("UDim.new(%f, %f)", data.Scale, data.Offset) end,
  91. ['UDim2'] = function(data) return string.format("UDim2.new(%f, %f, %f, %f)", data.X.Scale, data.X.Offset, data.Y.Scale, data.Y.Offset) end,
  92. ['CFrame'] = function(data) local components = {data:GetComponents()} return string.format("CFrame.new(%s)", table.concat(components, ", ")) end,
  93. ['Color3'] = function(data) return string.format("Color3.fromRGB(%d, %d, %d)", math.floor(data.R * 255), math.floor(data.G * 255), math.floor(data.B * 255)) end,
  94. ['BrickColor'] = function(data) return string.format("BrickColor.new('%s')", tostring(data)) end,
  95. ['Enum'] = function(data) return string.format("%s", tostring(data)) end,
  96. ['EnumItem'] = function(data) return string.format("%s", tostring(data)) end,
  97. ['Instance'] = function(data) return ('%s'):format(GetFullName(data)) end,
  98. ['buffer'] = function(data) return string.rep(' ', indent) .. ('buffer.create(%d)'):format(buffer.len(data)) end,
  99. ['boolean'] = function(data) return tostring(data) end
  100. }
  101. if constructors[dataType] then
  102. return constructors[dataType](data)
  103. else
  104. return tostring(typeof(data)) .. '.new(' .. tostring(data) .. ')'
  105. end
  106. end
  107. function GetEvents()
  108. local Events = {}
  109. for i, v in ipairs(game:GetDescendants()) do
  110. if v:IsA("RemoteEvent") or v:IsA("UnreliableRemoteEvent") then
  111. if v:IsDescendantOf(game:GetService('Players')) and v:IsDescendantOf(game:GetService("Players").LocalPlayer) then
  112. table.insert(Events, v)
  113. elseif not v:IsDescendantOf(game:GetService('Players')) then
  114. table.insert(Events, v)
  115. end
  116. end
  117. end
  118. return Events
  119. end
  120. function GetBEvents()
  121. local Events = {}
  122. for i, v in ipairs(game:GetDescendants()) do
  123. if v:IsA("BindableEvent") then
  124. if v:IsDescendantOf(game:GetService('Players')) and v:IsDescendantOf(game:GetService("Players").LocalPlayer) then
  125. table.insert(Events, v)
  126. elseif not v:IsDescendantOf(game:GetService('Players')) then
  127. table.insert(Events, v)
  128. end
  129. end
  130. end
  131. return Events
  132. end
  133. function GetFunctions()
  134. local Funcs = {}
  135. for i, v in ipairs(game:GetDescendants()) do
  136. if v:IsA("RemoteFunction") then
  137. if v:IsDescendantOf(game:GetService('Players')) and v:IsDescendantOf(game:GetService("Players").LocalPlayer) then
  138. table.insert(Funcs, v)
  139. elseif not v:IsDescendantOf(game:GetService('Players')) then
  140. table.insert(Funcs, v)
  141. end
  142. end
  143. end
  144. return Funcs
  145. end
  146. function GetBFunctions()
  147. local Funcs = {}
  148. for i, v in ipairs(game:GetDescendants()) do
  149. if v:IsA("BindableFunction") then
  150. if v:IsDescendantOf(game:GetService('Players')) and v:IsDescendantOf(game:GetService("Players").LocalPlayer) then
  151. table.insert(Funcs, v)
  152. elseif not v:IsDescendantOf(game:GetService('Players')) then
  153. table.insert(Funcs, v)
  154. end
  155. end
  156. end
  157. return Funcs
  158. end
  159. function EventMain(Event)
  160. Logger[Event] = 0
  161. Event.OnClientEvent:Connect(function(...)
  162. if Logger[Event] > Limits[Event.ClassName] then
  163. return
  164. end
  165. Logger[Event] = Logger[Event] + 1
  166. local StrArgs = tableloop({...})
  167. local FullData = string.format('--[[ Script generated by BootSpy v%s\nRemote Type: %s\n]]\nlocal args = %s\n\n--[[ THE FOLLOWING LINE CANNOT BE EXECUTED BY YOUR EXECUTOR, AS ITS JUST DEMONSTRATING WHAT THE SERVER DID. ]]\n\n%s:FireClient(game:GetService("Players").%s, unpack(args));', vers, Event.ClassName, StrArgs, GetFullName(Event), game:GetService("Players").LocalPlayer.Name)
  168. Output(FullData)
  169. task.delay(1, function()
  170. Logger[Event] = Logger[Event] - 1
  171. end)
  172. end)
  173. end
  174. function BEventMain(Event)
  175. Logger[Event] = 0
  176. Event.Event:Connect(function(...)
  177. if Logger[Event] > Limits[Event.ClassName] then
  178. return
  179. end
  180. Logger[Event] = Logger[Event] + 1
  181. local StrArgs = tableloop({...})
  182. local FullData = string.format('--[[ Script generated by BootSpy v%s\nRemote Type: %s\n]]\nlocal args = %s\n\n--[[ THE FOLLOWING LINE **CAN** BE EXECUTED BY YOUR EXECUTOR AS THE FOLLOWING REMOTE IS A BINDABLE EVENT. ]]\n\n%s:Fire(unpack(args));', vers, Event.ClassName, StrArgs, GetFullName(Event), game:GetService("Players").LocalPlayer.Name)
  183. task.delay(1, function()
  184. Logger[Event] = Logger[Event] - 1
  185. end)
  186. Output(FullData)
  187. end)
  188. end
  189. function FunctionMain(Func)
  190. -- We cannot obtain the old function of the RemoteFunction so we have to override it, Breaking SOME scripts and potentially getting you kicked
  191. Logger[Func] = 0
  192. Func.OnClientInvoke = function(...)
  193. if Logger[Func] > Limits[Func.ClassName] then
  194. return
  195. end
  196. Logger[Func] = Logger[Func] + 1
  197. local StrArgs = tableloop({...})
  198. local FullData = string.format('--[[ Script generated by BootSpy v%s\nRemote Type: %s\n]]\nlocal args = %s\n\n--[[ THE FOLLOWING LINE CANNOT BE EXECUTED BY YOUR EXECUTOR, AS ITS JUST DEMONSTRATING WHAT THE SERVER DID. ]]\n\n%s:InvokeClient(game:GetService("Players").%s, unpack(args));', vers, Func.ClassName, StrArgs, GetFullName(Func), game:GetService("Players").LocalPlayer.Name)
  199. Output(FullData)
  200. task.delay(1, function()
  201. Logger[Func] = Logger[Func] - 1
  202. end)
  203. return '1'
  204. end
  205. end
  206. function BFunctionMain(Func)
  207. -- We cannot obtain the old function of the BindableFunction so we have to override it, Breaking SOME scripts and potentially getting you kicked
  208. Logger[Func] = 0
  209. Func.OnInvoke = function(...)
  210. if Logger[Func] > Limits[Func.ClassName] then
  211. return
  212. end
  213. Logger[Func] = Logger[Func] + 1
  214. local StrArgs = tableloop({...})
  215. local FullData = string.format('--[[ Script generated by BootSpy v%s\nRemote Type: %s\n]]\nlocal args = %s\n\n--[[ THE FOLLOWING LINE **CAN** BE EXECUTED BY YOUR EXECUTOR, BUT A RETURN VALUE AND MAIN FUNCTIONALITY IS MISSING FOR THIS FUNCTIONS SO IT MIGHT NOT DO WHAT YOU EXPECT. ]]\n\n%s:Invoke(unpack(args));', vers, Func.ClassName, StrArgs, GetFullName(Func))
  216. Output(FullData)
  217. task.delay(1, function()
  218. Logger[Func] = Logger[Func] - 1
  219. end)
  220. return '1'
  221. end
  222. end
  223. local a, b, c, d = GetEvents(), GetFunctions(), GetBEvents(), GetBFunctions()
  224. for _, v in pairs(a) do
  225. EventMain(v)
  226. end
  227. for _, v in pairs(b) do
  228. FunctionMain(v)
  229. end
  230. for _, v in pairs(c) do
  231. BEventMain(v)
  232. end
  233. for _, v in pairs(d) do
  234. BFunctionMain(v)
  235. end
  236.  
  237. print('Successfully implemented BootSpy.')
Add Comment
Please, Sign In to add comment