--[[ Corewave's RemoteSpy V2.0 currently supports Synapse X. Written by corewave, V3rm profile: https://v3rmillion.net/member.php?action=profile&uid=504647, DiscordID: 610951488088440833 --]] local mt = getrawmetatable(game) local namecall = mt.__namecall local index = mt.__index setreadonly(mt, false) local detectedMethods = { ['FireServer'] = true, ['InvokeServer'] = true, ['Fire'] = false, ['Invoke'] = false } local ignoredRemotes = { ['CharacterSoundEvent'] = true } local function countTable(t) local counter = 0 if (not t) or type(t)~='table' then return false end for i,v in next, t do counter = counter + 1 end return counter end local function formatValue(v) local res, data = '', (typeof or type)(v) if data == 'string' then res = '"' .. tostring(v) .. '"' elseif data == 'number' or data == 'boolean' or data == 'function' or data == 'nil' then res = tostring(v) elseif data == 'table' then res = tableFormat(v) elseif data == 'userdata' then res = 'userdata' elseif data == 'Instance' then res = v:GetFullName() else res = data .. '.new(' .. tostring(v) .. ')' end return res end local function tableFormat(t) local res, counterG, lengthG = '', 0, countTable(t) local table_spacing = string.rep(' ', counterG) if not lengthG and lengthG ~= 0 then return formatValue(t) end if lengthG == 0 then return 'None' end local function listTable(tbl) local res_local = '' local length = countTable(tbl) local counter = 1 counterG = counterG + 1 table_spacing = string.rep(' ', counterG) for i,v in next, tbl do res_local = res_local .. table_spacing .. ' [' .. formatValue(i) .. ']' .. ' = ' .. (type(v) == 'table' and listTable(v) or formatValue(v)) .. (counter~=length and ',' or '') .. '\n' counter = counter + 1 end table_spacing = string.sub(table_spacing, 1, -2) return '{\n'..res_local .. table_spacing ..' }' end res = listTable(t) return res end local function handleRequest(self, calling_script, method, args) spawn(function() local output_template = "Remote location: %s\nScript location: %s\nMethod: %s\nArguments: %s\n\n" rconsoleprint(output_template:format(pcall(function() return self.GetFullName end) and self.GetFullName(self) or 'Not found!', pcall(function() return calling_script.GetFullName end) and calling_script.GetFullName(calling_script) or 'Not found!', method, tableFormat(args))) end) end local function handleHookfunc(methods) for i,v in next, methods do local oldFunc if detectedMethods[v] then oldFunc = hookfunction(Instance.new(i)[v], function(self, ...) if (not ignoredRemotes[tostring(self)]) then handleRequest(self, getcallingscript(), v, {...}) end return oldFunc(self, ...) end) end end end mt.__namecall = newcclosure(function(self, ...) local method = getnamecallmethod() if detectedMethods[method] and (not ignoredRemotes[tostring(self)]) then handleRequest(self, getcallingscript(), method, {...}) end return namecall(self, ...) end) handleHookfunc({ ['RemoteEvent'] = 'FireServer', ['RemoteFunction'] = 'InvokeServer', ['BindableEvent'] = 'Fire', ['BindableFunction'] = 'Invoke' })