Advertisement
AndrewTheMaster

Untitled

Aug 21st, 2017
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. -- RemoteSpy for Synapse
  2. -- Written by Autumn (fixed by 3dsboy08) on V3rmillion
  3.  
  4. function formatargs(args,showkeys)
  5. if #args == 0 then return "N/A" end
  6. local strargs = {}
  7. for k,v in next,args do
  8. local argstr = ""
  9. if type(v) == "string" then
  10. argstr = "\"" .. v .. "\""
  11. elseif type(v) == "table" then
  12. argstr = "{" .. formatargs(v,true) .. "}"
  13. else
  14. argstr = tostring(v)
  15. end
  16. if showkeys and type(k) ~= "number" then
  17. table.insert(strargs,k.."="..argstr)
  18. else
  19. table.insert(strargs,argstr)
  20. end
  21. end
  22. return table.concat(strargs, ", ")
  23. end
  24.  
  25. local console = Synapse:GetConsole()
  26. console:CreateConsole("Synapse RemoteSpy")
  27.  
  28. local realmethods = {}
  29. realmethods.Fire = Instance.new("BindableEvent").Fire
  30. realmethods.Invoke = Instance.new("BindableFunction").Invoke
  31. realmethods.FireServer = Instance.new("RemoteEvent").FireServer
  32. realmethods.InvokeServer = Instance.new("RemoteFunction").InvokeServer
  33.  
  34. function hook(methodname, self, ...)
  35. local args = {...}
  36. local ret = {realmethods[methodname](self,...)}
  37. console:Write(self.ClassName.." called!\nPath: ")
  38. console:SetColor(console.White)
  39. console:Write(self:GetFullName())
  40. console:SetColor(console.LightGray)
  41. console:Write("\n".."Args: ")
  42. console:SetColor(console.White)
  43. console:Write(formatargs(args))
  44. console:SetColor(console.LightGray)
  45. console:Write("\nReturn: ")
  46. console:SetColor(console.White)
  47. console:Write(formatargs(ret))
  48. console:SetColor(console.LightGray)
  49. console:WriteLine("\n")
  50. return unpack(ret)
  51. end
  52.  
  53. console:SetColor(console.White)
  54. console:WriteLine("Synapse RemoteSpy v1.0.0 // by 3dsboy08\n")
  55. console:SetColor(console.LightGray)
  56. Synapse:SetNamecallHook("FireServer", function(self, ...)
  57. if self:IsA("RemoteEvent") then
  58. hook("FireServer", self, ...)
  59. end
  60. end)
  61. Synapse:SetNamecallHook("InvokeServer", function(self, ...)
  62. if self:IsA("RemoteFunction") then
  63. hook("InvokeServer", self, ...)
  64. end
  65. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement