Skip to content

Commit

Permalink
Merge pull request #55 from jdpatdiscord/revision
Browse files Browse the repository at this point in the history
fix detection
  • Loading branch information
Upbolt authored Jan 28, 2022
2 parents 8c844b3 + ff08e09 commit 2f9bafd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/RemoteSpy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ nmcTrampoline = hookMetaMethod(game, "__namecall", function(...)

if remotesViewing[instance.ClassName] and instance ~= remoteDataEvent and remoteMethods[getNamecallMethod()] then
local remote = currentRemotes[instance]
local vargs = {...}

table.remove(vargs, 1)
local vargs = {select(2, ...)}

if not remote then
remote = Remote.new(instance)
Expand Down Expand Up @@ -101,19 +99,21 @@ end

for _name, hook in pairs(methodHooks) do
local originalMethod
originalMethod = hookFunction(hook, newCClosure(function(instance, ...)
originalMethod = hookFunction(hook, newCClosure(function(...)
local instance = ...

if typeof(instance) ~= "Instance" then
return originalMethod(instance, ...)
return originalMethod(...)
end

do
local success = pcall(checkPermission, instance)
if (not success) then return originalMethod(instance, ...) end
if (not success) then return originalMethod(...) end
end

if remotesViewing[instance.ClassName] and instance ~= remoteDataEvent then
local remote = currentRemotes[instance]
local vargs = {...}
local vargs = {select(2, ...)}

if not remote then
remote = Remote.new(instance)
Expand All @@ -139,7 +139,7 @@ for _name, hook in pairs(methodHooks) do
end
end

return originalMethod(instance, ...)
return originalMethod(...)
end))

oh.Hooks[originalMethod] = hook
Expand Down

0 comments on commit 2f9bafd

Please sign in to comment.