Message 1
Message 1
rconsolename("Script Analyzer")
writee([[
______ _ _______ _
/ _____) (_) _ (_______) | |
( (____ ____ ____ _ ____ _| |_ _______ ____ _____| |_ _ ___ _____ ____
\____ \ / ___)/ ___) | _ (_ _) | ___ | _ \(____ | | | | |/___) ___ |/ ___)
_____) | (___| | | | |_| || |_ | | | | | | / ___ | | |_| |___ | ____| |
(______/ \____)_| |_| __/ \__) |_| |_|_| |_\_____|\_)__ (___/|_____)_|
|_| (____/
]])
-------------------------------------------------------
-- Command Handling
local commands = {}
local function addcmd(aliases, func)
assert(type(aliases) == "table", "Invalid arg 1 supplied")
assert(type(func) == "function", "Invalid arg 2 supplied")
commands[aliases] = func
end
-------------------------------------------------------
-- Add Commands
local analyzers = {
Http = false,
Remotes = false,
Namecalls = false,
Indexes = false,
GTSpy = false,
SynSpy = false,
DisableHttpReq = false,
DisableWebhookReq = false
}
addcmd({"disablewebhook"}, function(args)
if args[1] == "true" then analyzers.DisableWebhookReq = true else
analyzers.DisableWebhookReq = false end
write("Set webhook disabler to "..tostring(analyzers.DisableWebhookReq).."\n\
n")
end)
addcmd({"http"}, function(args)
if args[1] == "true" then analyzers.Http = true else analyzers.Http = false end
write("Set http analyzer to "..tostring(analyzers.Http).."\n\n")
end)
addcmd({"remote"}, function(args)
if args[1] == "true" then analyzers.Remotes = true else analyzers.Remotes =
false end
write("Set remote analyzer to "..tostring(analyzers.Remotes).."\n\n")
end)
addcmd({"namecall"}, function(args)
if args[1] == "true" then analyzers.Namecalls = true else analyzers.Namecalls =
false end
write("Set namecall analyzer to "..tostring(analyzers.Namecalls).."\n\n")
end)
addcmd({"index"}, function(args)
if args[1] == "true" then analyzers.Indexes = true else analyzers.Indexes =
false end
write("Set index analyzer to "..tostring(analyzers.Indexes).."\n\n")
end)
addcmd({"_gtable"}, function(args)
if args[1] == "true" then analyzers.GTSpy = true else analyzers.GTSpy = false
end
write("Set _G table analyzer to "..tostring(analyzers.GTSpy).."\n\n")
end)
addcmd({"syntable"}, function(args)
if args[1] == "true" then analyzers.SynSpy = true else analyzers.SynSpy = false
end
write("Set syn table analyzer to "..tostring(analyzers.SynSpy).."\n\n")
end)
-------------------------------------------------------
local gm = getrawmetatable(game)
-- Game
setreadonly(gm, false)
gm.__index = newcclosure(function(self, k)
if checkcaller() and analyzers.Indexes then
writew("Index Spy - "..tostring(k))
write(tostring(k).." was indexed by "..tostring(self).."\n\n")
end
return oldindex(self, k)
end)
gm.__namecall = newcclosure(function(self, ...)
local m = getnamecallmethod()
if checkcaller() and analyzers.Namecalls then
writew("Namecall Spy - "..tostring(m))
write("Args: "..tostring((...)).."\n\n")
end
return oldnamecall(self, ...)
end)
setreadonly(gm, true)
-- Syn
setreadonly(syn, false)
setmetatable(syn, {
__newindex = function(t, i, v)
if analyzers.SynSpy then
writew("Syn Spy - "..tostring(i))
write("A variable was declared in syn table with the name
"..tostring(i).." set to "..tostring(v).."\n\n")
end
end
})
-- G Spy
setmetatable(_G, {
__index = function(t, k)
if analyzers.GTSpy then writew("GT Spy - Invalid Index") write("Attempt to
index "..k.." with a nil value inside _G\n\n") end return;
end,
__newindex = function(t, i, v)
if analyzers.GTSpy then writew("GT Spy - New Index") write("New index was
declared with the name of "..tostring(i).." and value of "..tostring(v).."\n\n")
end rawset(t, i, v)
end
})
-- Remote Spy
-- Decided to use hookfunction instead of the namecall metatable above
-------------------------------------------------------
-- Initialize