Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local getinfo = getinfo or debug.getinfo
- local DEBUG = false
- local Hooked = {}
- local Detected, Kill
- -- setthreadidentity(2) -- Commented out if not supported
- -- Search for Detected and Kill functions in the garbage collection
- for i, v in getgc(true) do
- if typeof(v) == "table" then
- local DetectFunc = rawget(v, "Detected")
- local KillFunc = rawget(v, "Kill")
- -- Override Detected function if found
- if typeof(DetectFunc) == "function" and not Detected then
- Detected = DetectFunc
- v.Detected = function(Action, Info, NoCrash)
- if Action ~= "_" then
- if DEBUG then
- warn("Adonis AntiCheat flagged\nMethod: " .. Action .. "\nInfo: " .. Info)
- end
- end
- return true
- end
- table.insert(Hooked, Detected)
- end
- -- Override Kill function if found
- if rawget(v, "Variables") and rawget(v, "Process") and typeof(KillFunc) == "function" and not Kill then
- Kill = KillFunc
- v.Kill = function(Info)
- if DEBUG then
- warn("Adonis AntiCheat tried to kill (fallback): " .. Info)
- end
- end
- table.insert(Hooked, Kill)
- end
- end
- end
- -- Override debug.info
- local OldDebugInfo = getrenv().debug.info
- getrenv().debug.info = function(...)
- local LevelOrFunc, Info = ...
- if Detected and LevelOrFunc == Detected then
- if DEBUG then
- warn("Adonis AntiCheat sanity check detected and broken")
- end
- return coroutine.yield(coroutine.running())
- end
- return OldDebugInfo(...)
- end
- -- setthreadidentity(7) -- Commented out if not supported
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement