Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local meta = getrawmetatable(game)
- local WriteFile = false --Doesnt work for now
- local Console = true -- Neither does this
- local old,LogOnlyDataModelDescendants = meta.__namecall, true
- if WriteFile == true then
- writefile("Remote Spy.txt", "==Remote spy logs for: " .. game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId).Name .. "==")
- x = readfile("Remote Spy.txt")
- print(x)
- end
- local Methods,ClassNames,Ignore = {
- ["Fire"] = true,
- ["FireServer"] = true,
- ["Invoke"] = true,
- ["InvokeServer"] = true
- },{
- ["BindableEvent"] = false,
- ["RemoteEvent"] = true,
- ["BindableFunction"] = true,
- ["RemoteFunction"] = true,
- ["Event"] = true,
- },{
- ["turnevent"] = true,
- ["TurnEvent"] = true,
- }
- function UnpackArgs(args)
- local s = ""
- for i, v in pairs(args) do
- local type = typeof(v)
- if type == "string" then
- s = s .. ", \"" .. v .. "\""
- elseif type == "Instance" then
- s = s .. ", " .. v:GetFullName()
- elseif type == "table" then
- s = s .. ", {" .. UnpackArgs(v) .. "}"
- elseif type == "userdata" then
- if not rawget(getrawmetatable(v), "__tostring") then
- s = s .. ", " .. tostring(v)
- else
- s = s .. ", [userdata]"
- end
- else
- s = s .. ", " .. tostring(v)
- end
- end
- return s:sub(3)
- end
- meta.__namecall = function(s, ...)
- local args = {
- ...
- }
- local methodname = args[#args]
- if Methods[methodname] == nil or Ignore[s.Name] == true or ClassNames[s.ClassName] == nil or (LogOnlyDataModelDescendants == true and not game:IsAncestorOf(s)) then
- return old(s, ...)
- end
- args[#args] = nil
- local stringargs = UnpackArgs(args)
- if console ~= true then
- warn(s.ClassName .. " was called!\nPath: " .. s:GetFullName() .. "\nArgs: " .. stringargs .. "\nMethod: " .. methodname)
- else
- printconsole(s.ClassName .. " was called!\nPath: " .. s:GetFullName() .. "\nArgs: " .. stringargs .. "\nMethod: " .. methodname)
- end
- if WriteFile == true then
- writefile("Remote Spy.txt", readfile("Remote Spy.txt") .. "\n" .. s.ClassName .. " was called!\nPath: " .. s:GetFullName() .. "\nArgs: " .. stringargs .. "\nMethod: " .. methodname)
- end
- return old(s, ...)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement