local __R = {} --[[ some part of the code mine but mostly made with claude opus 5.5/sonnet 5.5 thanks to that sorry for bad code ]] --[[ - Logs RemoteEvent:FireServer, RemoteFunction:InvokeServer and UnreliableRemoteEvent:FireServer (namecall and, if you want, direct calls like Remote.FireServer(Remote, ...)). Optional: BindableEvent:Fire / BindableFunction:Invoke and incoming OnClientEvent. - Actors: scripts inside Actors run in their own Lua VM, so a normal hook never sees their remotes. With "Spy on actors" the spy injects a small hook into every actor (getactors + run_on_actor, or getactorthreads + run_on_thread) that sends the calls back through a comm channel. New actors are picked up while "Watch for new actors" is on. - Click a call for its generated code (copy it, or run it again), the remote's path, the calling script and the actor. Block stops the game from firing that remote, Ignore hides it. - Settings (saved to LarpSpy/settings.json): what is hooked, actors, max logs, merging repeats, ignored names, code style, accent colour and the toggle key. - Optional: every table.* / buffer.* function the game calls (Tables / Buffers, capped per frame so the game doesn't stall) and LogService output (every print / warn / error line, with an optional backlog of what is already in the output window). Running the script again removes the old window and restores every hook before installing fresh ones. ]] local folder = "LarpSpy" __R.font_url = "https://raw.githubusercontent.com/nfpw/LarpSpy/refs/heads/main/assets/Monaco.ttf" __R.icon_base = "https://raw.githubusercontent.com/nfpw/LarpSpy/main/assets/" local X = { } local UI = { } UI.dummy_event = function() if not UI.dummy_bindable then UI.dummy_bindable = Instance.new("BindableEvent") end return UI.dummy_bindable.Event end X.is_c = function(Function) local ok, result = pcall(iscclosure or function(f) return debug.info(f, "s") == "[C]" end, Function) return ok and result == true end local env = (getgenv and getgenv()) if not game.IsLoaded(game) then game.Loaded.Wait(game.Loaded) end if env.LarpSpy and env.LarpSpy.Destroy then pcall(env.LarpSpy.Destroy) task.wait() end local raw_hook = hookfunction or replaceclosure local raw_meta = hookmetamethod if env.__LarpSpyHooks then for index = #env.__LarpSpyHooks, 1, -1 do local Hook = env.__LarpSpyHooks[index] pcall(function() if Hook.Raw then if setreadonly then setreadonly(Hook.Raw, false) end Hook.Raw[Hook.Name] = Hook.Old if setreadonly then setreadonly(Hook.Raw, true) end elseif Hook.Meta then raw_meta(Hook.Meta, Hook.Name, Hook.Old) elseif Hook.Oth and oth and oth.unhook then oth.unhook(Hook.Target) elseif restorefunction then restorefunction(Hook.Target) elseif raw_hook then raw_hook(Hook.Target, Hook.Old) end end) end env.__LarpSpyShared = nil end env.__LarpSpyHooks = { } local clone_ref = cloneref or function(object) return object end local players = clone_ref(game.GetService(game, "Players")) local user_input_service = clone_ref(game.GetService(game, "UserInputService")) local run_service = clone_ref(game.GetService(game, "RunService")) local http_service = clone_ref(game.GetService(game, "HttpService")) __R.TweenService = clone_ref(game.GetService(game, "TweenService")) local core_gui = clone_ref(game.GetService(game, "CoreGui")) UI.log_service = clone_ref(game.GetService(game, "LogService")) UI.own_callbacks = setmetatable({ }, {__mode = "k"}) UI.log_events = {MessageOut = true} X.get_namecall_method = getnamecallmethod X.hook_metamethod = raw_meta and function(object, Name, replacement) local old = raw_meta(object, Name, replacement) table.insert(env.__LarpSpyHooks, {Meta = object, Name = Name, Old = old}) return old end X.real_c_closure = newcclosure or function(Function) return Function end X.new_c_closure = X.real_c_closure X.raw_insert = table.insert X.hook_function = (raw_hook or (oth and oth.hook)) and function(target, replacement, filter) local old if env.__LarpUseOth and oth and oth.hook and X.is_c(target) then local ok, result = pcall(oth.hook, target, replacement, filter) if ok then X.raw_insert(env.__LarpSpyHooks, {Target = target, Old = result, Oth = true}) return result end env.__LarpOthError = tostring(result) end if env.__LarpUseOth and X.real_c_closure ~= nil and islclosure and islclosure(replacement) then replacement = X.real_c_closure(replacement) end old = (raw_hook or replaceclosure)(target, replacement) X.raw_insert(env.__LarpSpyHooks, {Target = target, Old = old}) return old end X.set_identity = setthreadidentity or set_thread_identity or (syn and syn.set_thread_identity) X.with_identity = function(fn) if not fn then return fn end return function(...) local low = env.__LarpLowLevel and X.set_identity if low then pcall(X.set_identity, 2) end local results = table.pack(pcall(fn, ...)) if low then pcall(X.set_identity, 8) end if not results[1] then error(results[2], 0) end return table.unpack(results, 2, results.n) end end X.hook_function = X.with_identity(X.hook_function) X.hook_metamethod = X.with_identity(X.hook_metamethod) X.check_caller = checkcaller or function() return false end X.get_calling_script = getcallingscript or function() return nil end X.SetClipboard = setclipboard or toclipboard or set_clipboard X.get_hui = gethui or get_hidden_gui X.FireSignal = firesignal or fire_signal X.ReplicateSignal = replicatesignal or replicate_signal X.fire_proximity = fireproximityprompt or fire_proximity_prompt X.fire_touch = firetouchinterest or fire_touch_interest X.fire_click = fireclickdetector or fire_click_detector X.get_bytecode = getscriptbytecode or get_script_bytecode or dumpstring X.Request = (syn and syn.request) or (http and http.request) or http_request or request X.get_actors = getactors or (syn and syn.getactors) X.RunOnActor = run_on_actor or (syn and syn.run_on_actor) X.get_actor_threads = getactorthreads X.RunOnThread = run_on_thread X.CreateCommChannel = create_comm_channel or (syn and syn.create_comm_channel) local rgb = Color3.fromRGB local Settings = { Events = true, Functions = true, Unreliable = true, Bindables = false, Incoming = false, CrashFinder = false, CrashAutoBlock = false, CrashArgMode = "value", CrashPrint = 150, CrashNew = 400, CrashBufferMB = 32, BlockSpawnCrash = false, CrashSpawn = 200, Direct = true, Executor = false, Actors = true, WatchActors = true, MaxLogs = 300, Stack = "remote", StackToTop = false, HistoryLimit = 500, IgnoreNames = "", OnlyNames = "", AutoCopy = false, EscapeUnicode = true, PauseKey = "None", ExportFormat = "code", Require = false, NetFinder = false, NetFinderMin = 8, Http = false, Prompts = true, AutoPrompts = false, AutoPromptDelay = 0.3, InstantPrompts = false, Touches = false, TouchNames = "kill, lava, damage, hurt, harm, death, deadly, fire, burn, acid, poison, spike, trap, shock, laser, void, electr", BlockAllTouches = false, ToolOnlyWired = false, ToolTouches = false, TouchAll = false, GuiClicks = true, Clicks = true, ActorMessages = true, Tools = true, Kicks = true, BlockKicks = false, CoreState = true, BlockCoreState = false, Teleports = true, BlockTeleports = false, Purchases = true, BlockPurchases = false, OwnsSpoof = "off", Shutdowns = true, BlockShutdowns = false, Creates = false, BlockCreates = false, InstanceNew = false, BlockInstanceNew = false, Waits = false, BlockWaits = false, RakNet = false, RakNetReceive = false, WaitMap = "", AntiSpam = false, AntiSpamWindow = 1, AttrAntiSpam = true, AttrTargets = "", BlockGetAttributes = false, GetAttrBool = "true", GetAttrNumber = 100, GetAttrString = "", BlockSetAttributes = false, GetAttrCodeSet = false, GetAttributes = false, SetAttributes = false, Sounds = false, BlockSounds = false, InstanceNewReturn = "Folder", InstanceNewCustom = "", BlockPrint = false, BlockWarn = false, BlockError = false, Tables = false, Buffers = false, LibRate = 60, LibBigTables = 200, LogService = false, LogTypes = "all", LogBacklog = false, WatchSignals = "", LogHistory = true, LogReaders = false, BlockEvents = false, BlockFunctions = false, BlockUnreliable = false, BlockBindables = false, BlockActorMessages = false, Animations = false, UpvalueSpy = false, UpvalueFn = "", AnimDefaults = false, BlockTools = false, BlockLogHistory = false, BlockHttp = false, BlockPrompts = false, BlockTouchCalls = false, BlockClickCalls = false, BlockFireSignals = false, BlockReplicateSignals = false, BlockLogReaders = false, BlockTables = false, BlockBuffers = false, ParentNil = true, BlockParentNil = false, BlockSource = "game", Connections = false, FireSignals = true, ReplicateSignals = true, CallMode = "no args", BeautifyRename = false, CallViaFunction = false, StripComments = false, CodeStyle = "table", PathStyle = "GetService", SmartPaths = true, Beautify = true, TrackRenames = true, RemoteVariable = false, Wrap = "none", LoopCount = 10, LoopDelay = 0, RunDelay = 0.1, Unpack = "unpack", CallerComment = true, AutoFill = true, UpvalueSearch = false, UpvalueDeep = true, UpvalueArgs = "all", DebugInfo = false, DebugStack = true, RemoteStack = false, DecodeBuffers = false, BufferHeader = 1, BufferLayouts = "", AutoPackets = true, HookPackets = false, BufferCode = false, BufferCodeMode = "require", PacketDump = false, PacketModules = "ByteNetPackets", ShowSchema = false, PacketSchemas = "", BufferFull = true, DebugBlock = "off", DebugOnly = "", DebugCustom = "", DebugGroup = "caller", DebugCalls = false, AskAdonis = true, UseOthHook = true, LowLevelExec = false, Accent = "Blue", AccentHex = "", Theme = "Auto", LogAnimations = true, Look = "modern", ToggleKey = "RightControl", GameOnly = false, } UI.default_settings = { } for key, Value in Settings do UI.default_settings[key] = type(Value) == "table" and table.clone(Value) or Value end local function ensure_folder() if isfolder and makefolder and not isfolder(folder) then pcall(makefolder, folder) end end local function save_settings() if writefile then ensure_folder() pcall(writefile, Settings.GameOnly and UI.game_file or (folder .. "/settings.json"), http_service.JSONEncode(http_service, Settings)) end end UI.game_key = tostring(game.GameId ~= 0 and game.GameId or game.PlaceId) UI.game_file = folder .. "/game_" .. UI.game_key .. ".json" do local function overlay(path) local ok, saved = pcall(function() return http_service.JSONDecode(http_service, readfile(path)) end) if ok and type(saved) == "table" then for key, Value in saved do if Settings[key] ~= nil and type(Settings[key]) == type(Value) then Settings[key] = Value end end return true end return false end Settings.GameOnly = false overlay(folder .. "/settings.json") Settings.GameOnly = false if overlay(UI.game_file) then Settings.GameOnly = true end Settings.DebugCalls = false end UI.classic = Settings.Look == "classic" if Settings.AskAdonis and not env.__LarpAdonisLoaded then local answer = nil env.__LarpHttpSelf = true local fetched, ui_source = pcall(function() return game.HttpGet(game, "https://raw.githubusercontent.com/nfpw/LarpSpy/main/uiassets.lua") end) env.__LarpHttpSelf = false if fetched and type(ui_source) == "string" and #ui_source > 0 and loadstring then local compiled = loadstring(ui_source, "uiassets") local built = compiled and select(2, pcall(compiled)) UI.assets = type(built) == "table" and built or nil end if UI.assets then answer = UI.assets.adonis_prompt({ settings = Settings, save = save_settings, has_oth = oth and oth.hook, reset = function() for key, Value in UI.default_settings do Settings[key] = type(Value) == "table" and table.clone(Value) or Value end if delfile and isfile and isfile(UI.game_file) then pcall(delfile, UI.game_file) end save_settings() end, parent = function(ask) if syn and syn.protect_gui then pcall(syn.protect_gui, ask) end if not (X.get_hui and pcall(function() ask.Parent = X.get_hui() end) and ask.Parent) then if not pcall(function() ask.Parent = core_gui end) then ask.Parent = players.LocalPlayer.WaitForChild(players.LocalPlayer, "PlayerGui") end end end, }) end if answer == "never" then Settings.AskAdonis = false save_settings() elseif answer == "load" then local source = nil env.__LarpHttpSelf = true local done = pcall(function() source = game.HttpGet(game, "https://raw.githubusercontent.com/nfpw/LarpSpy/refs/heads/main/ab.lua") end) env.__LarpHttpSelf = false if not done or type(source) ~= "string" or #source == 0 then UI.adonis_status = "adonis bypass: download failed" elseif not loadstring then UI.adonis_status = "adonis bypass: no loadstring in this executor" else local compiled, compile_error = loadstring(source) if not compiled then UI.adonis_status = "adonis bypass: compile error " .. tostring(compile_error) else local ok, run_error = pcall(compiled) if ok then env.__LarpAdonisLoaded = true UI.adonis_status = "adonis bypass loaded" task.wait(1) else UI.adonis_status = "adonis bypass error: " .. tostring(run_error) end end end end end env.__LarpLowLevel = Settings.LowLevelExec == true env.__LarpUseOth = nil env.__LarpOthError = nil if Settings.UseOthHook then if oth and oth.hook then X.new_c_closure = function(Function) return Function end env.__LarpUseOth = true UI.hook_note = "hooks: oth.hook" else UI.hook_note = "oth.hook not found, using hookfunction" end end UI.accent_presets = { {"Blue", rgb(120, 200, 255)}, {"Pink", rgb(255, 120, 190)}, {"Green", rgb(120, 230, 150)}, {"Orange", rgb(255, 170, 90)}, {"Purple", rgb(180, 140, 255)}, {"Red", rgb(255, 100, 100)}, } do local function preset_color(Name) for _, preset in UI.accent_presets do if preset[1] == Name then return preset[2] end end return UI.accent_presets[1][2] end function UI.theme_for(Name) if Name == "Auto" or not UI.themes[Name] then return UI.classic and "Classic" or "Midnight" end return Name end function UI.accent_color() local code = type(Settings.AccentHex) == "string" and string.match(Settings.AccentHex, "^#?(%x%x%x%x%x%x)$") if code then local ok, color = pcall(Color3.fromHex, code) if ok and color then return color end end return preset_color(Settings.Accent) end end UI.themes = { Midnight = {Background = rgb(15, 16, 21), Border = rgb(38, 41, 52), Inline = rgb(22, 24, 31), Hover = rgb(44, 48, 62), Page = rgb(19, 21, 27), Outline = rgb(40, 44, 56), Element = rgb(32, 35, 45), Text = rgb(232, 234, 240), Dim = rgb(151, 153, 160), Bad = rgb(235, 90, 90)}, Slate = {Background = rgb(24, 27, 33), Border = rgb(54, 60, 72), Inline = rgb(31, 35, 43), Hover = rgb(58, 64, 78), Page = rgb(27, 31, 38), Outline = rgb(52, 58, 70), Element = rgb(40, 45, 55), Text = rgb(228, 232, 238), Dim = rgb(150, 158, 170), Bad = rgb(235, 90, 90)}, Amoled = {Background = rgb(0, 0, 0), Border = rgb(30, 30, 34), Inline = rgb(10, 10, 12), Hover = rgb(36, 36, 42), Page = rgb(5, 5, 7), Outline = rgb(34, 34, 40), Element = rgb(20, 20, 24), Text = rgb(240, 240, 244), Dim = rgb(145, 145, 152), Bad = rgb(235, 90, 90)}, Mocha = {Background = rgb(20, 17, 19), Border = rgb(52, 44, 48), Inline = rgb(28, 24, 27), Hover = rgb(58, 49, 55), Page = rgb(24, 20, 23), Outline = rgb(54, 46, 51), Element = rgb(38, 32, 36), Text = rgb(236, 230, 232), Dim = rgb(160, 150, 154), Bad = rgb(235, 90, 90)}, Classic = {Background = rgb(13, 14, 18), Border = rgb(7, 8, 10), Inline = rgb(18, 20, 25), Hover = rgb(40, 44, 54), Page = rgb(23, 25, 31), Outline = rgb(45, 49, 60), Element = rgb(29, 32, 39), Text = rgb(232, 234, 240), Dim = rgb(151, 153, 160), Bad = rgb(235, 90, 90)}, } UI.theme_names = {"Auto", "Midnight", "Slate", "Amoled", "Mocha", "Classic"} local T = table.clone(UI.themes[UI.theme_for(Settings.Theme)]) T.Accent = UI.accent_color() local hex = {Dim = "#" .. T.Dim.ToHex(T.Dim), Accent = "#" .. T.Accent.ToHex(T.Accent)} local methods = { FireServer = true, fireServer = true, InvokeServer = true, invokeServer = true, Fire = true, Invoke = true, GetLogHistory = true, Kick = true, kick = true, Shutdown = true, Activate = true, Deactivate = true, EquipTool = true, UnequipTools = true, SendMessage = true, SetCore = true, SetCoreGuiEnabled = true, Teleport = true, TeleportToPlaceInstance = true, TeleportToSpawnByName = true, } local teleport_methods = {Teleport = true, TeleportToPlaceInstance = true, TeleportToSpawnByName = true} UI.purchase_arg_names = { PromptProductPurchaseFinished = "userId, productId, isPurchased", PromptGamePassPurchaseFinished = "player, gamePassId, wasPurchased", PromptPurchaseFinished = "player, assetId, isPurchased", PromptBundlePurchaseFinished = "player, bundleId, wasPurchased", PromptPremiumPurchaseFinished = "player, wasPurchased", PromptProductPurchase = "player, productId, equipIfPurchased, currencyType", PromptGamePassPurchase = "player, gamePassId", PromptPurchase = "player, assetId, equipIfPurchased, currencyType", UserOwnsGamePassAsync = "userId, gamePassId", PlayerOwnsAsset = "player, assetId", } local purchase_methods = { UserOwnsGamePassAsync = true, PlayerOwnsAsset = true, PromptGamePassPurchase = true, PromptProductPurchase = true, PromptPurchase = true, PromptBundlePurchase = true, PromptPremiumPurchase = true, SignalPromptProductPurchaseFinished = true, SignalPromptGamePassPurchaseFinished = true, SignalPromptPurchaseFinished = true, } for Name in purchase_methods do methods[Name] = true end UI.crash_detect = function() return Settings.CrashFinder == true or Settings.BlockSpawnCrash == true end UI.crash_wants = function() return UI.crash_detect() or next(UI.crash.ArgBlocks) ~= nil end function __R.kind_of(class, Method, object) if Method == "FireServer" or Method == "fireServer" then if class == "RemoteEvent" then return (Settings.Events or Settings.BlockEvents or UI.crash_wants()) and "event" elseif class == "UnreliableRemoteEvent" then return (Settings.Unreliable or Settings.BlockUnreliable or UI.crash_wants()) and "unreliable" end elseif Method == "InvokeServer" or Method == "invokeServer" then return class == "RemoteFunction" and (Settings.Functions or Settings.BlockFunctions or UI.crash_wants()) and "function" elseif Method == "Fire" then return class == "BindableEvent" and (Settings.Bindables or Settings.BlockBindables) and "bindable" elseif Method == "Invoke" then return class == "BindableFunction" and (Settings.Bindables or Settings.BlockBindables) and "bindable" elseif Method == "SendMessage" then return class == "Actor" and (Settings.ActorMessages or Settings.BlockActorMessages) and "actormsg" elseif Method == "Activate" or Method == "Deactivate" then return class == "Tool" and (Settings.Tools or Settings.BlockTools) and "tool" elseif Method == "EquipTool" or Method == "UnequipTools" then return class == "Humanoid" and (Settings.Tools or Settings.BlockTools) and "tool" elseif Method == "GetAttribute" then return (Settings.GetAttributes or Settings.BlockGetAttributes) and "getattr" elseif Method == "SetAttribute" then return (Settings.SetAttributes or Settings.BlockSetAttributes) and "setattr" elseif Method == "Play" then return class == "Sound" and (Settings.Sounds or Settings.BlockSounds) and "sound" elseif Method == "Kick" or Method == "kick" then return class == "Player" and object == players.LocalPlayer and Settings.Kicks and "kick" elseif Method == "SetCore" or Method == "SetCoreGuiEnabled" then return class == "StarterGui" and Settings.CoreState and "corestate" elseif Method == "GetLogHistory" then return class == "LogService" and (Settings.LogHistory or Settings.BlockLogHistory) and "loghistory" elseif Method == "Shutdown" then return class == "DataModel" and Settings.Shutdowns and "shutdown" elseif purchase_methods[Method] then return class == "MarketplaceService" and (Settings.Purchases or Settings.BlockPurchases or Settings.OwnsSpoof ~= "off") and "purchase" elseif teleport_methods[Method] then return class == "TeleportService" and Settings.Teleports and "teleport" elseif Method == "require" then return class == "ModuleScript" and Settings.Require and "require" end return nil end local kinds = { event = {Tag = "fire", Color = nil}, unreliable = {Tag = "unrel", Color = rgb(120, 220, 200)}, ["function"] = {Tag = "invoke", Color = rgb(200, 140, 255)}, bindable = {Tag = "bind", Color = rgb(180, 180, 190)}, incoming = {Tag = "in", Color = rgb(130, 220, 120)}, require = {Tag = "req", Color = rgb(255, 190, 90)}, debuginfo = {Tag = "dbg", Color = rgb(255, 170, 120)}, kick = {Tag = "kick", Color = rgb(235, 90, 90)}, corestate = {Tag = "core", Color = rgb(255, 120, 170)}, shutdown = {Tag = "shutdown", Color = rgb(235, 90, 90)}, parentnil = {Tag = "parent", Color = rgb(235, 120, 90)}, teleport = {Tag = "tp", Color = rgb(240, 220, 100)}, purchase = {Tag = "buy", Color = rgb(120, 230, 150)}, create = {Tag = "create", Color = rgb(255, 140, 90)}, lib = {Tag = "lib", Color = rgb(255, 175, 110)}, logservice = {Tag = "log", Color = rgb(170, 215, 255)}, loghistory = {Tag = "hist", Color = rgb(255, 205, 120)}, firesignal = {Tag = "fsig", Color = rgb(255, 150, 220)}, replicatesignal = {Tag = "rsig", Color = rgb(150, 170, 255)}, prompt = {Tag = "prompt", Color = rgb(255, 215, 130)}, touch = {Tag = "touch", Color = rgb(150, 230, 255)}, click = {Tag = "click", Color = rgb(255, 200, 160)}, connection = {Tag = "conn", Color = rgb(160, 200, 140)}, guiclick = {Tag = "gui", Color = rgb(255, 160, 200)}, tool = {Tag = "tool", Color = rgb(190, 235, 120)}, anim = {Tag = "anim", Color = rgb(170, 255, 210)}, getattr = {Tag = "getattr", Color = rgb(150, 200, 255)}, setattr = {Tag = "setattr", Color = rgb(255, 180, 140)}, sound = {Tag = "sound", Color = rgb(255, 140, 200)}, wait = {Tag = "wait", Color = rgb(210, 210, 130)}, raknet = {Tag = "raknet", Color = rgb(255, 130, 130)}, actormsg = {Tag = "actor", Color = rgb(120, 190, 255)}, http = {Tag = "http", Color = rgb(110, 160, 255)}, } UI.tag_long = {unrel = "unreliable", bind = "bindable", ["in"] = "incoming", req = "require", dbg = "debug", fsig = "fire signal", rsig = "replicate", conn = "connection", gui = "gui click", tp = "teleport", parent = "parent nil", core = "core state", actor = "actor msg", lib = "table / buffer", log = "logservice", hist = "log history"} function UI.apply_tags() for _, kind in kinds do kind.short = kind.short or kind.Tag kind.Tag = UI.classic and kind.short or (UI.tag_long[kind.short] or kind.short) end end UI.apply_tags() local function kind_color(kind) return kinds[kind] and kinds[kind].Color or T.Accent end UI.http_methods = {HttpGet = "DataModel", HttpGetAsync = "DataModel", HttpPost = "DataModel", HttpPostAsync = "DataModel", RequestAsync = "HttpService", GetAsync = "HttpService", PostAsync = "HttpService"} for http_method in UI.http_methods do methods[http_method] = true end UI.kind_log_key = {event = "Events", unreliable = "Unreliable", ["function"] = "Functions", bindable = "Bindables", actormsg = "ActorMessages", tool = "Tools", anim = "Animations", loghistory = "LogHistory", getattr = "GetAttributes", setattr = "SetAttributes", sound = "Sounds", purchase = "Purchases"} UI.kind_block_key = {event = "BlockEvents", unreliable = "BlockUnreliable", ["function"] = "BlockFunctions", bindable = "BlockBindables", actormsg = "BlockActorMessages", tool = "BlockTools", loghistory = "BlockLogHistory", sound = "BlockSounds", getattr = "BlockGetAttributes", setattr = "BlockSetAttributes"} UI.crash = {Ready = false, Frame = 0, Counts = { }, Hot = { }, Recent = { }, Head = 0, Found = { }, Pending = { }, ArgBlocks = { }, FullIn = { }, Proxy = { }, Watched = { }, OwnFns = setmetatable({ }, {__mode = "k"})} local hook_status = "hooked" function UI.core_state_info(Method, a1, a2) if Method == "SetCore" then if a1 ~= "ResetButtonCallback" then return false, false end return true, a2 ~= true end local Name = tostring(a1) for _, wanted in UI.core_gui_names do if string.find(Name, wanted, 1, true) then return true, a2 ~= true end end return false, false end function __R.allow(check, Self) if not check then return true end local ok, pass = pcall(check, Self) return ok and pass == true end UI.filter = function(build) if not env.__LarpUseOth then return nil end local ok, result = pcall(build) return ok and result or nil end UI.namecall_filter = function() return UI.filter(function() local names, classes = { }, { } for Method in methods do table.insert(names, NamecallFilter.new(Method)) end for _, spec in {{"GetAttribute", Settings.GetAttributes or Settings.BlockGetAttributes}, {"SetAttribute", Settings.SetAttributes or Settings.BlockSetAttributes}, {"Play", Settings.Sounds or Settings.BlockSounds}} do if spec[2] then table.insert(names, NamecallFilter.new(spec[1])) end end for _, class in {"RemoteEvent", "UnreliableRemoteEvent", "RemoteFunction", "BindableEvent", "BindableFunction", "Player", "DataModel", "LogService", "StarterGui", "TeleportService", "MarketplaceService", "HttpService", "Actor", "Tool"} do table.insert(classes, InstanceTypeFilter.new(1, class)) end return AllFilter.new({AnyFilter.new(classes), AnyFilter.new(names)}) end) end UI.direct_filter = function(Method) local classes = UI.direct_classes[Method] if not classes then return nil end return UI.filter(function() local types = { } for _, class in classes do table.insert(types, InstanceTypeFilter.new(1, class)) end return AllFilter.new({AnyFilter.new(types)}) end) end local function probe(class, Method) return function() local object = Instance.new(class) local Function = object[Method] object.Destroy(object) return Function end end local shared = env.__LarpSpyShared if not shared then shared = {Capture = function() return false end, Installed = { }} env.__LarpSpyShared = shared elseif not shared.Installed then shared.Installed = {Namecall = true, Legacy = true, FireServer = true, UnreliableFireServer = true, InvokeServer = true, Fire = true, Invoke = true} end shared.Methods = methods UI.core_gui_names = {"Backpack", "Health", "All", "PlayerList", "EmotesMenu"} UI.capture_busy = setmetatable({ }, {__mode = "k"}) function __R.capture(...) local thread = coroutine.running() if UI.capture_busy[thread] then return false end UI.capture_busy[thread] = true local ok, block, replace, fake = pcall(shared.Capture, ...) UI.capture_busy[thread] = nil return ok and block == true, ok and replace or nil, ok and fake end UI.strict = { } do local function class(Self) if typeof(Self) ~= "Instance" then return false end local ok, Name = pcall(function() return Self.ClassName end) return ok and Name or false end local function is(Name) return function(Self) return class(Self) == Name end end local function local_player(Self) local me = players.LocalPlayer if me == nil or class(Self) ~= "Player" then return false end if Self == me then return true end local ok, same = pcall(function() return Self.UserId == me.UserId end) return ok and same == true end local function remote(Self) local Name = class(Self) return Name == "RemoteEvent" or Name == "UnreliableRemoteEvent" end UI.strict.Kick = local_player UI.strict.kick = local_player UI.strict.Shutdown = is("DataModel") UI.strict.GetLogHistory = is("LogService") UI.strict.SetCore = is("StarterGui") UI.strict.SetCoreGuiEnabled = is("StarterGui") UI.strict.FireServer = remote UI.strict.fireServer = remote UI.strict.InvokeServer = is("RemoteFunction") UI.strict.invokeServer = is("RemoteFunction") UI.strict.Fire = is("BindableEvent") UI.strict.Invoke = is("BindableFunction") UI.strict.SendMessage = is("Actor") UI.strict.Activate = is("Tool") UI.strict.Deactivate = is("Tool") UI.strict.EquipTool = is("Humanoid") UI.strict.UnequipTools = is("Humanoid") UI.strict.Play = is("Sound") UI.strict.GetAttribute = function(Self) return typeof(Self) == "Instance" end UI.strict.SetAttribute = UI.strict.GetAttribute for http_method, http_class in UI.http_methods do UI.strict[http_method] = is(http_class) end for Name in teleport_methods do UI.strict[Name] = is("TeleportService") end for Name in purchase_methods do UI.strict[Name] = is("MarketplaceService") end end UI.direct_classes = { FireServer = {"RemoteEvent", "UnreliableRemoteEvent"}, fireServer = {"RemoteEvent", "UnreliableRemoteEvent"}, InvokeServer = {"RemoteFunction"}, invokeServer = {"RemoteFunction"}, Fire = {"BindableEvent"}, Invoke = {"BindableFunction"}, Kick = {"Player"}, kick = {"Player"}, Shutdown = {"DataModel"}, GetLogHistory = {"LogService"}, SetCore = {"StarterGui"}, SetCoreGuiEnabled = {"StarterGui"}, Teleport = {"TeleportService"}, TeleportToPlaceInstance = {"TeleportService"}, TeleportToSpawnByName = {"TeleportService"}, HttpGet = {"DataModel"}, HttpGetAsync = {"DataModel"}, HttpPost = {"DataModel"}, HttpPostAsync = {"DataModel"}, RequestAsync = {"HttpService"}, } for Name in purchase_methods do UI.direct_classes[Name] = {"MarketplaceService"} end if not shared.Installed.Namecall then if X.get_namecall_method and (X.hook_metamethod or getrawmetatable) then local old_namecall local Hook = X.new_c_closure(function(...) local self = ... local Method = X.get_namecall_method() if UI.capture_busy[coroutine.running()] then return old_namecall(...) end if shared.Methods[Method] and typeof(self) == "Instance" then local check = UI.strict[Method] if not check or check(self) then local block, replace, fake = __R.capture(self, Method, false, select(2, ...)) if setnamecallmethod and not env.__LarpUseOth then setnamecallmethod(Method) end if block then return fake end if replace then return old_namecall(self, table.unpack(replace, 1, replace.n)) end end end return old_namecall(...) end) local ok_raw, raw_namecall = pcall(function() return X.hook_function and getrawmetatable and rawget(getrawmetatable(game), "__namecall") end) if ok_raw and type(raw_namecall) == "function" then old_namecall = X.hook_function(raw_namecall, Hook, UI.namecall_filter()) elseif X.hook_metamethod then old_namecall = X.hook_metamethod(game, "__namecall", Hook) else local meta = getrawmetatable(game) old_namecall = meta.__namecall if setreadonly then setreadonly(meta, false) end table.insert(env.__LarpSpyHooks, {Raw = meta, Name = "__namecall", Old = old_namecall}) meta.__namecall = Hook if setreadonly then setreadonly(meta, true) end end shared.Installed.Namecall = true shared.Rev = 3 else hook_status = "no hookmetamethod" end end if shared.Installed.Namecall and shared.Rev ~= 3 then hook_status = "old hook installed: rejoin (blocked GetAttribute can't return false until then)" end local function hook_direct(key, getter, Method) if not X.hook_function or shared.Installed[key] then return end pcall(function() local original = getter() local check = UI.strict[Method] local old old = X.hook_function(original, X.new_c_closure(function(self, ...) if not __R.allow(check, self) then return old(self, ...) end local block, replace, fake = __R.capture(self, Method, true, ...) if block then return fake end if replace then return old(self, table.unpack(replace, 1, replace.n)) end return old(self, ...) end), UI.direct_filter(Method)) shared.Installed[key] = true end) end hook_direct("FireServer", probe("RemoteEvent", "FireServer"), "FireServer") hook_direct("UnreliableFireServer", probe("UnreliableRemoteEvent", "FireServer"), "FireServer") hook_direct("InvokeServer", probe("RemoteFunction", "InvokeServer"), "InvokeServer") if Settings.Bindables or Settings.BlockBindables then hook_direct("Fire", probe("BindableEvent", "Fire"), "Fire") hook_direct("Invoke", probe("BindableFunction", "Invoke"), "Invoke") end if Settings.Kicks or Settings.BlockKicks then hook_direct("Kick", function() return players.LocalPlayer.Kick end, "Kick") end if Settings.Shutdowns or Settings.BlockShutdowns then hook_direct("Shutdown", function() return game.Shutdown end, "Shutdown") end if Settings.LogHistory or Settings.BlockLogHistory then hook_direct("GetLogHistory", function() return game.GetService(game, "LogService").GetLogHistory end, "GetLogHistory") end if Settings.CoreState or Settings.BlockCoreState then hook_direct("SetCore", function() return game.GetService(game, "StarterGui").SetCore end, "SetCore") hook_direct("SetCoreGuiEnabled", function() return game.GetService(game, "StarterGui").SetCoreGuiEnabled end, "SetCoreGuiEnabled") end local create_busy = false __R.connect_methods = {Connect = true, connect = true, Once = true, once = true, ConnectParallel = true, connectParallel = true} UI.install_create = function() for _, pair in {{buffer, "buffer"}, {table, "table"}} do local Lib, lib_name = pair[1], pair[2] local create_needed = Settings.Creates or Settings.Tables or Settings.Buffers or Settings.BlockCreates or Settings.BlockTables or Settings.BlockBuffers or UI.crash_detect() if create_needed and X.hook_function and not shared.Installed["Create" .. lib_name] and Lib and Lib.create then pcall(function() local old local fresh = lib_name == "buffer" and function() return old(0) end or function() return {} end old = X.hook_function(Lib.create, X.new_c_closure(function(...) if create_busy or not shared.capture_create then return old(...) end create_busy = true local ok, block = pcall(shared.capture_create, lib_name .. ".create", ...) create_busy = false if ok and block == true then return fresh() end return old(...) end)) if lib_name == "buffer" then shared.BufferCreate = old end shared.Installed["Create" .. lib_name] = true end) end end end UI.lib_fake = function(label, ...) if label == "table.concat" or label == "buffer.tostring" then return "" elseif label == "table.freeze" then return (...) elseif label == "table.clone" or label == "table.pack" or label == "table.move" then return { } elseif label == "table.isfrozen" then return false elseif label == "buffer.fromstring" and shared.BufferCreate then return shared.BufferCreate(0) elseif label == "buffer.len" or label == "table.maxn" or label == "table.getn" or string.sub(label, 1, 11) == "buffer.read" then return 0 end return nil end UI.install_lib = function(lib_name) local Lib = lib_name == "buffer" and buffer or (lib_name == "table" and table or nil) if shared.Installed["Lib" .. lib_name] then return true end if not X.hook_function or type(Lib) ~= "table" then return false end local names = { } for Name, member in next, Lib do if type(Name) == "string" and type(member) == "function" and Name ~= "create" and not (env.__LarpUseOth and UI.lib_spy_uses[Name] and lib_name == "table") then names[#names + 1] = Name end end local hooked = 0 for _, Name in names do local label = lib_name .. "." .. Name local ok = pcall(function() local old old = X.hook_function(Lib[Name], X.new_c_closure(function(...) if shared.LibBusy or not shared.LibOn then return old(...) end if (shared.LibBudget or 1) > 0 then pcall(shared.capture_lib, label, ...) end if shared.LibBlockOn and ((shared.LibBlockAll[lib_name] and not (env.__LarpUseOth and UI.lib_spy_uses[Name])) or shared.LibBlocked[label]) and not X.check_caller() then return UI.lib_fake(label, ...) end return old(...) end)) end) if ok then hooked += 1 end end shared.Installed["Lib" .. lib_name] = hooked > 0 return hooked > 0 end local function install_require() if shared.Installed.Require or not X.hook_function or not getrenv then return shared.Installed.Require == true end local ok = pcall(function() local real = getrenv().require local old old = X.hook_function(real, X.new_c_closure(function(module, ...) local results = table.pack(old(module, ...)) pcall(shared.capture_require, module, results) return table.unpack(results, 1, results.n) end)) end) shared.Installed.Require = ok return ok end function __R.hook_signal_function(Name, Function) if not X.hook_function or type(Function) ~= "function" or shared.Installed[Name] then return end pcall(function() local old old = X.hook_function(Function, X.new_c_closure(function(signal, ...) local ok, block = pcall(shared.capture_signal, Name, signal, ...) if ok and block then return nil end return old(signal, ...) end)) shared.Installed[Name] = true end) end function __R.install_connections() local errors = { } local probe = Instance.new("BindableEvent") local signal = probe.Event if not shared.Installed.ConnectionsNC and X.get_namecall_method then local old local ok_meta, meta = pcall(function() return getrawmetatable(signal) end) local raw = ok_meta and meta and (rawget(meta, "__namecall") or meta.__namecall) or nil if type(raw) ~= "function" then raw = nil end local Hook = X.new_c_closure(function(Self, ...) local Method = X.get_namecall_method() if shared.ConnectionsOn and __R.connect_methods[Method] then local captured, block = pcall(shared.capture_connect, Method, Self, ...) if setnamecallmethod then setnamecallmethod(Method) end if captured and block == true then Self = UI.dummy_event() end end local forward = old if forward then return forward(Self, ...) end return Self[Method](Self, ...) end) local tries = { function() return X.hook_function(assert(raw, "no signal __namecall"), Hook) end, function() return X.with_identity(hookmetamethod)(signal, "__namecall", Hook) end, function() local meta = getrawmetatable(signal) if setreadonly then setreadonly(meta, false) end local original = meta.__namecall meta.__namecall = Hook return original end, } for index, try in tries do local ok, result = pcall(try) if ok then old = type(result) == "function" and result or nil shared.Installed.ConnectionsNC = true if not old then table.insert(errors, "nc" .. index .. ": no original returned (using __index fallback)") end break end table.insert(errors, "nc" .. index .. ": " .. tostring(result)) end end if not shared.Installed.Connections and X.hook_function then for _, Name in {"Connect", "Once", "ConnectParallel"} do local ok, Error = pcall(function() local old old = X.hook_function(signal[Name], X.new_c_closure(function(Self, ...) if shared.ConnectionsOn then local captured, block = pcall(shared.capture_connect, Name, Self, ...) if captured and block == true then Self = UI.dummy_event() end end return old(Self, ...) end)) end) if ok then shared.Installed.Connections = true else table.insert(errors, Name .. ": " .. tostring(Error)) end end end probe.Destroy(probe) local worked = shared.Installed.ConnectionsNC == true or shared.Installed.Connections == true if not worked or not shared.Installed.ConnectionsNC then shared.ConnectError = table.concat(errors, " | ") end return worked end UI.install_create() UI.lib_spy_uses = {insert = true, remove = true, concat = true, unpack = true, sort = true, find = true, clear = true, clone = true, pack = true, move = true, freeze = true, isfrozen = true, getn = true, maxn = true} if Settings.Http or Settings.BlockHttp then for http_method, http_class in {HttpGet = "DataModel", HttpGetAsync = "DataModel", HttpPost = "DataModel", HttpPostAsync = "DataModel", RequestAsync = "HttpService"} do hook_direct("Http" .. http_method, function() return (http_class == "DataModel" and game or http_service)[http_method] end, http_method) end end if not shared.Installed.NewIndex and X.hook_metamethod then pcall(function() local old_new_index local new_index_hook = X.new_c_closure(function(...) local self, key, Value = ... if key == "Parent" and Value == nil and shared.capture_parent and typeof(self) == "Instance" then local thread = coroutine.running() if not UI.capture_busy[thread] then UI.capture_busy[thread] = true local ok, block = pcall(shared.capture_parent, self) UI.capture_busy[thread] = nil if ok and block == true then return end end end return old_new_index(...) end) local raw_new_index = getrawmetatable and X.hook_function and rawget(getrawmetatable(game), "__newindex") if type(raw_new_index) == "function" then old_new_index = X.hook_function(raw_new_index, new_index_hook, UI.filter(function() return AllFilter.new({ArgumentFilter.new(2, "Parent"), InstanceTypeFilter.new(1, "Player")}) end)) else old_new_index = X.hook_metamethod(game, "__newindex", new_index_hook) end shared.Installed.NewIndex = true end) end if Settings.Teleports or Settings.BlockTeleports then for Method in teleport_methods do hook_direct(Method, function() return game.GetService(game, "TeleportService")[Method] end, Method) end end if Settings.Purchases or Settings.BlockPurchases or Settings.OwnsSpoof ~= "off" then for Method in purchase_methods do hook_direct(Method, function() return game.GetService(game, "MarketplaceService")[Method] end, Method) end end if Settings.Require or Settings.NetFinder then install_require() end local raw_debug_info = shared.RawDebugInfo local function install_debug_info() if shared.Installed.DebugInfo or not X.hook_function then return shared.Installed.DebugInfo == true end local ok = pcall(function() local game_debug = getrenv and getrenv().debug local real = (game_debug and game_debug.info) or debug.info local old shared.DebugOffset = 0 shared.DebugInside = true old = X.hook_function(real, X.new_c_closure(function(...) local first = ... local Offset = shared.DebugOffset local results if type(first) == "number" and Offset > 0 then results = table.pack(old(first + Offset, select(2, ...))) else results = table.pack(old(...)) end if not shared.DebugInside then local captured, spoof = pcall(shared.capture_debug_info, results, ...) if captured and spoof then return table.unpack(spoof, 1, spoof.n) end end return table.unpack(results, 1, results.n) end)) shared.RawDebugInfo = old raw_debug_info = old pcall(function() if getrenv then local gd = getrenv().debug if type(gd) == "table" then gd.info = old end end end) local function probe() return ((game_debug and game_debug.info or debug.info)(1, "f")) end for try = 0, 3 do shared.DebugOffset = try local worked, got = pcall(probe) if worked and got == probe then break end shared.DebugOffset = 0 end shared.DebugInside = false end) shared.DebugInside = false shared.Installed.DebugInfo = ok return ok end if Settings.DebugCalls then install_debug_info() end __R.hook_signal_function("firesignal", X.FireSignal) __R.hook_signal_function("replicatesignal", X.ReplicateSignal) if X.fire_proximity and X.hook_function and not shared.Installed.FireProximity then pcall(function() local old old = X.hook_function(X.fire_proximity, X.new_c_closure(function(Prompt, ...) local ok, block = pcall(shared.capture_proximity, Prompt, ...) if ok and block then return nil end return old(Prompt, ...) end)) shared.Installed.FireProximity = true end) end for _, spec in {{"FireTouch", X.fire_touch, "touch", "firetouchinterest"}, {"FireClick", X.fire_click, "click", "fireclickdetector"}} do local key, Function, kind, Name = spec[1], spec[2], spec[3], spec[4] if Function and X.hook_function and not shared.Installed[key] then pcall(function() local old old = X.hook_function(Function, X.new_c_closure(function(target, ...) local ok, block = pcall(shared.capture_exec, kind, Name, target, ...) if ok and block then return nil end return old(target, ...) end)) shared.Installed[key] = true end) end end local active = true local paused = false local logs = { } local details_dirty = false local stacks = { } local queue = { } local blocked = { } local ignored_args = { } local blocked_names = { } local ignored = { } local overrides = { } local self_ignore = { } local ignore_patterns = { } local channel = nil local only_patterns = { } local ignored_names = { } __R.dyn_code = { server = "workspace.GetServerTimeNow(workspace)", tick = "tick()", time = "os.time()", ms = "DateTime.now().UnixTimestampMillis", } function __R.parse_ignore() ignore_patterns = { } for piece in string.gmatch(Settings.IgnoreNames, "[^,]+") do piece = string.match(piece, "^%s*(.-)%s*$") if piece ~= "" then table.insert(ignore_patterns, piece) end end end function __R.parse_only() only_patterns = { } for piece in string.gmatch(Settings.OnlyNames, "[^,]+") do piece = string.match(piece, "^%s*(.-)%s*$") if piece ~= "" then table.insert(only_patterns, piece) end end end local function name_ignored(Name) if ignored_names[Name] then return true end if #only_patterns > 0 then local allowed = false for _, pattern in only_patterns do local ok, found = pcall(string.find, Name, pattern) if ok and found then allowed = true break end end if not allowed then return true end end for _, pattern in ignore_patterns do local ok, found = pcall(string.find, Name, pattern) if ok and found then return true end end return false end local function deep_copy(Value, seen) if type(Value) ~= "table" then return Value end seen = seen or { } if seen[Value] then return seen[Value] end local copy = { } seen[Value] = copy for key, inner in next, Value do copy[deep_copy(key, seen)] = deep_copy(inner, seen) end return copy end UI.stack_raw = function(raw) if not (env.__LarpUseOth and oth and oth.is_hook_thread and oth.get_original_thread) then return raw end local ok_hook, hooked = pcall(oth.is_hook_thread) if not (ok_hook and hooked) then return raw end local ok_thread, origin = pcall(oth.get_original_thread) if not ok_thread or typeof(origin) ~= "thread" then return raw end return function(first, ...) if type(first) == "number" then if first <= 1 then return nil end return raw(origin, first - 1, ...) end return raw(first, ...) end end function __R.caller_info() local raw = UI.stack_raw(raw_debug_info or debug.info) local ok_own, own = true, __R.own_source() local first for level = 2, 14 do local ok, source, line, Name, params, vararg = pcall(raw, level, "slna") if not ok or source == nil then break end if source ~= "[C]" and (not ok_own or source ~= own) then local frame = {Source = source, Line = line, Name = (Name and Name ~= "") and Name or nil, Params = params, Vararg = vararg} if not first then first = frame elseif source ~= first.Source then first.Outer = frame break end end end return first end -- source name of the spy's own chunk (read straight from debug.info so the oth wrapper can't blank it) __R.own_source = function() local raw = raw_debug_info or debug.info return raw(1, "s") end -- every game frame between debug.info and the bottom of the stack (spy, executor and C frames skipped), innermost first function __R.full_stack(limit) local raw = UI.stack_raw(raw_debug_info or debug.info) local own = __R.own_source() local is_executor = isexecutorclosure or is_executor_closure or checkclosure or is_synapse_function local frames = { } for level = 2, limit or 40 do local ok, source, line, Name, params, vararg, Function = pcall(raw, level, "slnaf") if not ok or source == nil then break end local mine = source == "[C]" or source == own if not mine and is_executor and type(Function) == "function" then local ok_exec, executor = pcall(is_executor, Function) mine = ok_exec and executor == true end if not mine then table.insert(frames, { Source = source, Line = line, Name = (Name and Name ~= "") and Name or nil, Params = params, Vararg = vararg, }) end end return frames end UI.find_upvalues = function(args, count) local raw = UI.stack_raw(raw_debug_info or debug.info) local get_upvalues = getupvalues or (debug and debug.getupvalues) if not raw or not get_upvalues then return nil end local leaves = { } local wanted = nil local spec = string.lower(tostring(Settings.UpvalueArgs or "all")) if string.match(spec, "%d") then wanted = { } for piece in string.gmatch(spec, "%d+") do wanted[tonumber(piece)] = true end end for index = 1, count do local Value = args[index] if wanted and not wanted[index] then elseif type(Value) == "table" then local seen = 0 for key, inner in next, Value do seen += 1 if seen > 30 then break end if (type(inner) == "number" or type(inner) == "string") and (type(key) == "string" or type(key) == "number") then table.insert(leaves, {Index = index, Key = key, Value = inner, Found = { }}) end if type(key) == "string" and #key >= 12 and string.match(key, "%d") and not string.match(key, "^[%a_]+$") and string.match(key, "^[%w%-_{}]+$") then table.insert(leaves, {Index = index, Key = key, KeyLeaf = true, Value = key, Found = { }}) end end elseif type(Value) == "number" or type(Value) == "string" then table.insert(leaves, {Index = index, Value = Value, Found = { }}) end end if #leaves == 0 then return nil end local own = raw(1, "s") local function name_matches(inst, leaf) local ok, Name = pcall(function() return inst.Name end) if not ok or type(Name) ~= "string" then return false end if type(leaf.Value) == "number" then return tonumber(Name) == leaf.Value end return Name == leaf.Value end local function check(func) local ok_up, ups = pcall(get_upvalues, func) if not ok_up or type(ups) ~= "table" then return end local ok_info, f_source, f_line, f_name = pcall(raw, func, "sln") if not ok_info then return end for up_index, up_value in next, ups do if type(up_value) == "number" or type(up_value) == "string" then for _, leaf in leaves do if leaf.Value == up_value and #leaf.Found < 6 then table.insert(leaf.Found, {Source = f_source, Line = f_line, Name = f_name or "", Up = up_index}) end end elseif typeof(up_value) == "Instance" then for _, leaf in leaves do if #leaf.Found < 6 and name_matches(up_value, leaf) then table.insert(leaf.Found, {Source = f_source, Line = f_line, Name = f_name or "", Up = up_index, Field = ".Name", ToNumber = type(leaf.Value) == "number"}) end end elseif type(up_value) == "table" then local budget = 400 local visited = { } local function scan(tbl, access, depth) if visited[tbl] or budget <= 0 then return end visited[tbl] = true for field, inner in next, tbl do budget -= 1 if budget <= 0 then return end if type(field) == "string" then for _, leaf in leaves do if leaf.KeyLeaf and leaf.Value == field and #leaf.Found < 6 then table.insert(leaf.Found, {Source = f_source, Line = f_line, Name = f_name or "", Up = up_index, Field = access, KeyOf = true}) end end end if type(field) == "string" or type(field) == "number" then local path = access .. ((type(field) == "string" and string.match(field, "^[%a_][%w_]*$")) and ("." .. field) or ("[" .. (type(field) == "string" and string.format("%q", field) or tostring(field)) .. "]")) if type(inner) == "number" or type(inner) == "string" then for _, leaf in leaves do if leaf.Value == inner and #leaf.Found < 6 then table.insert(leaf.Found, {Source = f_source, Line = f_line, Name = f_name or "", Up = up_index, Field = path}) end end elseif typeof(inner) == "Instance" then for _, leaf in leaves do if #leaf.Found < 6 and name_matches(inner, leaf) then table.insert(leaf.Found, {Source = f_source, Line = f_line, Name = f_name or "", Up = up_index, Field = path .. ".Name", ToNumber = type(leaf.Value) == "number"}) end end elseif type(inner) == "table" and depth < 3 then scan(inner, path, depth + 1) end end end end pcall(scan, up_value, "", 1) end end end local sources = { } for level = 2, 14 do local ok, source, func = pcall(raw, level, "sf") if not ok or source == nil then break end if source ~= "[C]" and source ~= own and type(func) == "function" then sources[source] = true check(func) end end local missing = false for _, leaf in leaves do if #leaf.Found == 0 then missing = true end end if missing and Settings.UpvalueDeep then UI.deep_funcs = UI.deep_funcs or { } if os.clock() - (UI.deep_scan_at or 0) > 3 then UI.deep_scan_at = os.clock() UI.deep_funcs = { } local list = nil if filtergc then local ok_list, result = pcall(filtergc, "function", {IgnoreExecutor = true}) list = ok_list and type(result) == "table" and result or nil end local kept = 0 for _, func in list or getgc() do if type(func) == "function" and kept < 40 then local ok_source, source = pcall(raw, func, "s") if ok_source and sources[source] then local before = 0 for _, leaf in leaves do before += #leaf.Found end check(func) local after = 0 for _, leaf in leaves do after += #leaf.Found end if after > before then kept += 1 UI.deep_funcs[func] = true end end end end else for func in UI.deep_funcs do check(func) end end end for index = #leaves, 1, -1 do if #leaves[index].Found == 0 then table.remove(leaves, index) end end return #leaves > 0 and leaves or nil end UI.actor_label_of = function(Actor, index) local ok_name, Name = pcall(function() return Actor.Name end) if ok_name and type(Name) == "string" and string.match(Name, "%S") then return Name end local ok_id, Id = pcall(function() return Actor.GetDebugId(Actor) end) if ok_id and type(Id) == "string" and Id ~= "" then return "actor id " .. Id end return "actor " .. tostring(index or "?") end UI.actor_of_call = function(script) local function of(candidate) if typeof(candidate) ~= "Instance" then return nil end local cached = UI.actor_by_script[candidate] if cached ~= nil then return cached or nil end local ok, owner = pcall(function() return candidate.GetActor(candidate) end) local label = ok and typeof(owner) == "Instance" and UI.actor_label_of(owner) or false UI.actor_by_script[candidate] = label return label or nil end local found = of(script) if found then return found end if debug and debug.info and getfenv then for level = 2, 24 do local ok, fn = pcall(UI.stack_raw(debug.info), level, "f") if not ok or fn == nil then break end local ok_env, env = pcall(getfenv, fn) if ok_env and type(env) == "table" then local ok_script, owner = pcall(rawget, env, "script") found = ok_script and of(owner) or nil if found then return found end end end end return nil end shared.LibBlocked = blocked shared.LibBlockAll = { } __R.parse_ignore() __R.parse_only() __R.dyn_kinds = { {"server", function() return workspace.GetServerTimeNow(workspace) end, 2}, {"tick", function() return tick() end, 2}, {"time", function() return os.time() end, 2}, {"ms", function() return DateTime.now().UnixTimestampMillis end, 2000}, } function __R.detect_dynamic(args, count) if not Settings.AutoFill then return nil end local dyn = nil for index = 1, count do local Value = args[index] if type(Value) == "number" and Value == Value and Value > 1e9 then local best, best_diff = nil, nil for _, kind in __R.dyn_kinds do local ok, Now = pcall(kind[2]) if ok and type(Now) == "number" then local diff = math.abs(Now - Value) if diff <= kind[3] and (not best_diff or diff < best_diff) then best, best_diff = kind[1], diff end end end if best then dyn = dyn or { } dyn[index] = best end end end return dyn end UI.up_seen = setmetatable({ }, {__mode = "k"}) UI.actor_by_script = setmetatable({ }, {__mode = "k"}) local replaying = false local click_fired = setmetatable({ }, {__mode = "k"}) __R.prompt_fired = setmetatable({ }, {__mode = "k"}) UI.frozen = UI.frozen or setmetatable({ }, {__mode = "k"}) local function push(remote, Method, kind, script, Actor, count, ...) if UI.frozen[remote] then return end if Actor == nil and kind ~= "incoming" then Actor = UI.actor_of_call(script) end local rules = ignored_args[remote] if rules and UI.rule_matches then for _, rule in rules do local ok, hit = pcall(UI.rule_matches, rule, count, ...) if ok and hit then return end end end if Settings.AntiSpam or (Settings.AttrAntiSpam and (kind == "getattr" or kind == "setattr")) then local ok, spam = pcall(UI.is_spam, remote, Method, kind, count, ...) if ok and spam then return end end local args = {...} for index = 1, count do args[index] = deep_copy(args[index]) end args.Dyn = __R.detect_dynamic(args, count) if Settings.UpvalueSearch and kind ~= "http" and kind ~= "lib" and kind ~= "wait" and kind ~= "raknet" and kind ~= "logservice" then local ok_up, up = pcall(UI.find_upvalues, args, count) args.Up = ok_up and up or nil if not args.Up then task.defer(function() shared.notify("upvalue search is ON but found nothing for this call (the value is not held as an upvalue / field / instance name)") end) end if args.Up and typeof(remote) == "Instance" then local seen = UI.up_seen[remote] or { } UI.up_seen[remote] = seen for _, leaf in args.Up do local leaf_key = leaf.Index .. "|" .. tostring(leaf.Key) .. (leaf.KeyLeaf and "|key" or "") local previous = seen[leaf_key] local set = { } if previous then local kept = { } for _, found in leaf.Found do if previous[found.Source .. "|" .. found.Name .. "|" .. tostring(found.Line) .. "|" .. found.Up .. "|" .. tostring(found.Field)] then table.insert(kept, found) end end if #kept > 0 then leaf.Found = kept end end for _, found in leaf.Found do set[found.Source .. "|" .. found.Name .. "|" .. tostring(found.Line) .. "|" .. found.Up .. "|" .. tostring(found.Field)] = true end seen[leaf_key] = set end end end local CallerInfo = kind ~= "raknet" and (Settings.DebugInfo or Settings.RemoteStack) and __R.caller_info() or nil if Settings.RemoteStack and kind ~= "debuginfo" and kind ~= "raknet" and not shared.StackBusy then local now = os.clock() UI.stack_last = UI.stack_last or setmetatable({ }, {__mode = "k"}) local key = typeof(remote) == "Instance" and remote or kind UI.stack_cache = UI.stack_cache or setmetatable({ }, {__mode = "k"}) local stack = nil if now - (UI.stack_last[key] or 0) >= 0.05 then UI.stack_last[key] = now shared.StackBusy = true local ok_stack, got = pcall(__R.full_stack, 12) shared.StackBusy = false if ok_stack and type(got) == "table" and #got > 0 then stack = got UI.stack_cache[key] = got end else stack = UI.stack_cache[key] end if stack then local top = stack[1] CallerInfo = CallerInfo or {Source = top.Source, Line = top.Line, Name = top.Name, Params = top.Params, Vararg = top.Vararg} CallerInfo.Stack = stack end end table.insert(queue, { Remote = remote, Method = Method, Kind = kind, Script = script, Info = CallerInfo, Actor = Actor, Args = args, Count = count, Calls = 1, Time = os.date("%H:%M:%S"), }) end UI.attr_read = function(inst, Name) return inst.GetAttribute(inst, Name) end UI.attr_fake = function(inst, Name) UI.attr_busy = true local ok, real = pcall(UI.attr_read, inst, Name) UI.attr_busy = false if not ok then return nil end local Type = typeof(real) if Type == "boolean" then if Settings.GetAttrBool == "true" then return true elseif Settings.GetAttrBool == "false" then return false end return not real elseif Type == "number" then return tonumber(Settings.GetAttrNumber) or 100 elseif Type == "string" then return tostring(Settings.GetAttrString or "") end return real end UI.attr_allowed = function(inst) local spec = Settings.AttrTargets or "" if spec == "" then return true end if UI.attr_cache.Spec ~= spec then local want = { } for piece in string.gmatch(spec, "[^,]+") do want[string.match(piece, "^%s*(.-)%s*$")] = true end UI.attr_cache = {Spec = spec, Want = want} UI.attr_hits = setmetatable({ }, {__mode = "k"}) end local Now = os.clock() local cached = UI.attr_hits[inst] if cached and Now - cached[2] < 1.5 then return cached[1] end local result = UI.attr_allowed_slow(inst, UI.attr_cache.Want) UI.attr_hits[inst] = {result, Now} return result end UI.block_applies = function(from_executor) local source = Settings.BlockSource if source == "both" then return true elseif source == "executor" then return from_executor == true end return not from_executor end UI.capture_create_body = function(Name, ...) local Lib = string.match(Name, "^(%a+)%.") if active and UI.crash_detect() and UI.crash.Ready and (Name == "Instance.new" or Name == "buffer.create") then local verdict = UI.crash.Note(Name, ...) if verdict then UI.crash.Kill = verdict == "kill" return true end end local wanted = (Lib == "Instance" and Settings.InstanceNew) or (Lib ~= "Instance" and (Settings.Creates or (Lib == "table" and Settings.Tables) or (Lib == "buffer" and Settings.Buffers))) local lib_block = (Lib == "table" and Settings.BlockTables) or (Lib == "buffer" and Settings.BlockBuffers) or (Lib == "Instance" and Settings.BlockInstanceNew) or blocked[Name] == true if not active or not (wanted or Settings.BlockCreates or lib_block) then return false end local from_executor = X.check_caller() if from_executor and not Settings.Executor and not (Settings.BlockCreates and Settings.BlockSource ~= "game") then return false end if wanted and not paused and not ignored[Name] and not name_ignored(Name) and (not from_executor or Settings.Executor) then push(Name, Name, "create", X.get_calling_script(), nil, select("#", ...), ...) end local block = (Settings.BlockCreates and Lib ~= "Instance" and UI.block_applies(from_executor)) or (lib_block and not from_executor) if block then task.defer(function() shared.notify("blocked " .. Name) end) end return block end UI.lib_copy = function(Value, budget, seen) local Type = typeof(Value) if Type == "buffer" then local ok, copy = pcall(function() if buffer.len(Value) <= 256 then return buffer.fromstring(buffer.tostring(Value)) end end) return ok and copy or Value end if Type ~= "table" then return Value end seen = seen or { } if seen[Value] then return seen[Value] end local copy = { } seen[Value] = copy for key, inner in next, Value do if budget.Left <= 0 then copy[""] = true break end budget.Left -= 1 copy[UI.lib_copy(key, budget, seen)] = UI.lib_copy(inner, budget, seen) end return copy end UI.capture_lib_body = function(Name, ...) if not active or paused then return end local is_table = string.sub(Name, 1, 6) == "table." if not ((is_table and Settings.Tables) or (not is_table and Settings.Buffers)) then return end if X.check_caller() and not Settings.Executor then return end if ignored[Name] or name_ignored(Name) then return end local script = X.get_calling_script() if typeof(script) == "Instance" and script.IsDescendantOf(script, core_gui) then return end shared.LibBudget = (shared.LibBudget or 0) - 1 local count = select("#", ...) local args = table.pack(...) local budget = {Left = (Settings.LibBigTables or 0) > 0 and Settings.LibBigTables or math.huge} for index = 1, count do args[index] = UI.lib_copy(args[index], budget) end push(Name, Name, "lib", script, nil, count, table.unpack(args, 1, count)) end do local function debug_spoof(Mode) if Mode == "true" then return table.pack(true) elseif Mode == "false" then return table.pack(false) elseif Mode == "nil" then return table.pack(nil) elseif Mode == "zero" then return table.pack(0) elseif Mode == "empty string" then return table.pack("") elseif Mode == "custom" then local Text = tostring(Settings.DebugCustom or "") local Lower = string.lower(Text) if Lower == "true" then return table.pack(true) elseif Lower == "false" then return table.pack(false) elseif Lower == "nil" or Text == "" then return table.pack(nil) end return table.pack(tonumber(Text) or string.match(Text, '^"(.*)"$') or Text) end return table.pack() end UI.install_http = function() if not X.hook_function then return false end shared.HttpHooked = shared.HttpHooked or setmetatable({ }, {__mode = "k"}) for _, Function in {syn and syn.request, http and http.request, http_request, request} do if type(Function) == "function" and not shared.HttpHooked[Function] then shared.HttpHooked[Function] = true pcall(function() local old old = X.hook_function(Function, X.new_c_closure(function(options, ...) local ok, block = pcall(shared.capture_http, "request", nil, options, ...) if ok and block then return {success = false, StatusCode = 403, StatusMessage = "blocked by Larp Spy", Headers = { }, Body = ""} end return old(options, ...) end)) end) end end return true end UI.spam_seen = { } UI.spam_size = 0 UI.is_spam = function(remote, Method, kind, count, ...) local parts = {Method, kind, count} for index = 1, count do parts[#parts + 1] = UI.value_key((select(index, ...))) end local key = table.concat(parts, "|") local per = UI.spam_seen[remote] local Now = os.clock() local window = tonumber(Settings.AntiSpamWindow) or 1 if not per then per = { } UI.spam_seen[remote] = per end local last = per[key] if last == nil then UI.spam_size += 1 if UI.spam_size > 20000 then UI.spam_seen = {[remote] = per} UI.spam_size = 1 end end per[key] = Now return last ~= nil and (window <= 0 or Now - last < window) end UI.attr_busy = false UI.attr_cache = {Spec = nil, Want = { }} UI.attr_hits = setmetatable({ }, {__mode = "k"}) UI.attr_allowed_slow = function(inst, want) local ok, hit = pcall(function() local Local = players.LocalPlayer local Char = Local and Local.Character local class = inst.ClassName local is_player = class == "Player" if want.LocalPlayer and is_player and inst.UserId == Local.UserId then return true end if want.Character and Char and (inst == Char or inst.IsDescendantOf(inst, Char)) then return true end if want.Workspace and class == "Workspace" then return true end if want.Humanoid and class == "Humanoid" then return true end if want.Tool and (class == "Tool" or inst.FindFirstAncestorOfClass(inst, "Tool")) then return true end if want.PlayerGui and Local and (class == "PlayerGui" or inst.IsDescendantOf(inst, Local.FindFirstChildOfClass(Local, "PlayerGui") or Local)) and class ~= "Player" then return true end if want.ReplicatedStorage and (class == "ReplicatedStorage" or inst.FindFirstAncestorOfClass(inst, "ReplicatedStorage")) then return true end if want["Other players"] then if is_player and inst.UserId ~= Local.UserId then return true end local model = class == "Model" and inst or inst.FindFirstAncestorOfClass(inst, "Model") local owner = model and players.GetPlayerFromCharacter(players, model) if owner and owner.UserId ~= Local.UserId then return true end end return false end) return ok and hit == true end shared.Capture = function(self, Method, direct, ...) if Method == "require" then shared.capture_require(self, nil) return false end if UI.http_methods[Method] and typeof(self) == "Instance" then if active and (Settings.Http or Settings.BlockHttp) and self.ClassName == UI.http_methods[Method] then local ok, block = pcall(shared.capture_http, Method, self, ...) return ok and block == true, nil end return false end if not active or typeof(self) ~= "Instance" or self_ignore[self] then return false end local kind = __R.kind_of(self.ClassName, Method, self) if not kind then return false end if (kind == "getattr" or kind == "setattr") and UI.attr_busy then return false end if direct and not Settings.Direct then return false end local core_disables = false if kind == "corestate" then local relevant relevant, core_disables = UI.core_state_info(Method, ...) if not relevant then return false end end local from_executor = X.check_caller() local exec_block = from_executor and (kind == "kick" or kind == "shutdown") and Settings.BlockSource ~= "game" if from_executor and not Settings.Executor and not exec_block then return false end if (kind == "getattr" or kind == "setattr") and not UI.attr_allowed(self) then return false end local replace = nil local spec = overrides[self] if spec and blocked[self] ~= true and not from_executor and (kind == "event" or kind == "unreliable" or kind == "function" or kind == "bindable" or (kind == "purchase" and UI.purchase_hook_method and UI.purchase_hook_method[self] == Method)) then replace = table.pack(...) for index, item in spec do replace[index] = item.Value if index > replace.n then replace.n = index end end end if kind == "tool" and UI.tool_fired then UI.tool_fired[self] = os.clock() end if not paused and not ignored[self] and not name_ignored(self.Name) and (not from_executor or Settings.Executor) and (UI.kind_log_key[kind] == nil or Settings[UI.kind_log_key[kind]] == true) then push(self, Method, kind, X.get_calling_script(), nil, select("#", ...), ...) end local crash_state = UI.crash if crash_state.Ready and UI.crash_detect() and (kind == "event" or kind == "unreliable" or kind == "function") then crash_state.safe(crash_state.record, self, "out", ...) end local block = blocked[self] == true or blocked_names[self.Name] == true or (crash_state.Ready and crash_state.ArgBlocks[self] ~= nil and crash_state.arg_blocked(self, select("#", ...), ...)) or false if not block and UI.kind_block_key[kind] and Settings[UI.kind_block_key[kind]] == true then block = true end if kind == "kick" then block = Settings.BlockKicks and UI.block_applies(from_executor) if block then task.defer(function() shared.notify("blocked a kick") end) end elseif kind == "corestate" then block = Settings.BlockCoreState and core_disables if block then task.defer(function() shared.notify("blocked reset / inventory being disabled") end) end elseif kind == "shutdown" then block = Settings.BlockShutdowns and UI.block_applies(from_executor) if block then task.defer(function() shared.notify("blocked a game shutdown") end) end elseif kind == "teleport" then block = Settings.BlockTeleports if block then task.defer(function() shared.notify("blocked a teleport") end) end elseif kind == "purchase" then if Method == "UserOwnsGamePassAsync" or Method == "PlayerOwnsAsset" then block = Settings.OwnsSpoof ~= "off" if block then task.defer(function() shared.notify(Method .. " spoofed to " .. Settings.OwnsSpoof) end) end else block = Settings.BlockPurchases == true and string.find(Method, "^Signal") ~= nil if block then task.defer(function() shared.notify("blocked " .. Method) end) end end elseif kind == "require" then block = false end if replace and not block then local Name = self.Name task.defer(function() shared.notify("argument hook applied: " .. Name) end) end local final = block and (not from_executor or kind == "kick" or kind == "shutdown") local fake = nil if final then if kind == "loghistory" then fake = { } elseif kind == "purchase" then if Method == "UserOwnsGamePassAsync" or Method == "PlayerOwnsAsset" then fake = Settings.OwnsSpoof == "true" end elseif kind == "getattr" then local done, Value = pcall(UI.attr_fake, self, ...) if done then fake = Value end end end return final, replace, fake end UI.capture_body = shared.Capture shared.Capture = function(Self, Method, direct, ...) local block, replace, fake = UI.capture_body(Self, Method, direct, ...) if not direct and setnamecallmethod and not env.__LarpUseOth then setnamecallmethod(Method) end return block, replace, fake end shared.notify = function() end shared.capture_parent = function(Self) if not active or not UI.strict.Kick(Self) then return false end local from_executor = X.check_caller() if from_executor and not Settings.Executor and not (Settings.BlockParentNil and Settings.BlockSource ~= "game") then return false end if Settings.ParentNil and not paused and not ignored[Self] and not name_ignored(Self.Name) and (not from_executor or Settings.Executor) then push(Self, "Parent", "parentnil", X.get_calling_script(), nil, 0) end local block = Settings.BlockParentNil and UI.block_applies(from_executor) if block then task.defer(function() shared.notify("blocked LocalPlayer.Parent = nil") end) end return block end shared.capture_create = function(Name, ...) if shared.LibBusy then return false end shared.LibBusy = true local ok, block = pcall(UI.capture_create_body, Name, ...) shared.LibBusy = false return ok and block == true end do local crash = UI.crash crash.safe = function(fn, ...) local busy = shared.LibBusy shared.LibBusy = true local ok, result = pcall(fn, ...) shared.LibBusy = busy return ok and result or nil end crash.BlockedCode = { } crash.BadFns = { } crash.SpawnCounts = { } crash.Mine = (function() return debug.info(1, "s") end)() crash.root = function() local last for level = 2, 40 do local source, line, func = debug.info(level, "slf") if not source then break end if source ~= crash.Mine and source ~= "[C]" then local ok, defined = pcall(debug.info, func, "l") last = source .. ":" .. tostring(ok and defined or "?") end end return last end crash.learn_root = function(kind) local root = crash.root() if root and not crash.BadFns[root] then crash.BadFns[root] = "loops " .. kind crash.Dirty = true end end crash.spawn_blocked = function(Name, ...) local fn = ... if Name == "delay" then fn = select(2, ...) end if type(fn) ~= "function" or X.check_caller() then return false end local source, defined = debug.info(fn, "sl") if source == crash.Mine or source == "[C]" or not source then return false end local key = source .. ":" .. tostring(defined) if crash.BadFns[key] then return true end local count = (crash.SpawnCounts[key] or 0) + 1 crash.SpawnCounts[key] = count if count >= (Settings.CrashSpawn or 200) then crash.BadFns[key] = "spawned " .. count .. "+ times in one frame" crash.Dirty = true return true end return false end crash.hook_spawn = function() if crash.SpawnHooked or not X.hook_function then return end local got, env = pcall(getrenv) local library = got and type(env) == "table" and env.task or task for _, Name in {"spawn", "defer", "delay"} do pcall(function() local old old = X.hook_function(library[Name], X.new_c_closure(function(...) if Settings.BlockSpawnCrash and crash.Ready and crash.spawn_blocked(Name, ...) then return coroutine.create(function() end) end return old(...) end)) crash.SpawnHooked = true end) end if not crash.SpawnHooked then pcall(shared.notify, "couldn't hook task.spawn") end end crash.where = function() local mine = debug.info(1, "s") for level = 2, 14 do local source, line, Name, func = debug.info(level, "slnf") if not source then break end if source ~= mine and source ~= "[C]" then local ok, defined = pcall(debug.info, func, "l") return source, line or 0, (Name and Name ~= "") and Name or "anonymous", ok and defined or nil end end return "unknown", 0, "?" end crash.suspect = function(source) local best, score, conf local Now = os.clock() for _, item in crash.Recent do local age = Now - item.Time local Value, kind = 0, nil if source and item.Source == source and age <= 10 then Value, kind = 3 - age / 10, "same script" elseif crash.Frame - item.Frame <= 1 then Value, kind = 2, "same frame" elseif age <= 3 then Value, kind = 1 - age / 10, "recent" end if Value > (score or 0) then best, score, conf = item, Value, kind end end return best, conf end crash.attach = function(entry, item, conf) entry.Remote, entry.Dir, entry.Args, entry.Conf = item.Remote, item.Dir, item.Args, conf entry.Weak = conf == "recent" entry.Fired = item.Source and (item.Source .. ":" .. tostring(item.Line)) or nil if crash.on_found then task.defer(crash.on_found, entry) end end crash.record = function(remote, dir, ...) local source, line if dir == "out" then source, line = crash.where() end local item = {Remote = remote, Dir = dir, Frame = crash.Frame, Time = os.clock(), Args = table.pack(...), Source = source, Line = line} crash.Head = crash.Head % 64 + 1 crash.Recent[crash.Head] = item for index = #crash.Pending, 1, -1 do local entry = crash.Pending[index] if crash.Frame - entry.Frame > 1 then table.remove(crash.Pending, index) elseif not entry.Remote then table.remove(crash.Pending, index) crash.attach(entry, item, "same frame") crash.Dirty = true end end end crash.announce = function(entry) pcall(shared.notify, "crash code: " .. entry.Kind .. " at " .. tostring(entry.Source) .. ":" .. tostring(entry.Line)) end crash.trip = function(kind, detail) local source, line, func, defined = crash.where() local where = source .. ":" .. line local key = kind .. "|" .. where local entry local fresh = true crash.Hot[kind] = where for _, old in crash.Found do if old.Key == key then entry = old fresh = false break end end if not entry then entry = {Key = key, Kind = kind, Source = source, Line = line, Func = func, Defined = defined, Hits = 0, root = crash.root()} table.insert(crash.Found, 1, entry) if #crash.Found > 30 then table.remove(crash.Found) end end entry.Detail, entry.Hits, entry.Time, entry.Frame = detail, entry.Hits + 1, os.clock(), crash.Frame if Settings.CrashAutoBlock then crash.BlockedCode[key] = true end if not entry.Remote then local item, conf = crash.suspect(source) if item then crash.attach(entry, item, conf) elseif not table.find(crash.Pending, entry) then table.insert(crash.Pending, entry) end end crash.Dirty = true if fresh then task.defer(crash.announce, entry) end end crash.Note = function(kind, ...) if crash.Drawing or X.check_caller() then return false end if kind == "buffer.create" then local size = ... if type(size) == "number" and size > (Settings.CrashBufferMB or 32) * 1048576 then crash.trip(kind, string.format("%.0f MB requested", size / 1048576)) return true end return false end if next(crash.BlockedCode) then local source, line = crash.where() if crash.BlockedCode[kind .. "|" .. source .. ":" .. line] then return "kill" end end local count = (crash.Counts[kind] or 0) + 1 local limit = kind == "print" and (Settings.CrashPrint or 150) or (Settings.CrashNew or 400) crash.Counts[kind] = count if count == limit then crash.trip(kind, limit .. "+ calls in one frame") end if count >= limit then local source, line = crash.where() local where = source .. ":" .. line local own = (crash.Counts[kind .. where] or 0) + 1 crash.Counts[kind .. where] = own if own == limit and count ~= limit then crash.trip(kind, limit .. "+ calls in one frame") end if (Settings.CrashAutoBlock or Settings.BlockSpawnCrash) and (where == crash.Hot[kind] or own >= limit) then if Settings.BlockSpawnCrash then crash.learn_root(kind) end return "kill" end end return false end crash.make_rule = function(args) local rule = {Count = args.n, Modes = { }, Types = { }, Values = { }} for index = 1, math.min(args.n, 10) do local Value = args[index] rule.Types[index] = typeof(Value) rule.Values[index] = UI.value_key(Value) rule.Modes[index] = Settings.CrashArgMode == "type" and "type" or "value" end return rule end crash.arg_blocked = function(remote, count, ...) for _, rule in crash.ArgBlocks[remote] or { } do local ok, hit = pcall(UI.rule_matches, rule, count, ...) if ok and hit then return true end end return false end crash.scan = function(remote) local state = crash.Proxy[remote] if not state or not getconnections then return end local ok, list = pcall(getconnections, remote.OnClientEvent) for _, Connection in ok and list or { } do local got, fn = pcall(function() return Connection.Function end) if got and type(fn) == "function" and not crash.OwnFns[fn] and not state.Seen[fn] and pcall(function() Connection.Disable(Connection) end) then state.Fns[Connection] = fn state.Seen[fn] = true end end end crash.ensure_proxy = function(remote) if not getconnections then return false end if not crash.Proxy[remote] then local state = {Fns = { }, Seen = { }} crash.Proxy[remote] = state local callback = function(...) if crash.FullIn[remote] or (crash.ArgBlocks[remote] and crash.arg_blocked(remote, select("#", ...), ...)) then return end for _, fn in state.Fns do task.spawn(fn, ...) end end crash.OwnFns[callback] = true state.Conn = remote.OnClientEvent.Connect(remote.OnClientEvent, callback) end crash.scan(remote) return true end crash.unproxy = function(remote) local state = crash.Proxy[remote] if not state then return end crash.Proxy[remote] = nil pcall(function() state.Conn.Disconnect(state.Conn) end) for Connection in state.Fns do pcall(function() Connection.Enable(Connection) end) end end crash.Watch = function(remote) if crash.Watched[remote] or self_ignore[remote] then return end local class = remote.ClassName if class ~= "RemoteEvent" and class ~= "UnreliableRemoteEvent" then return end local callback = function(...) if active and UI.crash_detect() then crash.safe(crash.record, remote, "in", ...) end end crash.OwnFns[callback] = true crash.Watched[remote] = remote.OnClientEvent.Connect(remote.OnClientEvent, callback) end crash.start = function() if crash.Beat then return end crash.Beat = run_service.Heartbeat.Connect(run_service.Heartbeat, function() crash.Frame += 1 crash.Counts = { } crash.SpawnCounts = { } if crash.Frame % 30 == 0 then for remote in crash.Proxy do pcall(crash.scan, remote) end end if crash.Dirty and crash.redraw then crash.Dirty = false crash.redraw() end end) crash.Added = game.DescendantAdded.Connect(game.DescendantAdded, function(object) pcall(crash.Watch, object) end) local ok, all = pcall(game.GetDescendants, game) for _, object in ok and all or { } do pcall(crash.Watch, object) end if not crash.PrintHooked and X.hook_function then crash.PrintHooked = pcall(function() local old old = X.hook_function(print, X.new_c_closure(function(...) if active and UI.crash_detect() and crash.safe(crash.Note, "print", ...) == "kill" then error("[remote spy] crash code stopped", 0) end return old(...) end)) end) end end crash.stop = function() if crash.Beat then crash.Beat.Disconnect(crash.Beat) crash.Beat = nil end if crash.Added then crash.Added.Disconnect(crash.Added) crash.Added = nil end for remote, Connection in crash.Watched do Connection.Disconnect(Connection) crash.Watched[remote] = nil end crash.Recent, crash.Pending, crash.Counts = { }, { }, { } end crash.sync = function() if UI.crash_detect() then crash.start() if Settings.BlockSpawnCrash then crash.hook_spawn() end UI.set_instance_new() UI.install_create() else crash.stop() end end crash.cleanup = function() crash.stop() for remote in crash.Proxy do crash.unproxy(remote) end end crash.Ready = true end shared.capture_lib = function(Name, ...) if shared.LibBusy then return end shared.LibBusy = true pcall(UI.capture_lib_body, Name, ...) shared.LibBusy = false end shared.capture_require = function(module, results) if Settings.NetFinder and UI.net_find then pcall(UI.net_find, module) end if not active or paused or not Settings.Require then return end if X.check_caller() and not Settings.Executor then return end local is_instance = typeof(module) == "Instance" local Name = is_instance and module.Name or ("asset " .. tostring(module)) if ignored[module] or name_ignored(Name) then return end push(module, "require", "require", X.get_calling_script(), nil, 1, module) queue[#queue].Result = results end shared.capture_debug_info = function(results, ...) if shared.DebugInside or not active or not Settings.DebugCalls then return end if X.check_caller() and not Settings.Executor then return end shared.DebugInside = true local count = select("#", ...) local args = table.pack(...) local spoof pcall(function() local script = X.get_calling_script() local Info = __R.caller_info() if Settings.DebugStack and not paused then local ok_stack, stack = pcall(__R.full_stack, 25) if ok_stack and type(stack) == "table" and #stack > 0 then local top = stack[1] Info = Info or {Source = top.Source, Line = top.Line, Name = top.Name, Params = top.Params, Vararg = top.Vararg} Info.Stack = stack end end local ok_name, script_name = pcall(function() return script.Name end) local ok_path, script_path = pcall(function() return script.GetFullName(script) end) local where = (ok_name and script_name) or (Info and string.match(tostring(Info.Source), "[^%.]+$")) or "unknown" local path = tostring((ok_path and script_path) or (Info and Info.Source) or "unknown") local group = Settings.DebugGroup local key, label = "debug.info", nil if group ~= "all" then label = where key = "debug.info|" .. path if group == "caller" and Info then label = where .. "." .. (Info.Name or "?") .. ":" .. tostring(Info.Line) key = key .. "|" .. (Info.Name or "?") .. ":" .. tostring(Info.Line) end end local Mode = Settings.DebugBlock local block = blocked[key] == true if not block and Mode ~= "off" then block = true if (Settings.DebugOnly or "") ~= "" then block = false for piece in string.gmatch(Settings.DebugOnly, "[^,]+") do piece = string.match(piece, "^%s*(.-)%s*$") if piece ~= "" and string.find(path, piece) then block = true break end end end end if block then spoof = debug_spoof(Mode == "off" and "nothing" or Mode) end if not paused and not ignored[key] and not name_ignored("debug.info") then local before = #queue push(key, "info", "debuginfo", script, nil, count, table.unpack(args, 1, count)) if Settings.DebugStack and Info and #queue > before then queue[#queue].Info = Info end queue[#queue].Result = results queue[#queue].Label = label queue[#queue].Spoofed = spoof ~= nil end end) shared.DebugInside = false return spoof end end shared.capture_signal = function(Name, signal, ...) if not active or replaying then return false end local block_all = (Name == "firesignal" and Settings.BlockFireSignals) or (Name == "replicatesignal" and Settings.BlockReplicateSignals) or false if not block_all and (paused or (Name == "firesignal" and not Settings.FireSignals) or (Name == "replicatesignal" and not Settings.ReplicateSignals)) then return false end if typeof(signal) ~= "RBXScriptSignal" then return false end local key = tostring(signal) local Event = string.match(key, "^Signal (.+)$") or key if paused or not ((Name == "firesignal" and Settings.FireSignals) or (Name == "replicatesignal" and Settings.ReplicateSignals)) or ignored[key] or name_ignored(Event) then return blocked[key] == true or blocked_names[Event] == true or block_all == true end push(key, Name, Name, X.get_calling_script(), nil, select("#", ...), ...) local Log = queue[#queue] Log.Signal = signal Log.EventName = Event return blocked[key] == true or blocked_names[Event] == true or block_all == true end shared.capture_connect = function(Method, signal, callback, existing) if not active or replaying or typeof(signal) ~= "RBXScriptSignal" then return false end local key = tostring(signal) local Event = string.match(key, "^Signal (.+)$") or key local reader = UI.log_events[Event] == true if not Settings.Connections and not (reader and (Settings.LogReaders or Settings.BlockLogReaders)) then return false end if UI.own_callbacks[callback] then return false end local from_executor = (not existing) and X.check_caller() or false local block = (reader and not existing and Settings.BlockLogReaders and UI.block_applies(from_executor)) or false local wanted = (Settings.Connections or (reader and Settings.LogReaders)) and not paused and not (from_executor and not Settings.Executor) if wanted then local Info = nil if type(callback) == "function" then local ok, source, line, Name, params, vararg = pcall(raw_debug_info or debug.info, callback, "slna") if ok and source then Info = {Source = source, Line = line, Name = (Name and Name ~= "") and Name or nil, Params = params, Vararg = vararg} end end local row = Info and (key .. "|" .. tostring(Info.Source) .. ":" .. tostring(Info.Line)) or key if not (ignored[key] or ignored[row] or name_ignored(Event)) then local script = nil if not existing then script = X.get_calling_script() end push(row, Method, "connection", script, nil, 1, callback) local Log = queue[#queue] Log.Signal = signal Log.EventName = Event Log.Info = Info end end if block then task.defer(function() shared.notify("blocked a " .. Event .. " connection") end) end return block end shared.capture_proximity = function(Prompt, ...) if not active or replaying or not (Settings.Prompts or Settings.BlockPrompts) or typeof(Prompt) ~= "Instance" then return false end __R.prompt_fired[Prompt] = os.clock() if Settings.Prompts and not paused and not ignored[Prompt] and not name_ignored(Prompt.Name) then push(Prompt, "fireproximityprompt", "prompt", X.get_calling_script(), nil, select("#", ...), ...) end return blocked[Prompt] == true or blocked_names[Prompt.Name] == true or Settings.BlockPrompts == true end shared.capture_http = function(Method, Self, ...) if not active or env.__LarpHttpSelf or not (Settings.Http or Settings.BlockHttp) then return false end local A = ... local Url, http_method if Method == "request" or Method == "RequestAsync" then if type(A) ~= "table" then return false end Url = A.Url or A.url or A.URL http_method = string.upper(tostring(A.Method or A.method or "GET")) else Url = A http_method = string.find(Method, "Post") and "POST" or "GET" end local key = http_method .. " " .. tostring(Url) local from_executor = X.check_caller() local Now = os.clock() if UI.last_http and UI.last_http[1] == key and Now - UI.last_http[2] < 0.02 then return false end UI.last_http = {key, Now} local block = (blocked[key] == true and not from_executor) or (Settings.BlockHttp and UI.block_applies(from_executor)) or false if paused or not Settings.Http or ignored[key] or name_ignored(tostring(Url)) then return block end push(key, Method, "http", (not from_executor) and X.get_calling_script() or nil, nil, select("#", ...), ...) local Log = queue[#queue] if Log and Log.Remote == key and not Log.Label then Log.Label = key Log.Url = tostring(Url) Log.Executor = from_executor end return block end shared.capture_exec = function(kind, Name, target, ...) if not active or replaying or typeof(target) ~= "Instance" then return false end if (kind == "touch" and not (Settings.Touches or Settings.BlockTouchCalls)) or (kind == "click" and not (Settings.Clicks or Settings.BlockClickCalls)) then return false end if kind == "click" or kind == "touch" then click_fired[target] = os.clock() end if ((kind == "touch" and Settings.Touches) or (kind == "click" and Settings.Clicks)) and not paused and not ignored[target] and not name_ignored(target.Name) then push(target, Name, kind, X.get_calling_script(), nil, select("#", ...), ...) end return blocked[target] == true or blocked_names[target.Name] == true or (kind == "touch" and Settings.BlockTouchCalls == true) or (kind == "click" and Settings.BlockClickCalls == true) end __R.connections = { } local kind_icons = { } __R.Accented = { } local pending_status local destroy local minimized = false local function Connect(signal, callback) local Connection = signal.Connect(signal, callback) table.insert(__R.connections, Connection) return Connection end local function http_get(Url) env.__LarpHttpSelf = true local ok, body = pcall(function() return game.HttpGet(game, Url) end) env.__LarpHttpSelf = false if ok and type(body) == "string" and #body > 0 then return body end return nil end function UI.base64(Data) local alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" local lookup, out = { }, { } for index = 1, 64 do lookup[string.byte(alphabet, index)] = index - 1 end for index = 1, #Data, 4 do local A, B, C, d = string.byte(Data, index, index + 3) local number = bit32.lshift(lookup[A], 18) + bit32.lshift(lookup[B], 12) + bit32.lshift(lookup[C] or 0, 6) + (lookup[d] or 0) local bytes = string.char(bit32.band(bit32.rshift(number, 16), 255), bit32.band(bit32.rshift(number, 8), 255), bit32.band(number, 255)) if not lookup[C] then bytes = string.sub(bytes, 1, 1) elseif not lookup[d] then bytes = string.sub(bytes, 1, 2) end table.insert(out, bytes) end return table.concat(out) end function __R.draw_title() UI.title_text.Text = 'Larp Spy' end local font_face, font_size, pixel = (function() local ok, face = pcall(function() assert(writefile and isfile and getcustomasset) ensure_folder() local ttf = folder .. "/Monaco.ttf" local json = folder .. "/Monaco.json" if not isfile(ttf) then writefile(ttf, assert(http_get(__R.font_url))) end writefile(json, http_service.JSONEncode(http_service, {name = "Monaco", faces = {{name = "Regular", weight = 400, style = "Regular", assetId = getcustomasset(ttf)}}})) return Font.new(getcustomasset(json)) end) if ok and face then return face, 9, true end return Font.fromEnum(Enum.Font.RobotoMono), 12, false end)() UI.old_font, UI.old_size, UI.old_pixel = font_face, font_size, pixel UI.code_font = font_face UI.modern_font = Font.new("rbxasset://fonts/families/GothamSSm.json", Enum.FontWeight.Medium) UI.modern_bold = Font.new("rbxasset://fonts/families/GothamSSm.json", Enum.FontWeight.SemiBold) function UI.apply_font_vars() if UI.classic then font_face, font_size, pixel = UI.old_font, UI.old_size, UI.old_pixel UI.bold_face, UI.code_size, UI.mono_width = UI.old_font, UI.old_size, UI.old_pixel and 6 or 8 else font_face, font_size, pixel = UI.modern_font, 12, false UI.bold_face, UI.code_size, UI.mono_width = UI.modern_bold, UI.old_pixel and 11 or 12, UI.old_pixel and 7 or 8 end end UI.apply_font_vars() do pcall(function() assert(writefile and isfile and getcustomasset) ensure_folder() if makefolder and isfolder and not isfolder(folder .. "/icons") then makefolder(folder .. "/icons") end local path = folder .. "/icons/ui_check.png" if not isfile(path) then local Data = http_get((string.gsub(__R.font_url, "[^/]+$", "")) .. "Check.png") if type(Data) == "string" and #Data > 50 and string.sub(Data, 2, 4) == "PNG" then writefile(path, Data) end end if isfile(path) then UI.check_image = getcustomasset(path) end end) end do pcall(function() assert(writefile and isfile and getcustomasset) ensure_folder() if makefolder and isfolder and not isfolder(folder .. "/icons") then makefolder(folder .. "/icons") end for _, Name in {"event", "unreliable", "function", "bindable", "incoming", "require", "kick", "teleport", "firesignal", "replicatesignal", "debuginfo", "prompt", "touch", "click", "connection", "guiclick", "tool", "actormsg", "create", "corestate", "shutdown", "parentnil", "http", "arrow", "lib", "logservice", "loghistory", "getattr", "setattr", "sound", "wait", "anim", "instancenew", "tables", "buffers", "actors", "block", "settings", "code", "logs", "misc", "appearance"} do local path = folder .. "/icons/v2_" .. Name .. ".png" if not isfile(path) then local ok, Data = pcall(http_get, __R.icon_base .. Name .. ".png") if ok and type(Data) == "string" and #Data > 50 and string.sub(Data, 2, 4) == "PNG" then writefile(path, Data) end end if isfile(path) then kind_icons[Name] = getcustomasset(path) end end end) end UI.generated_icons = { purchase = "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAEcklEQVR4nKWXX2hcVRDGv7m7NiW1Jv1DQSyKfVAxRWM1hfggplSI+AdBEHzRNlSCL4roq9B3C0kVpLZS6ZOIT1UQEQQLqS1tY7W0pEVLq1WsaK0xxCR2sz8f7pzdyc1usosHlnP2nJlvvplz7sw5pjYbYJIySea/1KqSMLNqO3i2vEjNcKkVA4Fg1cz43wSAzA3j/9dJ6pG0RVK3i1UknZA0YWZXImkzm1/OxlLGS2H8GHAY+J3mbQo4CgwBK4oY7Rove78F+GIJo83aWeA5x8h8axa1hpNA2cwqwJCkUUmrw3JF0mlJ5yT96HPdkh6Q1CvplgLcqJm9VtzKVjx/yT2Z9/4v4C3gviV0NwJvABdcZ877/Qm7WSQSQMn7FwsAY8BdQc6AUgJz4CysdwEHXHfG+33RRiPjmQP3AtPAv654IESl7HKZj7uAO31ccv1ywBx2jFnvh5qSSB4AR8JBOh68TNGxMDcAjDXAqBEBRhyr4tu4LmIUQ78t7Ps1YFMKdwL2vhPYCXwJ/A3sAe5tRMIjcxKoOvbuRVEIBj4L3u9JYS9s0R3Ady5zAfgN+NW3bLCAl3Qfd/kqcBXoqjkUvFoP/OmCM0CPG8wKnn3qMpuBR8gPaBn4wUPclUIcfp3UvwyA7YlopjxvS9I9qqfWCTM7J0lmVgXM+05J2yV9a2ZnJW2QtMrMKpL2Ks8rff6tZ96XzOwfSZ+HI7fV+ywS6FM9MZ1OAlrYkDQrab3/vy6p4qF+X9LtksaceK0GeJTHA05fWooG1obxZe/NwSAvLDOSDkvaCLyrvCjdMLOKmc2Y2aSZzRZJeyQuh7lkq/7NSopVq1G2qronryvfqpd9fgr4QNI7ZvYNkDUp2RGzZitGoBLGaxZpew43s2tm9oykRyV9LGmlpB2SxoFX/KwUt05aGOEbkUBieyoIPOT9Ak/CnaBsZkckved6fZKuStoL9BZIJM8fDFDpPGSZ8oMl5dVt2sc9wK25rXrGAjqAbkmZH7wuSR1mdkrSm441GJyT8q0rSRpoQCDfL2f7i6QJB1kj6fn0GYWsNSjpkqQX/NNLieYmSeddtzMQLvnc/ZL6fTwt6WsXmY+CAnZ4opj3xLHKU2la3+TrF4GbPREd87W3fW1bwnRiAj4KSehQtJkIGHmqXQF8Tz1vH0wehrT6qq/9AXwF/ET9xjTqMhn1K9lOX6v47+4ko9iCl8+6Qiqhw4Fk8mgAOORkp4BPgCeD54nsVvLSnu4VI4u8b0JixBXSZWIkgMZD+QRwpqjv413AJPV7xTEn1/R+WKzj+10xsT8OPA10BPmVhJuSz/UDH4awA5wA1lK8B6hBxnOBVHz2SRouiJxXXljOSLooaU7SbcrfCQOSHna5qvJP8aikp8zsOs2zZMNIpO3YRV7z221zvnXp3DTKjssSSXeADcBu4EoLhieBg8DmQlQbtlaeZrXnFbBaeS3vV+On2bikk2b2c9JVi2/E5UjUtqRF+VKrIW/5dZyIKD9YsYillupKtZ0n+n/9GaK06iyrEwAAAABJRU5ErkJggg==", arrow = "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABP0lEQVR4Xu2WQW7CMBBFaSmbchkkNpRTsOyNKiG4AexAbHuDnqvQ9qFBMzAYnNpOKnXhL0XJIv7/z/eMk16voqLivwJ4BPpt/RXxyCITBh7kKjES8mRxAGPgxRtJJVDTpyKyeMwxMOeCjRGmJKHvPqn4IuAZ+FSu4MSlcsE3cNDnnRI2mgjEl7r2y/HMlOe2t6zhgKkuFPEfYJ9iIiIua4XjUzle1cApoRtYxwJbXWDijSYi4pae3T+AoWrc7yff8cAuxUSG+LNW39zMQQenmBgose35vcpN/Dzejcgx0bl4cADZLMeSWANvrmkFfs/zKg/xSxIypgZ77k48MQkRljnvtvKMJGTGBTamMmrtYo8hsh0+gb8TD7bDZn/leuBdDhk7rlM/WkXwHyRgBEy8wSLSEnT1z9AKRX87FRUVAY5f1FQ4mmZyTQAAAABJRU5ErkJggg==", create = "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADK0lEQVR42rWXT4hPURTHv++9H9NMI38iapIFKckCvyxnY7JQrKRGydKCFDUkrLARokyxQcrULBUhNopmIhYYC0IooQmZYsb8fu9jc16drvd+836/4dTtvXvvueec++97vjcCNA2J7Nuykco0HEeSUqvH9k2bNRS3GDTmLLGSWqm4VSk3kya2IHOEpPmSjkpaLGnM+vokvXO69VJWgalKDCTufyfwgb/lK3AA6HC68VT2G3VGzrGA9cBw4PRpTtsLYIsbl5itpgLwjpcDVwMn34HDQLvp7AI+Bjo3gKqzUykbQBbtLOAo8MMZTYErwNIc/UXAWWDc6f8Gzlmf8lYib78FbAdeBzO6D3QHM4pyZrfaZu/lE7DH9KOiADIj+4IZjAC9bluSgsMVBYFsBIbMRiZ94Rbn4UDVrtu43emPkh64axUVAA5WMhwYkvTG6hM2flOInHkB/LL2GQYsPZJeSjopaZ6kmhlNAkCLzUm7pEPmfJvZaDP9341wIFu+i7Zcn4HTduIzeWs4ELul9Mu+FXju9CeAfuCV1e8EZ61hAF+svgwYsBuQyZDhQja2CtwKDt51YK31P2s1gAWuv8cce7lkV2/CtT3PAaIXrQYw15QrARS/z4HiUWC/g2J/W0aKAiiTDVM7XImd3guS1kjqlzRpZVDSWkknJP0MMuQ/S8d1C2CmpFFJx91tOWWZsM1uSP1/8oHsGs51bbPNVq1ZdhSX4ABRAejUg9VJm7RRGEDqnHyzb9LCSsVuO2pFlC0vgA4b1Clptzmv2TcuyRcTd2Z6JXVZvaNMAI/NQIekM5KGJW1wy1zE+yLHF+uS1km6K2nAIDyRdDNg07npOAIOBhAMMGjkJNNdCdSsr8e1dwHngUk3dhw46VJ4VIaQLAEuBxD8AzgOdAILgbq1Vy34PsshXq4Bq5qlZD7BdAP3AqMvgSM2sxQ4BjwKdJ4Am1uhZHlsWMAOy4YEFC2Uz8BeYEYZdlyGlntWO8dmO+YCyLZh0vhfVwG5bTmAPGMr7FBmchtYV8AXG5aoycdp5HBBlpQqkh7mvJ7++dMsDz/Sgseq/ncAHufVTPYL5Q+CWwwu/Uow7QAAAABJRU5ErkJggg==", kick = "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACFElEQVR42sWXv2oVQRTGfzO7in8wjZhaRDBaaqWFCEG7FCHEytaXyBv4EFZWon20EBsRRexEUoilBCyUQHJzk707KfwWxnV2d3Z2r/fAYe7dnZnzzTnfOXPWOOdYpOQNzy1gItbP5gHAAOWiPGAAB1wBLut3myc+AAfeukEArDa5CnwGliLWXwd2hgCwDadfAo4j1pt5cOBYQHLgKfBOQCte+GH54T0blYSVgdfAi4h9XCCUbkgaVnJBc3KgaEjDuqGyFtJoDoSklOEmdQE+XAuEKhlAH8k0PgZextqwc6gtv4EN4JlAlW12bOJJ2zQXNx4Br4BzApGNBWDWoFONhzI2AVaBbWBZ77K+WRCafxs41eCZGbCi/6dF1LvAW4HZrdWUaADGS8tt4HwPUhbADd0bD4FPPoi+ITDA2YQ1AJd0gL9KeKwHqnw/ALaAMw18KoF70lKay/WrwFfNm6Vy4BB40jFnIgBTeWsHWNf4T0XNE7Igb3leiB+ljH8B7ssDwXKeAqDoeHckN78BNoFfImSRchmlyEXgPbCmcGRtveOYpbgy8lxun9QJl+IB65VY19EVV+8/9mluuwDse6W2T5s3qCHxF98EfrbEMdQV92vpnXOVZhofuD8ydd2yojXW26eX2trJDfAd2NNl8l+74lIbfgNuAXc8AyYAdJSu2AQ+Ts2QDccoq05MtpG5PwisWfTn+QlNG/hXgj94kgAAAABJRU5ErkJggg==", corestate = "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADe0lEQVR42t2Xz4tcRRDHP29mdo2JGjAgewoYYhSCIiiiRPAg3oyiSDYKUQ9Rz0ICgUAiBM/+AV68SFARTx68GUmIgkrEHwRBMIJZXF1EXV03M/M+Hqynte17k9llTzYU/bq7urrr17f6VSobaBXQL+bGwLqFVRu8wKa1wQY0F9gOPBZzxvx7wELi2RQL9KKviwvcBPxQ8N4JfBZ76rS/CvdMPKBrrQ7qFVZbAr4ARkGLwHeFRavYO550Tm+Ca2pgP3AkvmdD+1EIvRR8gzD9z7GWeZ8FDsfcTOtJakm96B9QV/y77Yu5a9Qn1dfVRbUO+kV9W31O3R68u9U/Yv98Ifsfaju8Uh9Vf1dHccBF9Rn1S6/eLqmH1TMxXg0ZL4TsNZdoywKBXcCWcJHArcBrKd9zgDV76uh3Aq+m+dn43p34p3LBPvXTuP04rDFOmo7UYVBjKRNvw/+1un9aFzQ0G/3j6bCm1emwsuX5YfRHCplrKONAaZ4twAVgT0pFE99Z4HxE/t3AQwUwNf0SsDdSNYOUXS6YUfvqwUL7xhW/qQda9j2oXk5uyFY4FjJnJrlgq3p9Gp+OQ4eF0CdifVAQ6r0R9ePY28TGueKc6/IFms2H1AX1vPqWupQ0b6xwLlmp6oib04X2Bh68oZ5Vv1ePN3IGBfrNBbUVIIAzaVwWkSZO3gcOFmvXAgfSeLYNiuspiteoNZf/y3O1VrddoA8MgW+BD4HlwgoA98XmqqNU18FTtmFkzDfA6prHTPLlDvVmdVuM32kJwlHUiMbnTQA2/t+j/toShB+nWrJTnYtx1YWEVeB5TsNG6IJ6f8u+vepXHWn4clsdaAOijO03ABcjKEsgGgNvBhiNgXuAeWBbwUuY/LYo3/0UwJ1AlFPqqQ4o7mrjFig+PgmKex3BdAW4BTiUtB4VMDsqyKT5OPE9HFB9ZZpq2Pj/6QKILDQbtcyPC/DJFllRj4b83iQLVKmG3xjpI3AZOAH8GIDVb9GmF2vLwCng85hbjcK2tfW1POE9MJ80eSTm5qKwfBDp1pTmFfUj9ZS6K3jvShZ4cb3vgaY+PK++0hFE76YLXugI4mPqyUJmZxp2Pcuza3pBI+AT4I5YX4xn258pCMv/g3ozf0x2AD8VvLfHv0J58WpSnRlMWzRa2kvFy2d5zUvn32//Vz+n5e95VZThdWvzFzvwOtTDQxb+AAAAAElFTkSuQmCC", shutdown = "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAC3UlEQVR42sWXu2tUQRTGf3N3I2FjTAyIBkGwsIkGC00nooViJ4oPREQD2ltYiI2lCP4DNkbwWWmppBDTaKGFJgFDUAsRBfG1BEMwufezOVeH8b52t9iBYc6eO3Me3577nblOEt0c9Q7PO09WNwJQNxFYBfSZ/Bv41Y6RqIOgjwDvbF5tN6FOEOgF1pq8pl0jrSBQC4ousRoQsFKytyMEUkNxwbPQWezp1QkCzsvyBNCwzPNGAvQA44aCynxEFTLvA+4Ad4FzFQI4CdwAHgHrTZfvR1LWdJJqkiJJk/o3vksatD3jnv6m6XolvfX005L6zY7L8hUVIBMD14B9VmSfgWPAYgYJyfvvjwNvTDcKTBgKrioCNVt3WBYrkpqSRk3fY+sZSYnNieDZsKQPdlaSDga2SxEAuGhZ1IALwIyxn4I6CftBj6F11ivES3lvRJRReLEVzwH7PW8w1oDlCq/tsu2dBJ6ajTH7O/4ryHrOf78TWG26B1YDdcsgfccfAs9Nbma8/w64B+wxeRcwbT6SvABSOEc83cucDtj0HIfPUu54basDtrbCA/2e/DWn9To7H2VUeLr3m0fT/a1Q8aInDxbcBcruAwNWD6HNUgTmPXl7Dt+XMWwKe+pjrkoAaXG8AJZMPtTG7SdF56ine5ZpJ4OIIlsfG8lI0uGAaIpm3dYxI6JY0qyRkAspuYgJ95rzWNInSRu9IFxO/0gDbEiasbOSdDoIrjAAP4jbZiCxLEYyGlbdQw0LdMprSFNeY3NVA3B2oCHplWesKemypE0ZZzZIOm9opeOj9QUXBPl3uoIPk5SxhoH7wG7v2QIwaxfSGNgMbAOGvD2zVoRzIftVuQ+EBVmXdEXST5WPJUnXJQ0ENmgVgRAJLNNTwH5gi3crXgDeA0+AW5Y9hZmn5FLx29B5jSodQ8A6k38AX4JbcVKFO1yLH6eRF4hyqD0py7qTAMi5jIgufJy27dQffwAHQWY8aZAE6AAAAABJRU5ErkJggg==", parentnil = "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAB+ElEQVR42uWXv24UMRCHx3sH6VCeARDFkSMFilCeASEqJBSCSJUCKjpaqjxBKp4gLxBKHoImQpFShD8S4gmSO38U/CxNrPPe+najFIxkzXrs9Xye3fXsBMBuUhq7YSkBjDrCBbVBAYKZzc0sdgBErZGtN0Ba9K2ZbQlivGBOArxjZuu6nq8UDSC1kfQ7/slP4KFsY+kg/Qz4DPwCfgNfgNcaa9yaS5vvNHKwDZwL4gcw0fhtQX6kLJ9qIXJDunEi5wliQ/b7skXgQjoCM/UB9rOIVgH4cJcgduR0Lp1kJtuJnAf3yKoAukDsyuYhogO51/VRtA2WIDYLEB7kwRAAtRCX0md6YXs9glUg0kv4IbuvN0AXiB3ZjjW36bL7GoA2iKns28BadmANCmDALelpAaKpXK8KID9YpsD3BRDj6wAYuQjsAS/Uf5RFYlILUeP8OfDVnXy7sm/2gejq/MA5vtD3PghEjfNL5zgOBbHM+VO365il3kEgFhnTEboGfHPpdpH0hmg7cF667NYmvSDawn/kkkxsaSkZpaz4askn2rQBBKdPsjxPh0jELBIbDuIceKK1m2UA68CfSoA8Eh4i/WMe5qdqKJRmIzO7u2LlhCtYTs1sZmaPzeyNmb3XL3yaVwQYuvqKpcHxNdeN0VVYQddXdhz+++r4L4a5M9oO+MprAAAAAElFTkSuQmCC", http = "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADxElEQVR42sWXX4hVVRTGf+fOvRMmznj1VpDMpFhSQSlEVpQYKAYVZES+9lRkUJBRBIJP2ov0WPQiFZEP/YFCSAVpnhIjxJBEMrWUoklrGmUaZzz3ztfLd2C5OXfOnRFqw2Kfvdfae62119rr2yeTxP/Z6texNkvG+i8MqJkEdLrwZky9edFjCGr2uJPMDfp7AsgTHr0Y0ssJ9AXFq4DNwDp/Nz1/GTgDHAa+BL4vWVveJM1Gfe6XS9ojaULV7aqkTyXdm+xRSrMpr7t/RtKFoGDCSiRpp6RtknLT5URua5URVcpfDRtOSnpd0tse7wvy73juY0nPS7oY1u1O9qw0oLB2szfoSPpW0h2ePyFpRtKDYc2QpClJYx7fJOmAT0WSXu52EuktKK7YMuAHYJHnTgC/Ai3gPsscAdph7QNAv9eN+obc7ySU+ce8X6dbEhYWfmDLc3s1Za9jouWS2oGmg0zHMmMhX0a8d61bCArGSklXvOgtSU1Jt0gaCIa9J2lQ0hLTgKTt5h2StEhSy2u3BsMfSUNRlnhvWHjciqPMiHkveZwF3pPmnUrm+yWdNe/dNCFrJbX8YX9/DfyRlI2b3f9VUlLG3LeAgZBTV12cANa675RVwo4r1yqX3VPAEsvkTsiWZaddBftsbKz/A8BK4GcnZe4qCbACWGoHMkDFLci8URM4bcX/AFMJ+jXdX0puQOFtUZrHkxLcbwcE3AX8WABXvQRii7AsNJW1wQr8WDwLhGdlYKQAKn96g/eBjwKgLPR4MfBauNMyDQEfOhTPAb95/zawCXjTJ/d31FlPjrDtENxuxSOJB7/bgNMlvDXBic+S8D3q/hxwIRpQK8HwI+4fdy40gBvcj5s35PECUwMYNu+SjW849v3As1Z41H09VRofD5/7JFo+ytxZnwPHLTPs8RVT7vINcNIJnPsKPuHEy4BP0udbigVFvL8AnrI3R+0FwG32fhT4KSSUbNQwcNFXuOYw3GNnjhkbrnkpdQOjO/2qaVhJ7lNphONrd3ldte3EjMMj77HBxa1vNjCKdfoFl89pw/Hdkm6UdM6gs8m1vilptQFrUtKthuf9XitJu7rBcdWDZHcAkl8kPR3m9gT5HZ7bK2mjpONh3d6gPJvLk6yw9pXgiSSNGoo7kl6UtMWet82LbVdA2myub8JoxFpJB9V7+0bSY1XKy15EVc/y9cAW4CFgues7wCRwHvjOReirXp/lc/kxUfL7tTSg43gJdFf/E8zBgLhpVnIFI59eFM/XgG7Ipvn+oF7P37Hm+0cc279F8VyWeAZB0wAAAABJRU5ErkJggg==" } pcall(function() assert(writefile and isfile and getcustomasset) ensure_folder() if makefolder and isfolder and not isfolder(folder .. "/icons") then makefolder(folder .. "/icons") end for Name, Data in UI.generated_icons do if not kind_icons[Name] then local path = folder .. "/icons/gen_" .. Name .. ".png" if not isfile(path) then writefile(path, UI.base64(Data)) end kind_icons[Name] = getcustomasset(path) end end end) kind_icons.loghistory = kind_icons.loghistory or kind_icons.require UI.titles = UI.titles or { } UI.check_rows = UI.check_rows or { } UI.duals = UI.duals or { } UI.classic_only = UI.classic_only or { } local Lib = (UI.assets or assert(loadstring(assert(http_get("https://raw.githubusercontent.com/nfpw/LarpSpy/main/uiassets.lua"), "couldn't download uiassets.lua"), "uiassets"))())({ t = T, ui = UI, connect = Connect, tween_service = __R.TweenService, accented = __R.Accented, font = function() return font_face, font_size, pixel end, bold = function() return UI.bold_face end, }) local Accent, New, Text, Tween, Esc, Glow, Panel, Input, Button, HorizontalList, Stroke = Lib.accent, Lib.new, Lib.text, Lib.tween, Lib.esc, Lib.glow, Lib.panel, Lib.input, Lib.button, Lib.horizontal_list, Lib.stroke UI.Round, UI.Smooth, UI.Dual, UI.only = Lib.round, Lib.smooth, Lib.dual, Lib.only_classic local Gui = New("ScreenGui", {Name = http_service.GenerateGUID(http_service, false), ResetOnSpawn = false, IgnoreGuiInset = true, ZIndexBehavior = Enum.ZIndexBehavior.Sibling, DisplayOrder = 999998}) if syn and syn.protect_gui then pcall(syn.protect_gui, Gui) end if not (X.get_hui and pcall(function() Gui.Parent = X.get_hui() end) and Gui.Parent) then if not pcall(function() Gui.Parent = core_gui end) then Gui.Parent = players.LocalPlayer.WaitForChild(players.LocalPlayer, "PlayerGui") end end local main = New("Frame", { Parent = Gui, AnchorPoint = Vector2.new(0, 0), Position = UDim2.new(0.5, -380, 0.5, -240), Size = UDim2.new(0, 760, 0, 480), BackgroundColor3 = T.Background, BorderSizePixel = UI.classic and 2 or 0, BorderColor3 = T.Outline, }) UI.Round(main, 10) UI.Dual(Stroke(main), "Border", "Outline") UI.only(Accent(New("Frame", {Parent = main, Size = UDim2.new(1, 0, 0, 1), BorderSizePixel = 0, ZIndex = 2}), "BackgroundColor3")) UI.only(Glow(main, 20, 0.55)) UI.title_bar = New("Frame", {Parent = main, Size = UDim2.new(1, 0, 0, UI.classic and 24 or 34), BackgroundTransparency = 1, Active = true}) UI.title_text = Text(UI.title_bar, {Position = UDim2.new(0, 8, 0, 0), Size = UDim2.new(0, 130, 1, 0), RichText = true, TextSize = UI.classic and font_size or 15, FontFace = UI.bold_face}) __R.draw_title() local tabs = New("Frame", {Parent = UI.title_bar, Position = UDim2.new(0, UI.classic and 140 or 120, 0, UI.classic and 4 or 6), Size = UDim2.new(0, 520, 0, UI.classic and 16 or 22), BackgroundTransparency = 1}) HorizontalList(tabs, 4) local status = Text(UI.title_bar, {AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, UI.classic and -52 or -66, 0, 0), Size = UDim2.new(0, 280, 1, 0), TextXAlignment = Enum.TextXAlignment.Right, TextColor3 = T.Dim, Text = hook_status}) UI.tabs_compact = false UI.tab_full_text = { } UI.fit_status = function() local layout = tabs.FindFirstChildOfClass(tabs, "UIListLayout") local used = layout and layout.AbsoluteContentSize.X or 0 local right = -status.Position.X.Offset -- too narrow for the tab names: show only the icons so the tabs never run into the minimize / close buttons if not UI.tabs_compact then UI.tabs_full = used end local available = UI.title_bar.AbsoluteSize.X - tabs.Position.X.Offset - right - 8 local want_compact = (not UI.classic) and available > 0 and (UI.tabs_full or used) > available if want_compact ~= UI.tabs_compact and UI.tab_buttons then UI.tabs_compact = want_compact for Name, object in UI.tab_buttons do local pad = object.FindFirstChildOfClass(object, "UIPadding") if object.FindFirstChild(object, "TabIcon") then if want_compact then UI.tab_full_text[Name] = UI.tab_full_text[Name] or object.Text object.Text = "" object.AutomaticSize = Enum.AutomaticSize.None object.Size = UDim2.new(0, 30, 1, 0) if pad then pad.PaddingLeft, pad.PaddingRight = UDim.new(0, 0), UDim.new(0, 0) end local icon = object.FindFirstChild(object, "TabIcon") icon.AnchorPoint = Vector2.new(0.5, 0.5) icon.Position = UDim2.new(0.5, 0, 0.5, 0) else object.Text = UI.tab_full_text[Name] or object.Text object.AutomaticSize = Enum.AutomaticSize.X object.Size = UDim2.new(0, 0, 1, 0) if pad then pad.PaddingLeft, pad.PaddingRight = UDim.new(0, 26), UDim.new(0, 12) end local icon = object.FindFirstChild(object, "TabIcon") icon.AnchorPoint = Vector2.new(0, 0) icon.Position = UDim2.new(0, -15, 0.5, -6) end end end return end tabs.Size = UDim2.new(0, used, 0, tabs.Size.Y.Offset) status.Size = UDim2.new(1, -(tabs.Position.X.Offset + used + 16 + right), 1, 0) status.ClipsDescendants = true status.TextTruncate = Enum.TextTruncate.AtEnd local free = UI.title_bar.AbsoluteSize.X - (tabs.Position.X.Offset + used + 16 + right) status.Visible = free > 60 end do local layout = tabs.FindFirstChildOfClass(tabs, "UIListLayout") if layout then local size_changed = layout.GetPropertyChangedSignal(layout, "AbsoluteContentSize") size_changed.Connect(size_changed, UI.fit_status) end end UI.fit_status() do local bar_changed = UI.title_bar.GetPropertyChangedSignal(UI.title_bar, "AbsoluteSize") bar_changed.Connect(bar_changed, UI.fit_status) end local function set_status(Message) if not pcall(function() status.Text = Message end) then pending_status = Message end end run_service.Heartbeat.Connect(run_service.Heartbeat, function() if pending_status ~= nil then local Message = pending_status pending_status = nil pcall(function() status.Text = Message end) end end) shared.notify = set_status local inner = New("Frame", {Parent = main, Position = UDim2.new(0, UI.classic and 6 or 8, 0, UI.classic and 24 or 34), Size = UDim2.new(1, UI.classic and -12 or -16, 1, UI.classic and -30 or -42), BackgroundColor3 = T.Page, BorderSizePixel = UI.classic and 2 or 0, BorderColor3 = T.Border}) UI.Round(inner, 8) UI.Dual(Stroke(inner), "Outline", "Border") UI.close_button = Text(UI.title_bar, {AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -6, 0.5, 0), Size = UDim2.new(0, UI.classic and 18 or 24, 0, UI.classic and 18 or 24), TextSize = UI.classic and font_size or 16, Text = UI.classic and "x" or "×", TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = T.Dim}, "TextButton") UI.minimize_button = Text(UI.title_bar, {AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, UI.classic and -26 or -34, 0.5, 0), Size = UDim2.new(0, UI.classic and 18 or 24, 0, UI.classic and 18 or 24), TextSize = UI.classic and font_size or 16, Text = UI.classic and "-" or "–", TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = T.Dim}, "TextButton") for _, object in {UI.close_button, UI.minimize_button} do Connect(object.MouseEnter, function() Tween(object, {TextColor3 = T.Accent}) end) Connect(object.MouseLeave, function() Tween(object, {TextColor3 = T.Dim}) end) end local full_size = main.Size Connect(UI.minimize_button.MouseButton1Click, function() minimized = not minimized inner.Visible = not minimized if minimized then full_size = main.Size main.Size = UDim2.new(0, full_size.X.Offset, 0, UI.classic and 24 or 34) else main.Size = full_size end end) Connect(UI.close_button.MouseButton1Click, function() destroy() end) do local dragging, drag_start, start_position local resizing, resize_start, start_size, resize_x, resize_y, resize_pos Connect(UI.title_bar.InputBegan, function(input_object) if input_object.UserInputType == Enum.UserInputType.MouseButton1 or input_object.UserInputType == Enum.UserInputType.Touch then dragging, drag_start, start_position = true, input_object.Position, main.Position end end) local resizer = New("TextButton", {Parent = main, AnchorPoint = Vector2.new(1, 1), Position = UDim2.new(1, 0, 1, 0), Size = UDim2.new(0, 18, 0, 18), BackgroundTransparency = 1, Text = "", ZIndex = 10}) New("Frame", {Parent = resizer, AnchorPoint = Vector2.new(1, 1), Position = UDim2.new(1, -2, 1, -2), Size = UDim2.new(0, 6, 0, 1), BackgroundColor3 = T.Dim, BorderSizePixel = 0}) New("Frame", {Parent = resizer, AnchorPoint = Vector2.new(1, 1), Position = UDim2.new(1, -2, 1, -2), Size = UDim2.new(0, 1, 0, 6), BackgroundColor3 = T.Dim, BorderSizePixel = 0}) local function begin_resize(input_object, X, Y) if input_object.UserInputType == Enum.UserInputType.MouseButton1 and not minimized then resizing, resize_start, start_size, resize_x, resize_y = true, input_object.Position, main.AbsoluteSize, X, Y resize_pos = main.Position end end Connect(resizer.InputBegan, function(input_object) begin_resize(input_object, 1, 1) end) for _, edge in { {Vector2.new(1, 0), UDim2.new(1, 3, 0, 20), UDim2.new(0, 7, 1, -40), 1, 0}, {Vector2.new(0, 1), UDim2.new(0, 20, 1, 3), UDim2.new(1, -40, 0, 7), 0, 1}, {Vector2.new(0, 0), UDim2.new(0, -3, 0, 20), UDim2.new(0, 7, 1, -40), -1, 0}, } do local handle = New("TextButton", {Parent = main, AnchorPoint = edge[1], Position = edge[2], Size = edge[3], BackgroundTransparency = 1, Text = "", AutoButtonColor = false, ZIndex = 10}) Connect(handle.InputBegan, function(input_object) begin_resize(input_object, edge[4], edge[5]) end) end Connect(user_input_service.InputChanged, function(input_object) if input_object.UserInputType ~= Enum.UserInputType.MouseMovement and input_object.UserInputType ~= Enum.UserInputType.Touch then return end if dragging then local delta = input_object.Position - drag_start main.Position = UDim2.new(start_position.X.Scale, start_position.X.Offset + delta.X, start_position.Y.Scale, start_position.Y.Offset + delta.Y) elseif resizing then local delta = input_object.Position - resize_start local screen = Gui.AbsoluteSize local width = math.clamp(start_size.X + resize_x * delta.X, 600, math.max(600, screen.X)) local height = math.clamp(start_size.Y + resize_y * delta.Y, 340, math.max(340, screen.Y)) main.Size = UDim2.new(0, width, 0, height) main.Position = UDim2.new(resize_pos.X.Scale, resize_pos.X.Offset + (resize_x == -1 and (start_size.X - width) or 0), resize_pos.Y.Scale, resize_pos.Y.Offset) end end) Connect(user_input_service.InputEnded, function(input_object) if input_object.UserInputType == Enum.UserInputType.MouseButton1 or input_object.UserInputType == Enum.UserInputType.Touch then dragging, resizing = false, false end end) end local quote_map = {["\n"] = "\\n", ["\r"] = "\\r", ["\t"] = "\\t", ['"'] = '\\"', ["\\"] = "\\\\"} function __R.over(object) local mouse = user_input_service.GetMouseLocation(user_input_service) local position, size = object.AbsolutePosition, object.AbsoluteSize return mouse.X >= position.X and mouse.X <= position.X + size.X and mouse.Y >= position.Y and mouse.Y <= position.Y + size.Y end local function copy(String) if X.SetClipboard then X.SetClipboard(String) set_status("copied to clipboard") else set_status("no setclipboard in this executor") end end local function name_of(object) local ok, Name = pcall(function() return object.Name end) return ok and tostring(Name) or "?" end local function class_of(object) local ok, class = pcall(function() return object.ClassName end) return ok and class or "?" end UI.looks_random = function(Name) if type(Name) ~= "string" then return false end local length = #Name if length == 0 or string.find(Name, "[%c\128-\255]") then return true end if string.match(Name, "^%x+%-%x+%-%x+%-%x+%-%x+$") then return true end if length >= 8 and string.match(Name, "^%x+$") and string.find(Name, "%d") and string.find(Name, "%a") then return true end if length >= 4 and string.match(Name, "^[Il1O0_]+$") and string.find(Name, "[IlO_]") then return true end if length >= 6 then local changes, previous = 0, nil for character in string.gmatch(Name, ".") do local class = (string.match(character, "%l") and 1) or (string.match(character, "%u") and 2) or (string.match(character, "%d") and 3) or nil if class and previous and class ~= previous then changes += 1 end previous = class end if changes / length > 0.45 then return true end if length >= 10 and not string.find(Name, "[^%a]") then local _, vowels = string.gsub(string.lower(Name), "[aeiou]", "") if vowels / length < 0.18 then return true end end end return false end UI.track_remote = function(remote, fresh) if typeof(remote) ~= "Instance" then return nil end local existing = UI.remotes[remote] if existing then return existing end if not UI.remote_classes[class_of(remote)] then return nil end local Name = name_of(remote) local Info = {Original = Name, Names = {Name}, Renames = 0, Born = fresh and os.clock() or nil} UI.remotes[remote] = Info if Settings.TrackRenames then local ok, signal = pcall(function() return remote.GetPropertyChangedSignal(remote, "Name") end) if ok and signal then Connect(signal, function() if not Settings.TrackRenames then return end local Now = name_of(remote) if Now == Info.Names[#Info.Names] or (Info.Overwritten and Now == Info.Beauty) or Now == Info.Before then return end Info.Overwritten = nil Info.Renames += 1 if Info.Born and os.clock() - Info.Born <= UI.creation_window then Info.OnCreate = true else Info.Later = true end table.insert(Info.Names, Now) if #Info.Names > 6 then table.remove(Info.Names, 2) end end) end end return Info end UI.unstable_name = function(remote, Info) Info = Info or UI.remotes[remote] if not Info then return false end if Info.Renames > 0 or Info.Overwritten then return true end local Name = name_of(remote) if Info.CheckedName ~= Name then Info.CheckedName = Name Info.CheckedRandom = UI.looks_random(Name) end return Info.CheckedRandom end UI.beautify = function(remote, Log) if not Settings.Beautify then return nil end local Info = UI.track_remote(remote) if not Info or not UI.unstable_name(remote, Info) then return nil end if not Info.Beauty then local class = UI.remote_classes[class_of(remote)] UI.beauty_counts[class] = (UI.beauty_counts[class] or 0) + 1 local owner = Log and Log.Script and string.gsub(name_of(Log.Script), "[^%w_]", "") or "" Info.Beauty = class .. "_" .. UI.beauty_counts[class] .. (owner ~= "" and ("_" .. owner) or "") end if Settings.BeautifyRename and not Info.Overwritten then Info.Before = name_of(remote) if pcall(function() remote.Name = Info.Beauty end) then Info.Overwritten = true end end return Info.Beauty end UI.restore_names = function() for remote, Info in UI.remotes do if Info.Overwritten then Info.Overwritten = nil pcall(function() remote.Name = Info.Before or Info.Original end) end end end local function quote(String) String = tostring(String) if utf8.len(String) then return '"' .. string.gsub(String, utf8.charpattern, function(character) local code = utf8.codepoint(character) if code > 127 then return Settings.EscapeUnicode and string.format("\\u{%X}", code) or character elseif quote_map[character] then return quote_map[character] elseif code < 32 or code == 127 then return string.format("\\%03d", code) end return character end) .. '"' end return '"' .. string.gsub(String, '[%c"\\\128-\255]', function(character) return quote_map[character] or string.format("\\%03d", string.byte(character)) end) .. '"' end local function number(Value) if Value ~= Value then return "0/0" elseif Value == math.huge then return "math.huge" elseif Value == -math.huge then return "-math.huge" end return tostring(Value) end local function path_of_raw(object, context) if object == game then return "game" end if context and Settings.SmartPaths and typeof(object) == "Instance" then local smart = UI.smart_path(object, context) if smart then return smart end end local chain = { } local current = object while current and current ~= game do table.insert(chain, 1, current) local ok, Parent = pcall(function() return current.Parent end) current = ok and Parent or nil end local Style = Settings.PathStyle local function index(child) local Name = name_of(child) local ok_parent, Parent = pcall(function() return child.Parent end) if ok_parent and Parent then local ok_kids, kids = pcall(Parent.GetChildren, Parent) if ok_kids then local same = 0 for _, other in kids do if name_of(other) == Name then same += 1 end end if same > 1 then local position = table.find(kids, child) if position then return ":GetChildren()[" .. position .. "]" end end end end if Style == "WaitForChild" then return ":WaitForChild(" .. quote(Name) .. ")" elseif Style == "FindFirstChild" then return ":FindFirstChild(" .. quote(Name) .. ")" elseif string.match(Name, "^[%a_][%w_]*$") then return "." .. Name elseif Style == "dot" then return "[" .. quote(Name) .. "]" end return ":FindFirstChild(" .. quote(Name) .. ")" end local function append(base, child) return base .. index(child) end local path, start = nil, 2 if current == game then local first = chain[1] local is_service = pcall(function() assert(game.FindService(game, first.ClassName) == first) end) if first == workspace then path = "workspace" elseif is_service then path = 'game:GetService("' .. first.ClassName .. '")' else path = append("game", first) end local is_local = false if first.ClassName == "Players" and chain[2] then pcall(function() is_local = chain[2].ClassName == "Player" and chain[2].UserId == players.LocalPlayer.UserId end) end if is_local then path ..= ".LocalPlayer" start = 3 end else if context then context.NeedsNil = true end path = "getnil(" .. quote(name_of(chain[1])) .. ", " .. quote(class_of(chain[1])) .. ")" end for position = start, #chain do path = append(path, chain[position]) end return path end local function path_of(object, context) local result = path_of_raw(object, context) local ok, character = pcall(function() return players.LocalPlayer.Character end) if ok and character and typeof(object) == "Instance" and object == character then return 'game:GetService("Players").LocalPlayer.Character' end if ok and character and typeof(object) == "Instance" and object ~= character and object.IsDescendantOf(object, character) then local base = path_of_raw(character) if string.sub(result, 1, #base) == base then return 'game:GetService("Players").LocalPlayer.Character' .. string.sub(result, #base + 1) end end return result end -- debug.info(level, "s") gives a script's full name ("ReplicatedStorage.Modules.Foo"); turn that back into the instance __R.resolve_source = function(source) if type(source) ~= "string" or source == "" then return nil end local first = string.sub(source, 1, 1) if first == "[" or first == "=" or first == "@" then return nil end local current = game local text = string.gsub(source, "^game%.", "") for part in string.gmatch(text, "[^%.]+") do local ok, nxt = pcall(function() return current.FindFirstChild(current, part) end) if not ok or not nxt then return nil end current = nxt end return current ~= game and current or nil end UI.frame_path = function(source) local instance = __R.resolve_source(source) if instance then local ok, path = pcall(path_of, instance) if ok and path then return path end end return tostring(source) end local menu = New("ScrollingFrame", { Parent = Gui, Visible = false, BackgroundColor3 = T.Inline, BorderSizePixel = UI.classic and 2 or 0, BorderColor3 = T.Outline, ScrollBarThickness = 2, CanvasSize = UDim2.new(0, 0, 0, 0), AutomaticCanvasSize = Enum.AutomaticSize.Y, ScrollingDirection = Enum.ScrollingDirection.Y, ZIndex = 50, }) Accent(menu, "ScrollBarImageColor3") UI.Dual(Stroke(menu), "Border", "Outline") New("UIListLayout", {Parent = menu, SortOrder = Enum.SortOrder.LayoutOrder}) UI.menu_frame = menu local function close_menu() menu.Visible = false end local function open_menu(options, width, anchor) for _, child in menu.GetChildren(menu) do if child.IsA(child, "GuiObject") then child.Destroy(child) end end for index, option in options do local row = Text(menu, {LayoutOrder = index, Size = UDim2.new(1, 0, 0, 18), BackgroundColor3 = T.Hover, Text = " " .. option[1], TextColor3 = option[3] or T.Text, ZIndex = 51}, "TextButton") Connect(row.MouseEnter, function() row.BackgroundTransparency = 0.4 end) Connect(row.MouseLeave, function() row.BackgroundTransparency = 1 end) Connect(row.MouseButton1Click, function() close_menu() task.spawn(option[2]) end) end width = width or 150 local mouse = user_input_service.GetMouseLocation(user_input_service) local height = math.min(#options * 18 + 2, 260) local screen = Gui.AbsoluteSize menu.Size = UDim2.new(0, width, 0, height) if anchor then local below = anchor.AbsolutePosition.Y + anchor.AbsoluteSize.Y + 2 local Y = below + height > screen.Y and (anchor.AbsolutePosition.Y - height - 2) or below menu.Position = UDim2.new(0, math.min(anchor.AbsolutePosition.X, screen.X - width - 4), 0, math.max(0, Y)) else menu.Position = UDim2.new(0, math.min(mouse.X, screen.X - width - 4), 0, math.min(mouse.Y, screen.Y - height - 4)) end menu.Visible = true end Connect(user_input_service.InputBegan, function(input_object) if menu.Visible and (input_object.UserInputType == Enum.UserInputType.MouseButton1 or input_object.UserInputType == Enum.UserInputType.MouseButton2) and not __R.over(menu) then close_menu() end end) UI.open_menu, UI.copy_text = open_menu, copy UI.remote_classes = {RemoteEvent = "Event", RemoteFunction = "Function", UnreliableRemoteEvent = "Unreliable"} UI.remotes = setmetatable({ }, {__mode = "k"}) UI.beauty_counts = { } UI.creation_window = 2 local serialize local banner = "-- generated by Larp Spy" UI.rename_comment = function(Log) if typeof(Log.Remote) ~= "Instance" then return nil end local Info = UI.remotes[Log.Remote] if not Info or not UI.unstable_name(Log.Remote, Info) then return nil end local lines = { } local function short(Name) return string.gsub(quote(#Name > 40 and (string.sub(Name, 1, 40) .. "...") or Name), "%]%]", "] ]") end if Info.Renames > 0 then local when = (Info.OnCreate and Info.Later and "on creation and later") or (Info.OnCreate and "on creation") or "later" local chain = { } for _, Name in Info.Names do table.insert(chain, (short(Name))) end table.insert(lines, "-- remote renamed by the game (" .. when .. ", " .. Info.Renames .. "x): " .. table.concat(chain, " -> ")) else table.insert(lines, "-- remote with a random looking name " .. (short(Info.Original))) end if Info.Beauty then table.insert(lines, "-- readable name: " .. Info.Beauty .. (Settings.SmartPaths and " (the code below finds it even when the name changes)" or "")) end return lines end function __R.serialize_table(Value, depth, seen, context) if seen[Value] then return "{} --[[ cycle ]]" end if depth > 25 then return "{} --[[ too deep ]]" end seen[Value] = true local indent = string.rep(" ", depth + 1) local lines = { } local length = rawlen(Value) local count = 0 for index = 1, length do count += 1 if count > 1000 then table.insert(lines, indent .. "-- ...") break end table.insert(lines, indent .. serialize(rawget(Value, index), depth + 1, seen, context) .. ",") end local keys = { } for key in next, Value do if not (type(key) == "number" and key >= 1 and key <= length and key % 1 == 0) then table.insert(keys, key) end end table.sort(keys, function(A, B) if type(A) == type(B) and (type(A) == "number" or type(A) == "string") then return A < B end return type(A) < type(B) end) for _, key in keys do count += 1 if count > 1000 then table.insert(lines, indent .. "-- ...") break end local key_text if type(key) == "string" and string.match(key, "^[%a_][%w_]*$") then key_text = key else key_text = "[" .. serialize(key, depth + 1, seen, context) .. "]" end table.insert(lines, indent .. key_text .. " = " .. serialize(Value[key], depth + 1, seen, context) .. ",") end seen[Value] = nil if #lines == 0 then return "{}" end return "{\n" .. table.concat(lines, "\n") .. "\n" .. string.rep(" ", depth) .. "}" end local function list(values) local out = { } for _, Value in values do table.insert(out, number(Value)) end return table.concat(out, ", ") end local function display_name(Log) if Log.Kind == "http" then return Log.Label or "http" end if Log.Kind == "debuginfo" then return Log.Label and ("debug.info " .. Log.Label) or "debug.info" end if Log.Signal then local base = Log.Owner and (name_of(Log.Owner) .. "." .. Log.EventName) or Log.EventName if Log.Kind == "connection" then local where = (Log.Script and name_of(Log.Script)) or (Log.Info and string.match(tostring(Log.Info.Source), "[^%.]+$")) or "?" base ..= " <- " .. where .. (Log.Info and (":" .. tostring(Log.Info.Line)) or "") end return base end if Log.Kind == "create" or Log.Kind == "lib" or Log.Kind == "wait" or Log.Kind == "raknet" then return tostring(Log.Remote) end if Log.Kind == "logservice" then local line = (string.gsub(tostring(Log.Remote), "%s+", " ")) local length = utf8.len(line) if length and length > 160 then line = string.sub(line, 1, utf8.offset(line, 161) - 1) .. "..." elseif not length and #line > 160 then line = string.sub(line, 1, 160) .. "..." end return ((Log.Method == "Warning" or Log.Method == "Error") and ("[" .. string.lower(Log.Method) .. "] ") or "") .. line end if typeof(Log.Remote) ~= "Instance" then return "asset " .. tostring(Log.Remote) end local Name = name_of(Log.Remote) if Name == "" then Name = "(empty)" end local pretty = UI.beautify(Log.Remote, Log) if pretty then return pretty end return Log.Dup and (Name .. " " .. Log.Dup) or Name end function __R.dup_tag(remote) local ok, tag = pcall(function() local Name, Parent = remote.Name, remote.Parent local same, mine = 0, 0 for _, other in Parent.GetChildren(Parent) do if other.Name == Name then same += 1 if other == remote then mine = same end end end return same > 1 and mine > 0 and ("#" .. mine) or nil end) return ok and tag or nil end function __R.display_class(Log) if Log.Kind == "http" then return Log.Executor and "http (executor)" or "http (game)" end if Log.Kind == "debuginfo" then return "function" end if Log.Signal then return Log.Owner and (class_of(Log.Owner) .. " signal") or "signal" end if Log.Kind == "raknet" then return "RakNet packet" end if Log.Kind == "create" or Log.Kind == "lib" or Log.Kind == "wait" then return "function" end if Log.Kind == "logservice" then return "LogService " .. string.lower(tostring(Log.Method)) end if typeof(Log.Remote) ~= "Instance" then return "asset id" end return class_of(Log.Remote) end local function display_path(Log, context) if Log.Kind == "http" then return Log.Url or "http" end if Log.Kind == "debuginfo" then return "debug.info" end if Log.Signal then if Log.Owner then return path_of(Log.Owner, context) .. "." .. Log.EventName end return "signal --[[ " .. tostring(Log.Signal) .. ": owner not found ]]" end if Log.Kind == "logservice" then return 'game:GetService("LogService").MessageOut' end if typeof(Log.Remote) ~= "Instance" then return tostring(Log.Remote) end return path_of(Log.Remote, context) end local function arg_code(Log, index, depth, context) if index == 1 and Log.Kind == "purchase" and type(Log.Args[1]) == "number" and players.LocalPlayer and Log.Args[1] == players.LocalPlayer.UserId then return 'game:GetService("Players").LocalPlayer.UserId' end local dyn = Settings.AutoFill and Log.Args.Dyn if dyn and dyn[index] and __R.dyn_code[dyn[index]] then return __R.dyn_code[dyn[index]] end return serialize(Log.Args[index], depth, nil, context) end local function resolve(Log) local args = Log.Args local dyn = Settings.AutoFill and args.Dyn if not dyn then return args end local copy = { } for index = 1, Log.Count do copy[index] = args[index] for _, kind in __R.dyn_kinds do if dyn[index] == kind[1] then local ok, Now = pcall(kind[2]) if ok then copy[index] = Now end end end end return copy end local function indent(code) return " " .. (string.gsub(code, "\n", "\n ")) end UI.tidy = function(code) local services = { } local seen = { } local function use(Name) if not seen[Name] then seen[Name] = true table.insert(services, Name) end end local code, characters = string.gsub(code, 'game:GetService%("Players"%)%.LocalPlayer%.Character', "character") local code, players = string.gsub(code, 'game:GetService%("Players"%)%.LocalPlayer', "lp") code = string.gsub(code, 'game:GetService%("([%w_]+)"%)', function(Name) use(Name) return (Name == "MarketplaceService" and "market_place" or string.lower(string.gsub(Name, "(%l)(%u)", "%1_%2"))) end) local need_lp = characters > 0 or players > 0 if need_lp then use("Players") end if #services == 0 then return code end table.sort(services, function(A, B) if A == "Players" or B == "Players" then return A == "Players" and B ~= "Players" end return A < B end) local lines = {"local get_service = game.GetService"} for _, Name in services do table.insert(lines, "local " .. (Name == "MarketplaceService" and "market_place" or string.lower(string.gsub(Name, "(%l)(%u)", "%1_%2"))) .. " = get_service(game, '" .. Name .. "')") end if need_lp then table.insert(lines, "local lp = players.LocalPlayer") end if characters > 0 then table.insert(lines, "local character = lp.Character") end return table.concat(lines, "\n") .. "\n\n" .. code end UI.read_field = function(buf, Offset, Type, Len) local R = UI.buffer_read local function fmt(Value) return string.format("%.5g", Value) end if Type == "vec3" or Type == "vec2" then local count = Type == "vec3" and 3 or 2 if Offset + count * 4 > Len then return nil, "out of bytes" end local parts = { } for index = 0, count - 1 do table.insert(parts, fmt(R.readf32(buf, Offset + index * 4))) end return (Type == "vec3" and "Vector3.new(" or "Vector2.new(") .. table.concat(parts, ", ") .. ")", count * 4 elseif Type == "bool" then if Offset + 1 > Len then return nil, "out of bytes" end return tostring(R.readu8(buf, Offset) ~= 0), 1 elseif Type == "string" then if Offset + 2 > Len then return nil, "out of bytes" end local size = R.readu16(buf, Offset) if Offset + 2 + size > Len then return nil, "out of bytes" end return string.format("%q", R.readstring(buf, Offset + 2, size)), 2 + size end local field = UI.buffer_fields[Type] if not field then return nil, "unknown type " .. Type end if Offset + field[1] > Len then return nil, "out of bytes" end local Value = R[field[2]](buf, Offset) return string.find(field[2], "readf", 1, true) and fmt(Value) or tostring(Value), field[1] end UI.schema_for = function(Name) if not Name then return nil end for entry in string.gmatch(tostring(Settings.PacketSchemas), "[^;]+") do local key, rel, spec = string.match(entry, "^%s*([%w_]+)%s*=%s*(%a*)%s*:?%s*(.-)%s*$") if key == Name then return rel ~= "" and string.lower(rel) or "reliable", spec end end return nil end UI.safe_get = function(Table, key) local ok, Value = pcall(rawget, Table, key) if ok and Value ~= nil then return Value end ok, Value = pcall(function() return Table[key] end) return ok and Value or nil end UI.auto_index = function() local filter = tostring(Settings.PacketModules or "") if UI.auto_cache and UI.auto_cache.filter == filter and (#UI.auto_cache.List > 0 or os.clock() - UI.auto_cache.Time < 10) then return UI.auto_cache end local index = {List = { }, ById = { }, ByNum = { }, ByName = { }, filter = filter, Time = os.clock()} UI.auto_cache = index local get = getupvalues or (debug and debug.getupvalues) local names = { } pcall(function() for _, object in game.GetDescendants(game.GetService(game, "ReplicatedStorage")) do if object.IsA(object, "ModuleScript") and object.Name == "ByteNet" then for key, Value in require(object) do if type(Value) == "table" then names[Value] = tostring(key) end end break end end end) local function fields(Type) if type(Type) ~= "table" or not get then return nil end for _, fn in {Type.read, Type.write} do if type(fn) == "function" then local ok, ups = pcall(get, fn) for _, up in ok and ups or { } do if type(up) == "table" and up ~= Type and not names[up] and up.read == nil and next(up) ~= nil then local list, all = { }, true for key, Value in up do if type(key) == "string" and type(Value) == "table" and (names[Value] or Value.read) then table.insert(list, key) else all = false end end if all and #list > 0 then table.sort(list) return list, up end end end end end return nil end local function describe(Type, depth) if names[Type] then return UI.auto_names[string.lower(names[Type])] or names[Type] end if depth > 4 or type(Type) ~= "table" then return "?" end local list, up = fields(Type) if list then local parts = { } for _, key in list do table.insert(parts, key .. ": " .. describe(up[key], depth + 1)) end return "{" .. table.concat(parts, ", ") .. "}" end for _, fn in {Type.read, Type.write} do if type(fn) == "function" and get then local ok, ups = pcall(get, fn) for _, up in ok and ups or { } do if type(up) == "table" and up ~= Type and (names[up] or up.read) then return "wrapper<" .. describe(up, depth + 1) .. ">" end end end end local keys = { } for key in Type do if #keys < 6 then table.insert(keys, tostring(key)) end end return "?{" .. table.concat(keys, ",") .. "}" end local function balanced(Text, from) local open = string.find(Text, "[%(%{]", from) if not open or open - from > 80 then return nil end local depth = 0 for position = open, math.min(#Text, open + 3000) do local Char = string.sub(Text, position, position) if Char == "(" or Char == "{" then depth += 1 elseif Char == ")" or Char == "}" then depth -= 1 if depth == 0 then return string.sub(Text, open, position) end end end return nil end local function definition(source, Name) local start, after = string.find(source, "[%s,{%.]" .. string.gsub(Name, "%p", "%%%0") .. "%s*=%s*[^=]") after = after and after - 1 if not start then start, after = string.find(source, "%[%s*[\"']" .. string.gsub(Name, "%p", "%%%0") .. "[\"']%s*%]%s*=%s*") end return start and balanced(source, after + 1) or nil end local function resolve_type(source, word) local Lower = string.lower(word) if UI.auto_names[Lower] or Lower == "nothing" then return UI.auto_names[Lower] or Lower end local alias = string.match(source, "local%s+" .. word .. "%s*=%s*[%w_]+%.([%a][%w]*)") if alias then return UI.auto_names[string.lower(alias)] or string.lower(alias) end return word end local function table_fields(source, var) local list, seen = { }, { } local function add(key, expr) local word = string.match(expr, "([%a][%w]*)$") if word and not seen[key] then seen[key] = true table.insert(list, {key, resolve_type(source, word)}) end end local body = string.match(source, "local%s+" .. var .. "%s*=%s*(%b{})") if body and not string.find(string.sub(body, 2, -2), "{", 1, true) then for key, expr in string.gmatch(string.sub(body, 2, -2), "([%w_]+)%s*=%s*([%w_%.]+)") do add(key, expr) end end for key, expr in string.gmatch(source, var .. "%.([%w_]+)%s*=%s*([%w_%.]+)") do add(key, expr) end table.sort(list, function(A, B) return A[1] < B[1] end) return list end local function parse_args(definition, source) local Value = string.find(definition, "value%s*=") if not Value then return { }, true end local fn, var = string.match(definition, "value%s*=%s*([%w_%.]+)%s*%(%s*([%w_]+)%s*%)") if fn then local fn_name = string.match(fn, "([%a][%w]*)$") local real = fn_name == "struct" and "struct" or string.match(source, "local%s+" .. fn_name .. "%s*=%s*[%w_]+%.([%a][%w]*)") if real == "struct" then local list = table_fields(source, var) if #list > 0 then return list, true end end return nil end local word = string.match(definition, "value%s*=%s*([%w_%.]+)%s*[,}]") if word then local Type = resolve_type(source, string.match(word, "([%a][%w]*)$") or word) if Type == "nothing" then return { }, true end return {{"value", Type}}, true end local body = string.match(definition, "value%s*=%s*[%w_%.]-struct%s*%(?%s*(%b{})") local list = { } if body then local inner = string.sub(body, 2, -2) if string.find(inner, "[%(%{]") then return nil end for key, Type in string.gmatch(inner, "([%w_]+)%s*=%s*[%w_%.]-([%a][%w]*)%s*[,;\n]") do table.insert(list, {key, Type}) end local last = string.match(inner, "([%w_]+)%s*=%s*[%w_%.]-([%a][%w]*)%s*$") if last then table.insert(list, {last, string.match(inner, "[%w_%.]-([%a][%w]*)%s*$")}) end local seen, unique = { }, { } for _, item in list do if not seen[item[1]] then seen[item[1]] = true table.insert(unique, item) end end list = unique table.sort(list, function(A, B) return A[1] < B[1] end) return list, true end local single = string.match(definition, "value%s*=%s*[%w_%.]-([%a][%w]*)%s*[,}%)]") if single and not string.match(definition, "value%s*=%s*[%w_%.]-[%a][%w]*%s*%(") then return {{"value", single}}, true end return nil end local get_consts = getconstants or (debug and debug.getconstants) local leaves = {{"writef64", "f64"}, {"writef32", "f32"}, {"writei32", "i32"}, {"writeu32", "u32"}, {"writei16", "i16"}, {"writeu16", "u16"}, {"writei8", "i8"}, {"writeu8", "u8"}} local function consts(fn) local set, list = { }, { } local ok, found = pcall(get_consts or function() return { } end, fn) for _, Value in ok and type(found) == "table" and found or { } do if type(Value) == "string" then set[Value] = true table.insert(list, Value) end end return set, list end local function leaf(item) if type(item) == "table" then item = item.write or item.read end if type(item) ~= "function" then return nil end local set = consts(item) if set.writestring or set.readstring then return "string" end if set.Vector3 or (set.X and set.Y and set.Z) then return "vec3" end for _, pair in leaves do if set[pair[1]] or set["read" .. string.sub(pair[1], 6)] then return pair[2] end end return nil end local function struct_of(Table) local keys = { } for key in Table do if type(key) ~= "string" then return nil end table.insert(keys, key) end if #keys == 0 then return nil end table.sort(keys) local out = { } for _, key in keys do local Type = leaf(Table[key]) if not Type then return nil end table.insert(out, {key, Type}) end return out end local function paired_of(ups) for _, names in ups do if type(names) == "table" and #names > 0 then local all_strings = true for _, Name in names do all_strings = all_strings and type(Name) == "string" end if all_strings then for _, types in ups do if types ~= names and type(types) == "table" and #types == #names then local out = { } for index, Name in names do local Type = leaf(types[index]) if not Type then out = nil break end table.insert(out, {Name, Type}) end if out then return out end end end end end end return nil end local function probe(packet) if not get then return nil, "getupvalues is not available" end local seen, queue, head, fallback = { }, { }, 1, nil local Info = { } for _, fn in {UI.safe_get(packet, "send"), UI.safe_get(packet, "reader"), UI.safe_get(packet, "listen")} do if type(fn) == "function" then table.insert(queue, {fn, 1}) end end while queue[head] do local fn, depth = queue[head][1], queue[head][2] head += 1 if not seen[fn] then seen[fn] = true local ok, ups = pcall(get, fn) ups = ok and ups or { } local found = paired_of(ups) if found then return found end for index, up in ups do if #Info < 8 and head <= 4 then local keys = { } if type(up) == "table" then for key in up do if #keys < 5 then table.insert(keys, tostring(key)) end end elseif type(up) == "function" then local _, constants = consts(up) for position = 1, math.min(5, #constants) do table.insert(keys, constants[position]) end end table.insert(Info, "[" .. index .. "]" .. type(up) .. "{" .. table.concat(keys, ",") .. "}") end if type(up) == "table" then if up.write or up.read then local inner = up.write or up.read if type(inner) == "function" then local ok_in, inner_ups = pcall(get, inner) local struct = ok_in and paired_of(inner_ups) if struct then return struct end for _, inner_up in ok_in and inner_ups or { } do if type(inner_up) == "table" and not inner_up.write and not inner_up.read then local fields = struct_of(inner_up) if fields then return fields end end end fallback = fallback or leaf(up) and {{"value", leaf(up)}} end else local fields = struct_of(up) if fields then return fields end end elseif type(up) == "function" and depth < 4 then table.insert(queue, {up, depth + 1}) end end end end return fallback, "upvalues of send: " .. table.concat(Info, " ") end local function is_type(Value) return type(Value) == "table" and (names[Value] ~= nil or Value.read ~= nil or Value.write ~= nil) end local function find_type(packet) if packet.value ~= nil then return packet.value end for _, field in packet do if is_type(field) then return field end end local sources = {packet} local meta = getmetatable(packet) if type(meta) == "table" and type(meta.__index) == "table" then table.insert(sources, meta.__index) end if get then for _, source in sources do for _, field in source do if type(field) == "function" then local ok_up, ups = pcall(get, field) for _, up in ok_up and ups or { } do if is_type(up) then return up end end end end end end return nil end for _, object in game.GetDescendants(game.GetService(game, "ReplicatedStorage")) do if object.IsA(object, "ModuleScript") then local ok, path = pcall(path_of, object) path = ok and path or object.GetFullName(object) local source if Settings.AutoPackets and (filter == "" or string.find(path, filter, 1, true) or string.find(object.GetFullName(object), filter, 1, true)) and type(decompile) == "function" then local ok_source, Text = pcall(decompile, object) source = ok_source and type(Text) == "string" and Text or nil end if filter == "" or string.find(path, filter, 1, true) or string.find(object.GetFullName(object), filter, 1, true) then local loaded, result = pcall(require, object) if loaded and type(result) == "table" then local Packets = type(result.packets) == "table" and result.packets or result local pairs = { } for Name, packet in Packets do table.insert(pairs, {Name, packet}) end if type(result.queries) == "table" and result.queries ~= Packets then for Name, packet in result.queries do table.insert(pairs, {Name, packet, true}) end end for _, pair in pairs do local Name, packet = pair[1], pair[2] if type(packet) == "table" and (UI.safe_get(packet, "reliabilityType") ~= nil or UI.safe_get(packet, "id") ~= nil or UI.safe_get(packet, "send") ~= nil or UI.safe_get(packet, "invoke") ~= nil or UI.safe_get(packet, "value") ~= nil) then local entry = {Name = tostring(Name), Query = pair[3] == true, Path = path, Rel = string.lower(tostring(UI.safe_get(packet, "reliabilityType") or "reliable")), Id = tonumber(UI.safe_get(packet, "id") or UI.safe_get(packet, "packetId") or UI.safe_get(packet, "Id")), Args = { }} local Value, simple, size = find_type(packet), true, 0 if not entry.Id and get and type(UI.safe_get(packet, "send")) == "function" then local ok_send, send_ups = pcall(get, UI.safe_get(packet, "send")) for _, up in ok_send and send_ups or { } do if type(up) == "number" and up >= 0 and up < 256 and up == math.floor(up) then entry.Id = up break end end end entry.Type = Value entry.Packet = packet entry.Via = (type(result.packets) == "table" and result.packets[Name] == packet and "packets") or (type(result.queries) == "table" and result.queries[Name] == packet and "queries") or nil if Value == nil and source then local def = definition(source, entry.Name) if def then entry.Known = true entry.Def = string.sub((string.gsub(def, "%s+", " ")), 1, 400) local parsed = parse_args(def, source) if parsed then for _, arg in parsed do table.insert(entry.Args, {arg[1], UI.auto_names[string.lower(arg[2])] or arg[2]}) end end end end if Value == nil and source and not entry.Def then local where = string.find(source, entry.Name, 1, true) entry.SourceInfo = "(no definition of " .. entry.Name .. " found in the decompiled source, " .. #source .. " chars" .. (where and (", first mention: " .. string.gsub(string.sub(source, math.max(1, where - 30), where + 160), "%s+", " ")) or ", name not in the source") .. ")" elseif not source then entry.SourceInfo = "(decompile unavailable or failed for this module)" end if Value == nil and #entry.Args == 0 and not entry.Def and type(UI.safe_get(packet, "send")) == "function" then local found, why = probe(packet) if found then entry.Args, entry.Known, entry.Probed = found, true, true entry.SourceInfo = nil else entry.SourceInfo = (entry.SourceInfo and (entry.SourceInfo .. " ") or "") .. "(" .. tostring(why) .. ")" end end entry.Known = entry.Known or Value ~= nil entry.HasSource = source ~= nil entry.Nums, entry.Raw = { }, { } for key, field in packet do table.insert(entry.Raw, tostring(key) .. ":" .. (type(field) == "number" and tostring(field) or type(field))) if type(field) == "number" and string.find(string.lower(tostring(key)), "id") and not entry.Id then entry.Id = field elseif type(field) == "function" and get then local ok_up, ups = pcall(get, field) for _, up in ok_up and ups or { } do if type(up) == "number" and up >= 0 and up < 256 and up == math.floor(up) then entry.Nums[up] = true end end end end if Value ~= nil then local list, up = fields(Value) if list then for _, key in list do table.insert(entry.Args, {key, describe(up[key], 1)}) end else table.insert(entry.Args, {"value", describe(Value, 1)}) end end local spec = { } for _, arg in entry.Args do simple = simple and (UI.auto_sizes[arg[2]] ~= nil or arg[2] == "string") size += UI.auto_sizes[arg[2]] or 0 table.insert(spec, arg[1] .. "=" .. arg[2]) end entry.Spec = simple and entry.Known and table.concat(spec, ",") or nil entry.Fixed = simple and entry.Known and size or nil for _, arg in entry.Args do if arg[2] == "string" then entry.Fixed = nil end end table.insert(index.List, entry) index.ByName[entry.Name] = index.ByName[entry.Name] or entry if entry.Id then index.ById[entry.Id] = entry else for number in entry.Nums do index.ByNum[number] = index.ByNum[number] or { } table.insert(index.ByNum[number], entry) end end end end end end end end return index end UI.auto_entry = function(Id, Name, avail) local ok, index = pcall(UI.auto_index) if not ok then return nil end local candidates = { } if Id and index.ById[Id] then return index.ById[Id] end for _, entry in Id and index.ByNum[Id] or { } do table.insert(candidates, entry) end local best, score = nil, -1 for _, entry in candidates do local points = 1 if entry.Known then points = 2 if entry.Fixed and avail then if entry.Fixed == avail then points = 5 elseif entry.Fixed == 0 then points = 1 elseif entry.Fixed < avail then points = 3 else points = 0 end end else points = 1.5 end if points > score then best, score = entry, points end end if best then return best end return Name and index.ByName[Name] or nil end UI.read_spec = function(buf, Offset, entry, Len) local parts, used = { }, 0 for _, arg in entry.Args do local Text, size = UI.read_field(buf, Offset + used, arg[2], Len) if not Text then return nil end used += size table.insert(parts, {arg[1], Text}) end return parts, used end UI.member = function(Name) if string.match(Name, "^[%a_][%w_]*$") and not UI.keywords[Name] then return "." .. Name end return "[" .. string.format("%q", Name) .. "]" end UI.dot_syntax = function(code) code = string.gsub(code, "([{,%s])%[\"([%a_][%w_]*)\"%]%s*=", function(before, Name) return UI.keywords[Name] and (before .. "[\"" .. Name .. "\"] =") or (before .. Name .. " =") end) code = string.gsub(code, "([%w_%)%]])%[\"([%a_][%w_]*)\"%]", function(before, Name) return UI.keywords[Name] and (before .. "[\"" .. Name .. "\"]") or (before .. "." .. Name) end) return code end UI.auto_lines = function(entry, prefix) local lines = {prefix .. "[" .. entry.Name .. "] (" .. entry.Rel .. ") module: " .. entry.Path} if entry.Def then table.insert(lines, prefix .. " definition: " .. entry.Def) elseif entry.SourceInfo then table.insert(lines, prefix .. " " .. entry.SourceInfo) end if #entry.Args == 0 then table.insert(lines, prefix .. " " .. (entry.Known and (entry.Def and not string.find(entry.Def, "value%s*=") and "(no arguments)" or entry.Def and ("definition: " .. entry.Def) or "(no arguments)") or "(arguments unknown)")) end for _, arg in entry.Args do table.insert(lines, prefix .. " " .. arg[1] .. ": " .. arg[2]) end return lines end UI.find_layout = function(Id, avail) for entry in string.gmatch(tostring(Settings.BufferLayouts), "[^;]+") do local key, Name, spec = string.match(entry, "^%s*([%d%*]+)%s*=?%s*([%w_]*)%s*:%s*(.-)%s*$") if key and (key == "*" or tonumber(key) == Id) then Name = Name ~= "" and Name or nil if spec == "" and Name then local _, schema_spec = UI.schema_for(Name) spec = schema_spec end if spec and (spec ~= "" or (Name and UI.schema_for(Name))) then return spec, Name end end end if Settings.AutoPackets and Id then local entry = UI.auto_entry(Id, nil, avail) if entry and (entry.Spec or entry.Type) then return entry.Spec or "", entry.Name end end return nil end UI.guess_packet = function(buf, Len, position, header) local R = UI.buffer_read if header < 1 then return nil end local Id = R.readu8(buf, position) local size for Next = position + header + 1, Len - 1 do if R.readu8(buf, Next) == Id then local candidate = Next - position local same = (Len - position) % candidate == 0 for start = position, Len - 1, candidate do same = same and R.readu8(buf, start) == Id end if same then size = candidate break end end end local End = position + (size or (Len - position)) local Offset = position + header local shown, layout, fields = { }, { }, 0 while Offset < End do local done = false if End - Offset >= 8 then local Value = R.readf64(buf, Offset) if Value == Value and math.abs(Value) >= 1e8 and math.abs(Value) <= 4e9 then table.insert(shown, string.format("f64 %.3f (a time?)", Value)) table.insert(layout, "Time=f64") Offset += 8 done = true end end if not done then fields += 1 table.insert(shown, "u8 " .. R.readu8(buf, Offset)) table.insert(layout, "Field" .. fields .. "=u8") Offset += 1 end end local lines = { "-- guess" .. (size and (": " .. size .. " bytes per packet, " .. ((Len - position) // size) .. " in this buffer") or "") .. " -> " .. table.concat(shown, ", "), "-- try layout " .. Id .. ":" .. table.concat(layout, ","), } return lines, size end UI.describe_buffer = function(buf, arg_index, reliability) local R = UI.buffer_read local Len = R.len(buf) local header = math.max(0, tonumber(Settings.BufferHeader) or 0) local lines = {string.format("-- buffer arg %d: %d bytes", arg_index, Len)} local position, guard = 0, 0 local function hex(from) local bytes = { } for index = from, math.min(Len, from + 48) - 1 do table.insert(bytes, string.format("%02x", R.readu8(buf, index))) end return table.concat(bytes, " ") .. (Len - from > 48 and " ..." or "") end while position < Len and guard < 20 do guard += 1 local Id = header > 0 and R.readu8(buf, position) or nil local layout, packet_name = UI.find_layout(Id, Len - position - header) if not layout then table.insert(lines, "-- " .. (Id and ("packet id " .. Id .. ", ") or "") .. "no layout (add " .. (Id or "*") .. ":name=type,... in settings). raw: " .. hex(position)) local ok_guess, guess, guess_size = pcall(UI.guess_packet, buf, Len, position, header) if Settings.AutoPackets then local ok_auto, index = pcall(UI.auto_index) local entry = ok_auto and Id and index.ById[Id] if Settings.PacketDump and ok_auto then table.insert(lines, "-- packet dump (" .. #index.List .. " packets):") for _, candidate in index.List do table.insert(lines, "-- " .. candidate.Name .. " (" .. candidate.Rel .. ") id=" .. tostring(candidate.Id) .. " fixed=" .. tostring(candidate.Fixed) .. " raw={" .. table.concat(candidate.Raw, ",") .. "}") for _, arg in candidate.Args do table.insert(lines, "-- " .. arg[1] .. ": " .. arg[2]) end end end if ok_auto and not entry and Id and index.ByNum[Id] then table.insert(lines, "-- module packets whose functions hold the number " .. Id .. " (probably the id):") for _, candidate in index.ByNum[Id] do for _, line in UI.auto_lines(candidate, "-- ") do table.insert(lines, line) end end elseif not ok_auto or #index.List == 0 then table.insert(lines, "-- packet modules: none found (path has to contain \"" .. tostring(Settings.PacketModules) .. "\")") elseif entry then table.insert(lines, "-- module packet:") for _, line in UI.auto_lines(entry, "-- ") do table.insert(lines, line) end else local count = 0 for _, candidate in index.List do if guess_size and candidate.Fixed and candidate.Fixed + header == guess_size and count < 6 then count += 1 if count == 1 then table.insert(lines, "-- module packets with a matching size (" .. guess_size .. " bytes, id not exposed by the module):") end for _, line in UI.auto_lines(candidate, "-- ") do table.insert(lines, line) end end end if count == 0 then table.insert(lines, "-- " .. #index.List .. " module packets known, none matches id " .. tostring(Id) .. (guess_size and (" / size " .. guess_size) or "")) end end end if ok_guess and guess then for _, line in guess do table.insert(lines, line) end end break end local schema_rel, schema_spec = UI.schema_for(packet_name) local auto = Settings.AutoPackets and Id and UI.auto_entry(Id, packet_name, Len - position - header) or nil if auto then reliability = auto.Rel for _, line in UI.auto_lines(auto, "-- module ") do table.insert(lines, line) end if auto.Type and type(auto.Type.read) == "function" then local ok_read, Value, used = pcall(auto.Type.read, buf, position + header) if ok_read and type(used) == "number" and used >= 0 then if used > Len - (position + header) then used -= position + header end if type(Value) == "table" then local keys = { } for key in Value do table.insert(keys, tostring(key)) end table.sort(keys) for _, key in keys do local item = Value[key] ~= nil and Value[key] or Value[tonumber(key)] table.insert(lines, "-- " .. key .. ": " .. typeof(item) .. " = " .. tostring((serialize(item, 0)))) end else table.insert(lines, "-- value: " .. typeof(Value) .. " = " .. tostring((serialize(Value, 0)))) end position += header + used continue end elseif not auto.Known then table.insert(lines, "-- (argument types not found: " .. (auto.HasSource and "the packet's definition was not found in the decompiled module" or "decompile is not available or failed on the module") .. ")") elseif auto.Def and not auto.Spec then table.insert(lines, "-- definition: " .. auto.Def) end end if schema_rel then reliability = schema_rel end if Settings.ShowSchema and schema_rel then table.insert(lines, "-- schema [" .. packet_name .. "] (" .. schema_rel .. ")") if schema_spec == "" then table.insert(lines, "-- (no arguments)") else for piece in string.gmatch(schema_spec, "[^,]+") do local field_name, field_type = string.match(piece, "^%s*(.-)%s*=%s*(.-)%s*$") table.insert(lines, "-- " .. (field_name or piece) .. ": " .. (field_type or "?")) end end end if Settings.BufferFull then table.insert(lines, "-- [" .. (packet_name or ("packet " .. tostring(Id or "?"))) .. "] (" .. (reliability or "reliable") .. (Id and (", id " .. Id) or "") .. ")") else table.insert(lines, "-- packet" .. (packet_name and (" " .. packet_name) or "") .. (Id and (" id " .. Id) or "") .. ":") end local Offset, failed = position + header, false for piece in string.gmatch(layout, "[^,]+") do piece = string.match(piece, "^%s*(.-)%s*$") local Name, Type = string.match(piece, "^(.-)%s*=%s*(.+)$") Type = string.lower((Type or piece)) Name = Name or Type local Text, size = UI.read_field(buf, Offset, Type, Len) if not Text then table.insert(lines, "-- " .. Name .. " = <" .. tostring(size) .. ">") failed = true break end table.insert(lines, "-- " .. Name .. (Settings.BufferFull and (": " .. Type .. " = ") or " = ") .. Text) Offset += size end if failed then break end position = Offset end if position < Len and guard >= 20 then table.insert(lines, "-- ... " .. (Len - position) .. " more bytes") end return lines end UI.buffer_call = function(Log) local buf for index = 1, Log.Count do if typeof(Log.Args[index]) == "buffer" then buf = Log.Args[index] end end if not buf then return nil end local R = UI.buffer_read local Len = R.len(buf) local header = math.max(0, tonumber(Settings.BufferHeader) or 0) local position, calls, mods, order = 0, { }, { }, { } local filter = Settings.BufferCodeMode == "filtergc" while position < Len and #calls < 20 do local entry = header > 0 and UI.auto_entry(R.readu8(buf, position), nil, Len - position - header) or nil if not entry or not entry.Known then return nil end local Value, used = "", 0 if #entry.Args > 0 then if not entry.Spec then return nil end local parts, count = UI.read_spec(buf, position + header, entry, Len) if not parts then return nil end used = count if #parts == 1 and parts[1][1] == "value" then Value = parts[1][2] else local items = { } for _, part in parts do local number = tonumber(part[2]) local Text = (number and string.find(string.lower(part[1]), "time")) and "workspace:GetServerTimeNow()" or part[2] table.insert(items, (string.sub(UI.member(part[1]), 1, 1) == "." and part[1] or ("[" .. string.format("%q", part[1]) .. "]")) .. " = " .. Text) end Value = "{" .. table.concat(items, ", ") .. "}" end end position += header + used if not filter and not mods[entry.Path] then mods[entry.Path] = #order + 1 table.insert(order, entry.Path) end local Method = entry.Query and "invoke" or "send" local holder = filter and ("find_packet(" .. string.format("%q", entry.Name) .. ", " .. string.format("%q", Method) .. ")") or ((entry.Query and "queries_" or "packets_") .. mods[entry.Path] .. UI.member(entry.Name)) local call = holder .. "." .. Method .. "(" .. Value .. ")" table.insert(calls, entry.Query and ("print(" .. call .. ")") or call) end if position ~= Len then return nil end local out = {"-- the same packets through the game's own modules (no raw buffer)"} if filter then table.insert(out, UI.packet_helper) else for number, path in order do table.insert(out, "local module_" .. number .. " = require(" .. path .. ")") table.insert(out, "local packets_" .. number .. " = module_" .. number .. ".packets or module_" .. number) table.insert(out, "local queries_" .. number .. " = module_" .. number .. ".queries or { }") end end table.insert(out, "") for _, call in calls do table.insert(out, call) end return table.concat(out, "\n") end UI.buffer_notes = function(Log) local lines = { } local ok_class, class = pcall(function() return Log.Remote.ClassName end) local reliability = (ok_class and class == "UnreliableRemoteEvent") and "unreliable" or "reliable" for index = 1, Log.Count do if typeof(Log.Args[index]) == "buffer" then local ok, result = pcall(UI.describe_buffer, Log.Args[index], index, reliability) if ok then for _, line in result do table.insert(lines, line) end end end end return lines end function __R.generate_raw(Log) if Log.Kind == "http" then local lines = {"-- generated by Larp Spy"} if Log.Executor then table.insert(lines, "-- sent by an executor script") elseif Log.Script then local ok, path = pcall(path_of, Log.Script) table.insert(lines, "-- caller: " .. (ok and path or name_of(Log.Script))) end table.insert(lines, "") local parts = { } for index = 1, Log.Count do table.insert(parts, (serialize(Log.Args[index], 0))) end local arg_text = table.concat(parts, ", ") local Method = Log.Method if Method == "request" then table.insert(lines, "local response = request(" .. arg_text .. ")\n\nprint(response.StatusCode, response.Body)") elseif Method == "RequestAsync" then table.insert(lines, 'local response = game:GetService("HttpService"):RequestAsync(' .. arg_text .. ")\n\nprint(response.StatusCode, response.Body)") elseif string.find(Method, "^Http") then table.insert(lines, "local response = game:" .. Method .. "(" .. arg_text .. ")\n\nprint(response)") else table.insert(lines, 'local response = game:GetService("HttpService"):' .. Method .. "(" .. arg_text .. ")\n\nprint(response)") end return UI.tidy(table.concat(lines, "\n")) end if Log.Kind == "logservice" then local Message = Log.Args and Log.Args[1] if type(Message) ~= "string" then Message = tostring(Log.Remote) end local Text = quote(Message) local line if Log.Method == "Warning" then line = "warn(" .. Text .. ")" elseif Log.Method == "Error" then line = "task.spawn(error, " .. Text .. ", 0)" else line = "print(" .. Text .. ")" end return UI.tidy(table.concat({ "-- generated by Larp Spy", "-- LogService.MessageOut: " .. tostring(Log.Method) .. (Log.Time and (" [" .. Log.Time .. "]") or ""), "", line, }, "\n")) end local context = {NeedsNil = false} local actor_thread local setup = { } local target = display_path(Log, context) local Unpack = Settings.Unpack local count = Log.Count local kind = Log.Kind if kind == "purchase" then target = 'game:GetService("MarketplaceService")' end if kind == "raknet" then return UI.raknet_code(Log) end if kind == "anim" and UI.anim_code then return UI.anim_code(Log.Args[1]) end if Settings.RemoteVariable and kind ~= "require" and kind ~= "debuginfo" and kind ~= "create" and kind ~= "lib" and kind ~= "wait" then local variable = (kind == "kick" and "player") or (kind == "corestate" and "starterGui") or (kind == "teleport" and "teleportService") or (kind == "purchase" and "marketplaceService") or (kind == "bindable" and "bindable") or (Log.Signal and "signal") or (kind == "prompt" and "prompt") or (kind == "touch" and "part") or (kind == "click" and "detector") or (kind == "tool" and "tool") or (kind == "actormsg" and "actor") or "remote" table.insert(setup, "local " .. variable .. " = " .. target) target = variable end local setup_before = #setup local arg_text = "" if count > 0 and kind ~= "require" then local Style = Settings.CodeStyle if Style == "inline" then local parts = { } for index = 1, count do table.insert(parts, arg_code(Log, index, 0, context)) end arg_text = table.concat(parts, ", ") elseif Style == "variables" then local names = { } for index = 1, count do table.insert(setup, "local arg" .. index .. " = " .. arg_code(Log, index, 0, context)) table.insert(names, "arg" .. index) end arg_text = table.concat(names, ", ") else local holes = false local lines = {"local args = {"} for index = 1, count do local Value = Log.Args[index] if Value == nil then holes = true end if Style == "array" then table.insert(lines, " " .. arg_code(Log, index, 1, context) .. ",") elseif Value ~= nil then table.insert(lines, " [" .. index .. "] = " .. arg_code(Log, index, 1, context) .. ",") end end table.insert(lines, "}") if #setup > 0 then table.insert(setup, "") end table.insert(setup, table.concat(lines, "\n")) arg_text = holes and (Unpack .. "(args, 1, " .. count .. ")") or (Unpack .. "(args)") end end local up_list = Log.Args.Up or Log.UpFallback if count > 0 and kind ~= "require" and up_list and Settings.CodeStyle ~= "inline" then local functions, order = { }, { } local used = { } local changed = false local complex = false local bumps, bump_vars = { }, { } local function function_var(found) local key = found.Source .. "|" .. found.Name .. "|" .. tostring(found.Line) if not functions[key] then local var = string.match(found.Name, "^[%a_][%w_]*$") and found.Name or "game_function" if used[var] then var = var .. (used[var] + 1) end used[var] = (used[var] or 0) + 1 functions[key] = {Var = var, Found = found} table.insert(order, key) end return functions[key].Var end local function changes(leaf) local history = Log.History if not history or #history < 2 then return false end if leaf.KeyLeaf then for _, record in history do local tbl = record.Args[leaf.Index] if type(tbl) ~= "table" or tbl[leaf.Key] == nil then return true end end return false end local first = nil for _, record in history do local Value = record.Args[leaf.Index] if leaf.Key ~= nil then Value = type(Value) == "table" and Value[leaf.Key] or nil end if first == nil then first = Value elseif Value ~= first then return true end end return false end local function step(leaf) local history = Log.History if not history or #history < 2 then return nil end local delta, previous = nil, nil for _, record in history do local Value = record.Args[leaf.Index] if leaf.Key ~= nil then Value = type(Value) == "table" and Value[leaf.Key] or nil end if type(Value) ~= "number" then return nil end if previous ~= nil then local difference = Value - previous if difference < 0 or (difference > 0 and delta ~= nil and difference ~= delta) then return nil end if difference > 0 then delta = difference end end previous = Value end return delta end for _, leaf in up_list do local current = Log.Args[leaf.Index] if leaf.KeyLeaf then current = leaf.Key elseif leaf.Key ~= nil then current = type(current) == "table" and current[leaf.Key] or nil end if (type(current) ~= "number" and type(current) ~= "string") or not changes(leaf) then continue end local found = leaf.Found[1] if leaf.KeyLeaf then for _, candidate in leaf.Found do if not candidate.KeyOf then found = candidate break end end end local var = function_var(found) if found.Field ~= nil or found.KeyOf or found.ToNumber then complex = true end if (type(current) == "number" or type(current) == "string") and found.Field == nil then for _, e in functions do if e.Var == var and e.Fallback == nil then e.Fallback = current end end end local expr = "debug.getupvalue(" .. var .. ", " .. found.Up .. ")" local access = "" if found.Field ~= nil then access = found.Field expr ..= access end if found.ToNumber then expr = "tonumber(" .. expr .. ")" end if found.KeyOf then expr = "(next(" .. expr .. "))" end local delta = type(current) == "number" and not found.ToNumber and step(leaf) or nil if delta then local bump_key = var .. "|" .. found.Up .. "|" .. tostring(found.Field) if not bump_vars[bump_key] then local base = (type(leaf.Key) == "string" and string.match(leaf.Key, "^[%a_][%w_]*$")) and leaf.Key or ("arg" .. leaf.Index) bump_vars[bump_key] = "next_" .. base table.insert(bumps, {Var = bump_vars[bump_key], Fn = var, Up = found.Up, Access = access, Delta = delta}) end expr = bump_vars[bump_key] end local note = #leaf.Found > 1 and (" -- could also be upvalue " .. leaf.Found[2].Up) or "" if leaf.KeyLeaf then local token = "[" .. serialize(leaf.Key) .. "]" for index = setup_before + 1, #setup do local Text = setup[index] local start, stop = string.find(Text, token, 1, true) if start then setup[index] = string.sub(Text, 1, start - 1) .. "[" .. expr .. "]" .. string.sub(Text, stop + 1) changed = true break end end continue end local Value = serialize(current) local prefix if leaf.Key ~= nil then prefix = (type(leaf.Key) == "string" and string.match(leaf.Key, "^[%a_][%w_]*$")) and (leaf.Key .. " = ") or ("[" .. serialize(leaf.Key) .. "] = ") elseif Settings.CodeStyle == "variables" then prefix = "local arg" .. leaf.Index .. " = " elseif Settings.CodeStyle == "array" then prefix = " " else prefix = "[" .. leaf.Index .. "] = " end local tail = Settings.CodeStyle == "variables" and leaf.Key == nil and "" or "," for index = setup_before + 1, #setup do local Text = setup[index] local start, stop = string.find(Text, prefix .. Value .. tail, 1, true) if start then setup[index] = string.sub(Text, 1, start - 1) .. prefix .. expr .. tail .. note .. string.sub(Text, stop + 1) changed = true break end end end if changed and #order > 0 and (complex or #bumps > 0) then local head = { "-- several copies of the function can exist (old ones are not collected yet): the one with the highest counter is the live one", "local function find_function(source, name, line, up, fuzzy)", " local best, bestValue, loose, near, nearDiff", " local list = filtergc and select(2, pcall(filtergc, \"function\", {IgnoreExecutor = true}))", " if type(list) ~= \"table\" then list = getgc() end", " for i = 1, #list do", " local f = list[i]", " if type(f) == \"function\" then", " local l = debug.info(f, \"l\")", " if l == line then", " local src = debug.info(f, \"s\")", " if src == source and debug.info(f, \"n\") == name then", " local ok, value = pcall(debug.getupvalue, f, up)", " if not up or not ok or type(value) ~= \"number\" then", " best = best or f", " elseif not bestValue or value > bestValue then", " best, bestValue = f, value", " end", " elseif not loose and type(src) == \"string\" and src:find(source, 1, true) then", " loose = f", " end", " elseif fuzzy and type(l) == \"number\" and debug.info(f, \"s\") == source then", " -- the game was updated and the line moved: closest function of the same script that has a number at that upvalue slot", " local ok, value = pcall(debug.getupvalue, f, up)", " if ok and type(value) == \"number\" and (not nearDiff or math.abs(l - line) < nearDiff) then", " near, nearDiff = f, math.abs(l - line)", " end", " end", " end", " end", " return best or loose or near", "end", "", } for _, key in order do local entry = functions[key] table.insert(head, "local " .. entry.Var .. " = find_function(" .. string.format("%q", entry.Found.Source) .. ", " .. string.format("%q", entry.Found.Name) .. ", " .. tostring(entry.Found.Line) .. ", " .. tostring(entry.Found.Up) .. ", true) or error(" .. string.format("%q", "couldn't find " .. (entry.Found.Name ~= "" and entry.Found.Name or entry.Var) .. " (do the action in-game first)") .. ", 0)") end if #bumps > 0 then table.insert(head, "") for _, bump in bumps do if bump.Access ~= "" then table.insert(head, "local " .. bump.Var .. "_state = debug.getupvalue(" .. bump.Fn .. ", " .. bump.Up .. ")") table.insert(head, "local " .. bump.Var .. " = " .. bump.Var .. "_state" .. bump.Access .. " + " .. number(bump.Delta)) table.insert(head, bump.Var .. "_state" .. bump.Access .. " = " .. bump.Var .. " -- keep the game's counter in step") else table.insert(head, "local " .. bump.Var .. " = debug.getupvalue(" .. bump.Fn .. ", " .. bump.Up .. ") + " .. number(bump.Delta)) table.insert(head, "debug.setupvalue(" .. bump.Fn .. ", " .. bump.Up .. ", " .. bump.Var .. ") -- keep the game's counter in step") end end end table.insert(head, "") table.insert(setup, setup_before + 1, table.concat(head, "\n")) elseif changed and #order > 0 then local thread_index = tonumber(string.match(tostring(Log.Actor), "^actor thread (%d+)$")) if Log.Actor then actor_thread = thread_index or 1 end local head = { actor_thread and "-- the call came from an actor: the whole script runs inside that actor thread (run_on_thread), so the game function, the upvalue and the remote are all in the same VM" or "-- the call came from the main thread: the upvalue and the remote are both used in this same VM", "", [=[local function grab_upvalue(source, line, up) local best, bestDiff for _, f in filtergc and filtergc("function", {IgnoreExecutor = true}) or getgc() do if type(f) == "function" then local src = debug.info(f, "s") if type(src) == "string" and (src == source or src:find(source, 1, true)) then local ok, upvalue = pcall(debug.getupvalue, f, up) local diff = math.abs(debug.info(f, "l") - line) -- the function closest to the captured line that has a value in that upvalue slot if ok and upvalue ~= nil and (bestDiff == nil or diff < bestDiff) then best, bestDiff = upvalue, diff end end end end return best end]=], } for _, key in order do local entry = functions[key] local Name = entry.Var .. "_up" .. tostring(entry.Found.Up) table.insert(head, "local " .. Name .. " = grab_upvalue(" .. string.format("%q", entry.Found.Source) .. ", " .. tostring(entry.Found.Line) .. ", " .. tostring(entry.Found.Up) .. ")") table.insert(head, "if " .. Name .. " == nil then return warn(\"not found\") end") for index, Text in setup do setup[index] = string.gsub(Text, "debug%.getupvalue%(" .. entry.Var .. ", " .. tostring(entry.Found.Up) .. "%)", function() return Name end) end end table.insert(head, "") table.insert(setup, setup_before + 1, table.concat(head, "\n")) end end local call if kind == "incoming" then call = "firesignal(" .. target .. ".OnClientEvent" .. (arg_text ~= "" and (", " .. arg_text) or "") .. ")" elseif kind == "require" then call = "require(" .. target .. ")" elseif kind == "debuginfo" then call = "debug.info(" .. arg_text .. ")" elseif kind == "create" or kind == "lib" or kind == "wait" then call = target .. "(" .. arg_text .. ")" elseif kind == "parentnil" then call = target .. ".Parent = nil" elseif kind == "guiclick" then local lines = { } for _, Name in UI.gui_signals(Log.Remote) do table.insert(lines, "firesignal(" .. target .. "." .. Name .. ")") end call = table.concat(lines, "\n") elseif kind == "touch" or kind == "click" then call = Log.Method .. "(" .. target .. (arg_text ~= "" and (", " .. arg_text) or "") .. ")" elseif kind == "prompt" then call ="fireproximityprompt(" .. target .. (arg_text ~= "" and (", " .. arg_text) or "") .. ")" elseif kind == "connection" then call = target .. ":" .. Log.Method .. "(" .. arg_text .. ")" elseif kind == "purchase" then local method_name = Log.Method if string.find(method_name, "Finished$") and not string.find(method_name, "^Signal") then call = "firesignal(" .. target .. "." .. method_name .. (arg_text ~= "" and (", " .. arg_text) or "") .. ")" elseif method_name == "UserOwnsGamePassAsync" or method_name == "PlayerOwnsAsset" then call = "local owns = " .. target .. ":" .. method_name .. "(" .. arg_text .. ")\n\nprint(owns)" else call = target .. ":" .. method_name .. "(" .. arg_text .. ")" end elseif Log.Signal then call = kind .. "(" .. target .. (arg_text ~= "" and (", " .. arg_text) or "") .. ")" elseif Settings.CallViaFunction and Log.Info and not Log.Actor and (kind == "event" or kind == "unreliable" or kind == "function") then local with_args = Settings.CallMode == "with args" local Info = with_args and Log.Info or (Log.Info.Outer or Log.Info) local no_args = not with_args if no_args then for index = #setup, 1, -1 do setup[index] = nil end end table.insert(setup, table.concat({ "local function find_caller(source, name, line, params, vararg)", " local options = {IgnoreExecutor = true}", " options.Name = name", " local ok, list = pcall(filtergc, \"function\", options)", " if not ok or type(list) ~= \"table\" then list = getgc() end", " local best, bestLine", " for _, f in list do", " if type(f) == \"function\" and debug.info(f, \"s\") == source and (not name or debug.info(f, \"n\") == name) then", " local defined = debug.info(f, \"l\")", " local count, var = debug.info(f, \"a\")", " -- the captured line is where the function was running, so the function is the closest one that starts at or before it", " if (not params or count == params) and var == vararg and defined <= line and (not bestLine or defined > bestLine) then", " best, bestLine = f, defined", " end", " end", " end", " return best", "end", "", "local caller_function = find_caller(" .. string.format("%q", tostring(Info.Source)) .. ", " .. (Info.Name and string.format("%q", Info.Name) or "nil") .. ", " .. tostring(tonumber(Info.Line) or 0) .. ", " .. (Info.Params and tostring(Info.Params) or "nil") .. ", " .. tostring(Info.Vararg and true or false) .. ")", "if not caller_function then error(\"couldn't find the game function (do the action in-game first)\", 0) end", no_args and "-- mode \"no args\": the game function that leads to the remote is called without arguments, it sends them itself" or "-- mode \"with args\": the function that fired the remote is called with the captured arguments (a method would also need its self)", }, "\n")) call = "caller_function(" .. (no_args and "" or arg_text) .. ")" else call = target .. ":" .. (string.gsub(Log.Method, "^%l", string.upper)) .. "(" .. arg_text .. ")" end if kind == "getattr" and Settings.GetAttrCodeSet and count > 0 and Log.Method == "GetAttribute" then local bool_value = Settings.GetAttrBool == "flip" and "not result" or (Settings.GetAttrBool == "false" and "false" or "true") local number_value = number(tonumber(Settings.GetAttrNumber) or 100) local string_value = string.format("%q", tostring(Settings.GetAttrString or "")) call = table.concat({ "local instance = " .. target, "local name = " .. arg_text, "local result = instance:GetAttribute(name)", "print(result)", "", "-- change the value", "if typeof(result) == \"boolean\" then", " instance:SetAttribute(name, " .. BoolValue .. ")", "elseif typeof(result) == \"number\" then", " instance:SetAttribute(name, " .. NumberValue .. ")", "elseif typeof(result) == \"string\" then", " instance:SetAttribute(name, " .. StringValue .. ")", "end", }, "\n") end local returns = (kind == "function" or kind == "getattr" or kind == "loghistory" or kind == "require" or kind == "debuginfo" or (kind == "bindable" and Log.Method == "Invoke")) and not (kind == "getattr" and Settings.GetAttrCodeSet and count > 0) local wrap = Settings.Wrap local Delay = tonumber(Settings.LoopDelay) or 0 local body if wrap == "loop" then local inner = call if Delay > 0 then inner ..= "\ntask.wait(" .. number(Delay) .. ")" end body = "for i = 1, " .. math.max(1, math.floor(tonumber(Settings.LoopCount) or 1)) .. " do\n" .. indent(inner) .. "\nend" elseif wrap == "while" then body = "while task.wait(" .. (Delay > 0 and number(Delay) or "") .. ") do\n" .. indent(call) .. "\nend" elseif wrap == "spawn" then body = "task.spawn(function()\n" .. indent(call) .. "\nend)" elseif wrap == "pcall" then body = "local ok, result = pcall(function()\n" .. indent((returns and "return " or "") .. call) .. "\nend)\n\nprint(ok, result)" elseif kind == "require" then body = "local module = " .. call .. "\n\nprint(module)" elseif returns then body = "local result = " .. call .. "\n\nprint(result)" else body = call end if Settings.DecodeBuffers and Settings.BufferCode then local ok_call, call_code = pcall(UI.buffer_call, Log) if ok_call and call_code then body = call_code for index = #setup, 1, -1 do table.remove(setup, index) end end end local header = {"-- generated by Larp Spy"} if Settings.CallerComment then if Log.Script then local ok, path = pcall(path_of, Log.Script) table.insert(header, "-- caller: " .. (ok and path or name_of(Log.Script))) end if Log.Info then local Info = Log.Info table.insert(header, string.format("-- caller function: %s %s:%s (%s param%s%s)", Info.Name or "", tostring(Info.Source), tostring(Info.Line), tostring(Info.Params or "?"), Info.Params == 1 and "" or "s", Info.Vararg and ", vararg" or "")) if Info.Stack and #Info.Stack > 0 then table.insert(header, "-- call stack (innermost first):") for index, frame in Info.Stack do if index > 15 then table.insert(header, "-- ... " .. (#Info.Stack - 15) .. " more") break end table.insert(header, string.format("-- %d. %s %s:%s", index, frame.Name or "", UI.frame_path(frame.Source), tostring(frame.Line))) end end end if Log.Actor then table.insert(header, "-- actor: " .. Log.Actor) end end if Settings.TrackRenames then local renamed = UI.rename_comment(Log) if renamed then for _, line in renamed do table.insert(header, line) end end end if Settings.DecodeBuffers and count > 0 then for _, line in UI.buffer_notes(Log) do table.insert(header, line) end end if kind == "incoming" then table.insert(header, "-- incoming (server -> client): replays the event on your client") elseif kind == "kick" then table.insert(header, "-- a kick the game tried on you") elseif kind == "purchase" then table.insert(header, "-- MarketplaceService call (ownership check / purchase prompt)") local names = UI.purchase_arg_names[(string.gsub(Log.Method, "^Signal", ""))] if names then table.insert(header, "-- args: " .. names) end elseif kind == "connection" then table.insert(header, "-- the game connected a function to this signal" .. (Log.Owner and "" or " (signal owner not found, set it yourself)")) elseif Log.Signal then table.insert(header, "-- " .. kind .. " call from an executor script" .. (Log.Owner and "" or " (signal owner not found, set it yourself)")) end local setup_text = #setup > 0 and (table.concat(setup, "\n") .. "\n\n") or "" local returned = "" if kind == "connection" and Log.Owner then returned = "\n\n-- run the game's own handlers for this signal:\nfiresignal(" .. display_path(Log, context) .. ")" end if (kind == "require" or kind == "debuginfo") and Log.Result then local parts = { } for index = 1, Log.Result.n or #Log.Result do table.insert(parts, serialize(Log.Result[index])) end returned = "\n\n-- returned:\n-- " .. (string.gsub(table.concat(parts, ", "), "\n", "\n-- ")) end local inner = (context.NeedsNil and UI.get_nil_helper or "") .. (context.NeedsResolver and UI.resolver_helper or "") .. UI.tidy(setup_text .. body .. returned) if kind == "lib" and (string.find(tostring(Log.Remote), "^require%(") or string.find(tostring(Log.Remote), "^find_packet%(")) then inner = string.gsub(inner, "(%[\"[%w_]*[Tt]ime[%w_]*\"%]%s*=%s*)%-?%d[%d%.eE%+%-]*", "%1workspace:GetServerTimeNow()") inner = string.gsub(inner, "([%w_]*[Tt]ime[%w_]*%s*=%s*)%-?%d[%d%.eE%+%-]*", "%1workspace:GetServerTimeNow()") inner = UI.dot_syntax(inner) if string.find(tostring(Log.Remote), "^find_packet%(") then inner = UI.packet_helper .. "\n\n" .. inner end end if actor_thread then local level = "==" while string.find(inner, "]" .. level .. "]", 1, true) do level ..= "=" end inner = table.concat({ "local thread_index = " .. actor_thread .. " -- getactorthreads()[thread_index]: if the egg code runs in another actor, change it", "", "local id, channel = create_comm_channel()", "channel.Event:Connect(function(...)", " print(...)", "end)", "", "local code = [" .. level .. "[", "local id = ...", "local channel = get_comm_channel(id)", "local function print(...) channel:Fire(...) end", "local function warn(...) channel:Fire(...) end", "", "local ok, err = pcall(function()", indent(inner), "end)", "if not ok then channel:Fire(\"error:\", err) end", "]" .. level .. "]", "", "run_on_thread(getactorthreads()[thread_index], code, id)", }, "\n") end if Log.Actor and string.find(inner, "find_function", 1, true) and not string.find(inner, "]==]", 1, true) then local lines = { "-- the game function lives on the call stack of whichever Lua VM runs the game's code (this one, or an actor's own VM):", "-- the script runs in this VM and in every actor, and only the VM where the game really runs it catches the function and sends", "local run_on_actor = run_on_actor or (syn and syn.run_on_actor)", "local code = [==[", "local ok, err = pcall(function()", indent(inner), "end)", "if not ok then error(err, 0) end", "]==]", "", } if Log.Actor then table.insert(lines, "local label = " .. string.format("%q", Log.Actor)) table.insert(lines, "local index = tonumber(label:match(\"^actor (%d+)$\"))") table.insert(lines, "local ran = false") table.insert(lines, "for i, actor in getactors() do") table.insert(lines, " if (index and i == index) or (not index and (actor.Name == label or label == \"actor id \" .. actor:GetDebugId())) then") table.insert(lines, " ran = true") table.insert(lines, " task.spawn(run_on_actor, actor, code)") table.insert(lines, " end") table.insert(lines, "end") table.insert(lines, "assert(ran, \"actor not found: \" .. label)") end inner = table.concat(lines, "\n") end return table.concat(header, "\n") .. "\n\n" .. inner end function __R.strip_comments(code) local out, length, index = { }, #code, 1 local line_start = 1 local function only_space() for position = line_start, #out do if not string.match(out[position], "^%s*$") then return false end end return true end while index <= length do local Char = string.sub(code, index, index) if Char == "\"" or Char == "'" then local stop = index + 1 while stop <= length do local current = string.sub(code, stop, stop) if current == "\\" then stop += 2 elseif current == Char or current == "\n" then break else stop += 1 end end table.insert(out, string.sub(code, index, stop)) index = stop + 1 elseif Char == "[" and string.match(code, "^%[=*%[", index) then local level = #string.match(code, "^%[(=*)%[", index) local _, stop = string.find(code, "]" .. string.rep("=", level) .. "]", index, true) stop = stop or length table.insert(out, string.sub(code, index, stop)) index = stop + 1 elseif Char == "-" and string.sub(code, index + 1, index + 1) == "-" then local stop if string.match(code, "^%-%-%[=*%[", index) then local level = #string.match(code, "^%-%-%[(=*)%[", index) local _, close = string.find(code, "]" .. string.rep("=", level) .. "]", index, true) stop = (close or length) + 1 else stop = (string.find(code, "\n", index, true) or length + 1) end if only_space() then for position = #out, line_start, -1 do out[position] = nil end index = stop + 1 else while #out >= line_start and string.match(out[#out], "^[ \t]+$") do table.remove(out) end index = stop end else table.insert(out, Char) index += 1 if Char == "\n" then line_start = #out + 1 end end end return table.concat(out) end local function generate(Log) local code = __R.generate_raw(Log) if not Settings.StripComments then return code end local head = string.sub(code, 1, #banner) == banner local body = head and string.sub(code, #banner + 1) or code local stripped = string.gsub(string.gsub(__R.strip_comments((head and "\n" or "") .. body), "\n\n\n+", "\n\n"), "^\n+", "") return (head and (banner .. "\n\n") or "") .. stripped end local function unstack(Log) local per = stacks[Log.Remote] if per then for key, Value in per do if Value == Log then per[key] = nil end end if next(per) == nil then stacks[Log.Remote] = nil end end end local function signature(Log) local parts = {tostring(Log.Remote), Log.Method, Log.Kind, tostring(Log.Actor), Log.Count} for index = 1, Log.Count do local Value = Log.Args[index] if type(Value) == "table" then local count = 0 table.insert(parts, "{") for key, inner in next, Value do count += 1 if count > 20 then break end table.insert(parts, tostring(key) .. "=" .. tostring(inner)) end table.insert(parts, "}") else table.insert(parts, typeof(Value) .. ":" .. tostring(Value)) end end return table.concat(parts, "|") end UI.resolver_helper = [[-- the game renames this remote (random / changing names): it is looked up by the names seen so far, then by its position among the same-class children local function findremote(parent, class, names, index) if parent then for _, name in names do local found = parent:FindFirstChild(name) if found and found.ClassName == class then return found end end local position = 0 for _, child in parent:GetChildren() do if child.ClassName == class then position += 1 if position == index then return child end end end end error("remote not found: " .. tostring(names[1])) end ]] UI.smart_path = function(object, context) local Info = UI.remotes[object] local class = class_of(object) if not Info or not UI.remote_classes[class] or not UI.unstable_name(object, Info) then return nil end local ok_parent, Parent = pcall(function() return object.Parent end) if not ok_parent or not Parent then return nil end local ok_kids, kids = pcall(Parent.GetChildren, Parent) if not ok_kids then return nil end local position, found = 0, false for _, kid in kids do if class_of(kid) == class then position += 1 if kid == object then found = true break end end end if not found then return nil end local names, seen = { }, { } local function add(Name) if not seen[Name] and #names < 4 then seen[Name] = true table.insert(names, quote(Name)) end end add(name_of(object)) for index = #Info.Names, 1, -1 do add(Info.Names[index]) end context.NeedsResolver = true return "findremote(" .. path_of_raw(Parent, context) .. ", " .. quote(class) .. ", {" .. table.concat(names, ", ") .. "}, " .. position .. ")" end serialize = function(Value, depth, seen, context) depth = depth or 0 seen = seen or { } local Type = typeof(Value) if Type == "nil" then return "nil" elseif Type == "boolean" then return tostring(Value) elseif Type == "number" then return number(Value) elseif Type == "string" then return quote(Value) elseif Type == "table" then return __R.serialize_table(Value, depth, seen, context) elseif Type == "Instance" then return path_of(Value, context) elseif Type == "Vector3" then return "Vector3.new(" .. list({Value.X, Value.Y, Value.Z}) .. ")" elseif Type == "Vector2" then return "Vector2.new(" .. list({Value.X, Value.Y}) .. ")" elseif Type == "Vector3int16" then return "Vector3int16.new(" .. list({Value.X, Value.Y, Value.Z}) .. ")" elseif Type == "Vector2int16" then return "Vector2int16.new(" .. list({Value.X, Value.Y}) .. ")" elseif Type == "CFrame" then return "CFrame.new(" .. list({Value.GetComponents(Value)}) .. ")" elseif Type == "Color3" then return "Color3.new(" .. list({Value.R, Value.G, Value.B}) .. ")" elseif Type == "BrickColor" then return "BrickColor.new(" .. quote(Value.Name) .. ")" elseif Type == "UDim2" then return "UDim2.new(" .. list({Value.X.Scale, Value.X.Offset, Value.Y.Scale, Value.Y.Offset}) .. ")" elseif Type == "UDim" then return "UDim.new(" .. list({Value.Scale, Value.Offset}) .. ")" elseif Type == "EnumItem" then return tostring(Value) elseif Type == "Enum" then return "Enum." .. tostring(Value) elseif Type == "NumberRange" then return "NumberRange.new(" .. list({Value.Min, Value.Max}) .. ")" elseif Type == "Rect" then return "Rect.new(" .. list({Value.Min.X, Value.Min.Y, Value.Max.X, Value.Max.Y}) .. ")" elseif Type == "Ray" then return "Ray.new(" .. serialize(Value.Origin) .. ", " .. serialize(Value.Direction) .. ")" elseif Type == "NumberSequence" then local points = { } for _, point in Value.Keypoints do table.insert(points, "NumberSequenceKeypoint.new(" .. list({point.Time, point.Value, point.Envelope}) .. ")") end return "NumberSequence.new({" .. table.concat(points, ", ") .. "})" elseif Type == "ColorSequence" then local points = { } for _, point in Value.Keypoints do table.insert(points, "ColorSequenceKeypoint.new(" .. number(point.Time) .. ", " .. serialize(point.Value) .. ")") end return "ColorSequence.new({" .. table.concat(points, ", ") .. "})" elseif Type == "buffer" then return "buffer.fromstring(" .. quote(buffer.tostring(Value)) .. ")" elseif Type == "DateTime" then return "DateTime.fromUnixTimestampMillis(" .. Value.UnixTimestampMillis .. ")" elseif Type == "TweenInfo" then return "TweenInfo.new(" .. list({Value.Time}) .. ", " .. tostring(Value.EasingStyle) .. ", " .. tostring(Value.EasingDirection) .. ", " .. list({Value.RepeatCount}) .. ", " .. tostring(Value.Reverses) .. ", " .. list({Value.DelayTime}) .. ")" elseif Type == "Font" then return "Font.new(" .. quote(Value.Family) .. ", " .. tostring(Value.Weight) .. ", " .. tostring(Value.Style) .. ")" elseif Type == "PhysicalProperties" then return "PhysicalProperties.new(" .. list({Value.Density, Value.Friction, Value.Elasticity, Value.FrictionWeight, Value.ElasticityWeight}) .. ")" end if Type == "function" then local ok, Name = pcall(raw_debug_info or debug.info, Value, "n") return "function() end --[[ " .. ((ok and Name and Name ~= "") and Name or "function") .. " ]]" end return "nil --[[ " .. Type .. ": " .. string.gsub(tostring(Value), "%]%]", "] ]") .. " ]]" end UI.get_nil_helper = [[local function getnil(name, class) for _, v in getnilinstances() do if v.Name == name and v.ClassName == class then return v end end end ]] UI.buffer_read = {len = buffer.len, readu8 = buffer.readu8, readi8 = buffer.readi8, readu16 = buffer.readu16, readi16 = buffer.readi16, readu32 = buffer.readu32, readi32 = buffer.readi32, readf32 = buffer.readf32, readf64 = buffer.readf64, readstring = buffer.readstring} UI.buffer_fields = { u8 = {1, "readu8"}, i8 = {1, "readi8"}, u16 = {2, "readu16"}, i16 = {2, "readi16"}, u32 = {4, "readu32"}, i32 = {4, "readi32"}, f32 = {4, "readf32"}, float32 = {4, "readf32"}, f64 = {8, "readf64"}, float64 = {8, "readf64"}, } UI.auto_names = {uint8 = "u8", int8 = "i8", uint16 = "u16", int16 = "i16", uint32 = "u32", int32 = "i32", float32 = "f32", float64 = "f64", bool = "bool", boolean = "bool", string = "string", vec2 = "vec2", vec3 = "vec3", vector2 = "vec2", vector3 = "vec3"} UI.auto_sizes = {u8 = 1, i8 = 1, u16 = 2, i16 = 2, u32 = 4, i32 = 4, f32 = 4, f64 = 8, bool = 1, vec2 = 8, vec3 = 12} UI.keywords = {["and"] = 1, ["break"] = 1, ["do"] = 1, ["else"] = 1, ["elseif"] = 1, ["end"] = 1, ["false"] = 1, ["for"] = 1, ["function"] = 1, ["if"] = 1, ["in"] = 1, ["local"] = 1, ["nil"] = 1, ["not"] = 1, ["or"] = 1, ["repeat"] = 1, ["return"] = 1, ["then"] = 1, ["true"] = 1, ["until"] = 1, ["while"] = 1, ["continue"] = 1} UI.packet_helper = table.concat({ "local function find_packet(name, method)", " method = method or \"send\"", " for _, tbl in filtergc(\"table\", {Keys = {name}}, false) do", " local packet = rawget(tbl, name)", " if type(packet) == \"table\" and rawget(packet, method) then return packet end", " end", " for _, group in {\"packets\", \"queries\"} do", " for _, tbl in filtergc(\"table\", {Keys = {group}}, false) do", " local list = rawget(tbl, group)", " local packet = type(list) == \"table\" and rawget(list, name)", " if type(packet) == \"table\" and rawget(packet, method) then return packet end", " end", " end", "end", }, "\n") UI.logs_view = New("Frame", {Parent = inner, Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1}) UI.settings_view = New("Frame", {Parent = inner, Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1, Visible = false}) local Split = 0.42 local selected = nil local render, show_details, rebuild, find_owner local flat = { } local pool = { } local row_log = { } local filter = "" local log_menu local current_code = "" local function layout() UI.calls_panel.Position = UDim2.new(0, 6, 0, 6) UI.calls_panel.Size = UDim2.new(Split, -10, 1, -12) UI.details_panel.Position = UDim2.new(Split, 4, 0, 6) UI.details_panel.Size = UDim2.new(1 - Split, -10, 1, -12) UI.splitter.Position = UDim2.new(Split, -4, 0, 6) end function __R.matches(Log) if filter == "" then return true end local haystack = string.lower((display_name(Log) .. " " .. Log.Method .. " " .. Log.Kind .. " " .. (Log.Script and name_of(Log.Script) or "") .. " " .. (Log.Actor or "") .. " " .. (typeof(Log.Remote) == "Instance" and name_of(Log.Remote) or ""))) return string.find(haystack, filter, 1, true) ~= nil end function UI.highlight(source) local colors = UI.syntax_colors local length = #source if length > 80000 then return Esc(source) end local out = {} local position = 1 local previous = "" local function put(piece, color) local escaped = Esc(piece) if not color then table.insert(out, escaped) return end if string.find(escaped, "\n", 1, true) then escaped = string.gsub(escaped, "[^\n]+", function(line) return '' .. line .. "" end) table.insert(out, escaped) else table.insert(out, '' .. escaped .. "") end end while position <= length do local Char = string.sub(source, position, position) if Char == "-" and string.find(source, "^%-%-", position) then local level = string.match(source, "^%-%-%[(=*)%[", position) local stop if level then local _, close = string.find(source, "]" .. level .. "]", position, true) stop = close or length else stop = (string.find(source, "\n", position, true) or length + 1) - 1 end put(string.sub(source, position, stop), colors.Comment) position = stop + 1 elseif Char == '"' or Char == "'" then local stop = position + 1 while stop <= length do local current = string.sub(source, stop, stop) if current == "\\" then stop += 2 elseif current == Char or current == "\n" then break else stop += 1 end end put(string.sub(source, position, stop), colors.String) position = stop + 1 previous = Char elseif Char == "[" and string.find(source, "^%[=*%[", position) then local level = string.match(source, "^%[(=*)%[", position) local _, close = string.find(source, "]" .. level .. "]", position, true) local stop = close or length put(string.sub(source, position, stop), colors.String) position = stop + 1 previous = "]" elseif string.find(Char, "%d") or (Char == "." and string.find(source, "^%.%d", position)) then local _, stop = string.find(source, "^0[xX][%x_]+", position) if not stop then _, stop = string.find(source, "^%d*%.?%d*", position) local _, exponent = string.find(source, "^[eE][%+%-]?%d+", stop + 1) stop = exponent or stop end put(string.sub(source, position, stop), colors.number) position = stop + 1 previous = "0" elseif string.find(Char, "[%a_]") then local _, stop = string.find(source, "^[%w_]+", position) local word = string.sub(source, position, stop) local color if UI.lua_keywords[word] then color = colors.Keyword elseif word == "true" or word == "false" or word == "nil" then color = colors.Boolean elseif previous == "." or previous == ":" then color = string.find(source, "^%s*[%(\"'{]", stop + 1) and colors.Call or colors.Property elseif UI.lua_globals[word] then color = colors.Global elseif string.find(source, "^%s*[%(\"'{]", stop + 1) then color = colors.Call end put(word, color) position = stop + 1 previous = "a" elseif string.find(Char, "%s") then local _, stop = string.find(source, "^%s+", position) put(string.sub(source, position, stop)) position = stop + 1 elseif string.find(Char, "[%+%-%*/%%%^#=<>~]") then local _, stop = string.find(source, "^[%+%-%*/%%%^#=<>~]+", position) put(string.sub(source, position, stop), colors.Operator) position = stop + 1 previous = Char else put(Char) position += 1 previous = Char end end return table.concat(out) end local function fill_code(body, source, fade) fade = fade and Settings.LogAnimations if UI.code_last[body] == source and body.FindFirstChildWhichIsA(body, "GuiObject") then return end UI.code_last[body] = source for _, child in body.GetChildren(body) do if child.IsA(child, "GuiObject") then child.Destroy(child) end end local lines = string.split(source, "\n") local colored = string.split(UI.highlight(source), "\n") local number_width = #tostring(#lines) * UI.mono_width + 10 local chunk = 0 for start = 1, #lines, 120 do local numbers, code = { }, { } chunk += 1 for line = start, math.min(start + 119, #lines) do table.insert(numbers, tostring(line)) table.insert(code, colored[line] or "") end local row = New("Frame", {Parent = body, LayoutOrder = start, Size = UDim2.new(0, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.XY, BackgroundTransparency = 1}) local number_label = Text(row, {Name = "CodeText", Size = UDim2.new(0, number_width - 10, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, TextXAlignment = Enum.TextXAlignment.Right, TextYAlignment = Enum.TextYAlignment.Top, TextTruncate = Enum.TextTruncate.None, TextColor3 = T.Dim, FontFace = UI.code_font, TextSize = UI.code_size, Text = table.concat(numbers, "\n")}) local code_label = Text(row, {Name = "CodeText", Position = UDim2.new(0, number_width, 0, 0), AutomaticSize = Enum.AutomaticSize.XY, TextYAlignment = Enum.TextYAlignment.Top, TextTruncate = Enum.TextTruncate.None, FontFace = UI.code_font, TextSize = UI.code_size, RichText = true, Text = table.concat(code, "\n")}) if fade then for _, label in {number_label, code_label} do label.TextTransparency = 1 UI.Smooth(label, {TextTransparency = 0}, 0.6) local outline = label.FindFirstChild(label, "TxtOutline") if outline then outline.Transparency = 1 UI.Smooth(outline, {Transparency = 0.6}, 0.6) end end end end if fade then body.Position = UDim2.new(0, 0, 0, 12) UI.Smooth(body, {Position = UDim2.new(0, 0, 0, 0)}, 0.55) else body.Position = UDim2.new(0, 0, 0, 0) end end local function show_code(source, fade) current_code = source fill_code(UI.code_body, source, fade) end local function viewed(Log) local history = Log.History local record = history and history[Log.ViewIndex or #history] if not record then return Log end return { Remote = Log.Remote, Method = Log.Method, Kind = Log.Kind, Actor = Log.Actor, Calls = Log.Calls, Args = record.Args, Count = record.Count, Script = record.Script, Info = record.Info, Time = record.Time, number = record.number, Result = record.Result, Signal = record.Signal or Log.Signal, EventName = Log.EventName, Owner = Log.Owner, History = history, UpFallback = Log.Args and Log.Args.Up, Label = Log.Label, Url = Log.Url, Executor = Log.Executor, } end function __R.Decompile(script) local native = (getgenv and getgenv().decompile) or decompile or (syn and syn.decompile) local problem = nil if type(native) == "function" then local ok, source = pcall(native, script) if ok and type(source) == "string" and #source > 0 and not string.find(source, "^%-%- ?[Ff]ailed") then return true, source end problem = ok and tostring(source) or ("decompile error: " .. tostring(source)) end if X.get_bytecode and X.Request then local ok_bytecode, bytecode = pcall(X.get_bytecode, script) if not ok_bytecode or type(bytecode) ~= "string" or #bytecode == 0 then return false, "no bytecode for this script (not loaded on your client?)" end env.__LarpHttpSelf = true local ok, response = pcall(X.Request, {Url = UI.konstant_url, Method = "POST", Headers = {["Content-Type"] = "text/plain"}, Body = bytecode}) env.__LarpHttpSelf = false if ok and response and (response.StatusCode == nil or response.StatusCode == 200) and type(response.Body) == "string" and #response.Body > 0 then return true, response.Body end return false, "online decompiler failed" .. (ok and response and response.StatusCode and (" (" .. tostring(response.StatusCode) .. ")") or "") end return false, problem or "this executor has no decompile (and no getscriptbytecode + request for the online one)" end function UI.pop_in(frame) frame.Visible = true if not Settings.LogAnimations then frame.Position = UDim2.new(0, 6, 0, 6) return end frame.Position = UDim2.new(0, 6, 0, 22) UI.Smooth(frame, {Position = UDim2.new(0, 6, 0, 6)}, 0.35) end function __R.parse_value(raw) local Lower = string.lower(raw) if Lower == "true" then return true elseif Lower == "false" then return false elseif Lower == "nil" then return nil end local code = nil if string.sub(raw, 1, 1) == "{" or string.match(raw, "^[%a_][%w_]*%s*=[^=]") then code = string.sub(raw, 1, 1) == "{" and raw or ("{" .. raw .. "}") elseif string.match(raw, "^[%a_][%w_%.]*%.new%(") or string.match(raw, "^Enum%.") or string.match(raw, "^CFrame%.") or string.match(raw, "^Color3%.") then code = raw end if code and loadstring then local compiled = loadstring("return " .. code) if compiled then local ok, Value = pcall(compiled) if ok then return Value end end end local quoted = string.match(raw, '^"(.*)"$') or string.match(raw, "^'(.*)'$") if quoted then return quoted end return tonumber(raw) or raw end function __R.show_value(Value) if type(Value) == "string" then return '"' .. Value .. '"' elseif type(Value) == "table" then local ok, code = pcall(serialize, Value) return ok and (string.gsub(code, "%s+", " ")) or tostring(Value) end return tostring(Value) end UI.calls_panel = Panel(UI.logs_view, "calls") UI.details_panel = Panel(UI.logs_view, "details") UI.splitter = New("TextButton", {Parent = UI.logs_view, BackgroundTransparency = 1, Text = "", AutoButtonColor = false, Size = UDim2.new(0, 6, 1, -12), ZIndex = 5}) layout() do local splitting = false Connect(UI.splitter.InputBegan, function(input_object) if input_object.UserInputType == Enum.UserInputType.MouseButton1 then splitting = true end end) Connect(user_input_service.InputEnded, function(input_object) if input_object.UserInputType == Enum.UserInputType.MouseButton1 then splitting = false end end) Connect(user_input_service.InputChanged, function(input_object) if splitting and input_object.UserInputType == Enum.UserInputType.MouseMovement then Split = math.clamp((input_object.Position.X - inner.AbsolutePosition.X) / math.max(1, inner.AbsoluteSize.X), 0.25, 0.7) layout() end end) end UI.filter_box = Input(UI.calls_panel, {Position = UDim2.new(0, 8, 0, 24), Size = UDim2.new(1, -118, 0, 18)}, "filter name, method, caller...") UI.call_buttons = New("Frame", {Parent = UI.calls_panel, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -8, 0, 24), Size = UDim2.new(0, 96, 0, 18), BackgroundTransparency = 1}) HorizontalList(UI.call_buttons, 4).HorizontalAlignment = Enum.HorizontalAlignment.Right UI.pause_button = Button(UI.call_buttons, "pause", {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X}, function() paused = not paused UI.pause_button.Text = paused and "resume" or "pause" UI.pause_button.TextColor3 = paused and T.Accent or T.Text set_status(paused and "paused" or "logging") end) Button(UI.call_buttons, "clear", {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = 1}, function() logs = { } stacks = { } selected = nil rebuild() show_details(nil) end) local tree = New("ScrollingFrame", { Parent = UI.calls_panel, Position = UDim2.new(0, 8, 0, 48), Size = UDim2.new(1, -16, 1, -56), BackgroundColor3 = T.Background, BorderSizePixel = 0, ScrollBarThickness = 2, CanvasSize = UDim2.new(0, 0, 0, 0), ScrollingDirection = Enum.ScrollingDirection.Y, }) Accent(tree, "ScrollBarImageColor3") Stroke(tree, T.Outline) local row_height = UI.classic and 18 or 22 rebuild = function() flat = { } for _, Log in logs do if __R.matches(Log) then table.insert(flat, Log) end end tree.CanvasSize = UDim2.new(0, 0, 0, #flat * row_height + 4) render() end do local function get_row(index) if pool[index] then return pool[index] end local row = New("TextButton", {Parent = tree, Size = UDim2.new(1, -6, 0, row_height), BackgroundColor3 = T.Hover, BackgroundTransparency = 1, BorderSizePixel = 0, AutoButtonColor = false, Text = ""}) UI.Round(row, 5) New("Frame", {Parent = row, Name = "Bar", Size = UDim2.new(0, 2, 1, 0), BorderSizePixel = 0}) New("ImageLabel", {Parent = row, Name = "Icon", BackgroundTransparency = 1, Position = UDim2.new(0, 8, 0.5, -6), Size = UDim2.new(0, 12, 0, 12), ScaleType = Enum.ScaleType.Fit, Visible = false}) Text(row, {Name = "Label", Position = UDim2.new(0, 8, 0, 0), Size = UDim2.new(1, -122, 1, 0), RichText = true}) Accent(Text(row, {Name = "Count", AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -66, 0, 0), Size = UDim2.new(0, 50, 1, 0), TextXAlignment = Enum.TextXAlignment.Right}), "TextColor3") Text(row, {Name = "Time", AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -4, 0, 0), Size = UDim2.new(0, 60, 1, 0), TextXAlignment = Enum.TextXAlignment.Right, TextColor3 = T.Dim}) Connect(row.MouseEnter, function() row.SetAttribute(row, "Hovered", true) if row_log[row] ~= selected then row.BackgroundTransparency = 0.5 end end) Connect(row.MouseLeave, function() row.SetAttribute(row, "Hovered", false) if row_log[row] ~= selected then row.BackgroundTransparency = 1 end end) Connect(row.MouseButton1Click, function() if row_log[row] then show_details(row_log[row]) end end) Connect(row.MouseButton2Click, function() if row_log[row] then show_details(row_log[row]) log_menu(row_log[row]) end end) pool[index] = row return row end render = function() local height = tree.AbsoluteWindowSize.Y local first = math.max(1, math.floor(tree.CanvasPosition.Y / row_height) + 1) local count = math.ceil(height / row_height) + 1 for index = 1, math.max(count, #pool) do local Log = index <= count and flat[first + index - 1] if not Log then if pool[index] then pool[index].Visible = false row_log[pool[index]] = nil end continue end local row = get_row(index) local kind = kinds[Log.Kind] local kind_tint = kind_color(Log.Kind) local color = "#" .. kind_tint.ToHex(kind_tint) local extra = "" row.Count.Text = Log.Calls > 1 and ("x" .. Log.Calls) or "" if Log.Actor then extra ..= " [" .. Esc(Log.Actor) .. "]" end if blocked[Log.Remote] or UI.touch_blocked[Log.Remote] ~= nil then extra ..= " blocked" end local log_name = UI.log_name(Log) if log_name and blocked_names[log_name] and not blocked[Log.Remote] then extra ..= " blocked (name)" end if Log.BindKey then extra ..= " [" .. Esc(Log.BindKey) .. "]" end if UI.loops and UI.loops[Log] then extra ..= " looping" end if overrides[Log.Remote] then extra ..= " hooked" end if Log.Spoofed then extra ..= " spoofed" end row_log[row] = Log row.Visible = true if not Log.Born then Log.Born = os.clock() if Settings.LogAnimations then UI.anim_until = Log.Born + 0.5 end end local progress = math.clamp((os.clock() - Log.Born) / 0.4, 0, 1) local alpha = Settings.LogAnimations and (1 - progress) ^ 3 or 0 row.Label.TextTransparency, row.Time.TextTransparency, row.Count.TextTransparency = alpha, alpha, alpha row.Icon.ImageTransparency = alpha row.Position = UDim2.new(0, -18 * alpha, 0, (first + index - 2) * row_height) row.Bar.BackgroundColor3 = kind_color(Log.Kind) row.Bar.BackgroundTransparency = alpha local icon = kind_icons[Log.Kind] row.Icon.Visible = icon ~= nil row.Icon.Image = icon or "" row.Icon.ImageColor3 = kind_color(Log.Kind) row.Label.Position = UDim2.new(0, icon and 24 or 8, 0, 0) row.Label.Size = UDim2.new(1, icon and -138 or -122, 1, 0) row.Label.Text = (icon and "" or ('' .. kind.Tag .. " ")) .. Esc(display_name(Log)) .. ' ' .. extra .. "" row.Time.Text = Log.Time local is_selected = Log == selected row.BackgroundColor3 = is_selected and T.Element or T.Hover row.BackgroundTransparency = is_selected and 0 or (row.GetAttribute(row, "Hovered") and 0.5 or 1) end end end Connect(tree.GetPropertyChangedSignal(tree, "CanvasPosition"), function() render() end) Connect(tree.GetPropertyChangedSignal(tree, "AbsoluteWindowSize"), function() render() end) do local pending = 0 Connect(UI.filter_box.GetPropertyChangedSignal(UI.filter_box, "Text"), function() pending += 1 local mine = pending task.delay(0.2, function() if mine == pending then filter = string.lower(UI.filter_box.Text) rebuild() end end) end) end UI.info_name = Text(UI.details_panel, {Position = UDim2.new(0, 8, 0, 22), Size = UDim2.new(1, -16, 0, 12), RichText = true, Text = 'select a call'}) UI.info_path = Text(UI.details_panel, {Position = UDim2.new(0, 8, 0, 35), Size = UDim2.new(1, -16, 0, 12), TextColor3 = T.Dim}) UI.info_meta = Text(UI.details_panel, {Position = UDim2.new(0, 8, 0, 48), Size = UDim2.new(1, -16, 0, 12), TextColor3 = T.Dim}) local actions = New("Frame", {Parent = UI.details_panel, Position = UDim2.new(0, 8, 0, 64), Size = UDim2.new(1, -16, 0, 40), BackgroundTransparency = 1}) UI.actions_list = HorizontalList(actions, 4) UI.actions_list.Wraps = true UI.caller_row = New("Frame", {Parent = UI.details_panel, Position = UDim2.new(0, 8, 0, 108), Size = UDim2.new(1, -16, 0, 18), BackgroundTransparency = 1, Visible = false}) UI.history_row = New("Frame", {Parent = UI.details_panel, Position = UDim2.new(0, 8, 0, 108), Size = UDim2.new(1, -16, 0, 18), BackgroundTransparency = 1, Visible = false}) UI.loop_row = New("Frame", {Parent = UI.details_panel, Position = UDim2.new(0, 8, 0, 108), Size = UDim2.new(1, -16, 0, 18), BackgroundTransparency = 1, Visible = false}) UI.loops = { } HorizontalList(UI.loop_row, 4) HorizontalList(UI.caller_row, 4) HorizontalList(UI.history_row, 4) -- the action buttons wrap onto more rows when the window is narrow (or more buttons exist), so everything under them is placed from their real height UI.relayout_details = function() if not UI.code_scroll then return end local height = math.max(40, UI.actions_list.AbsoluteContentSize.Y) actions.Size = UDim2.new(1, -16, 0, height) local Y = 64 + height + 4 for _, row in {UI.loop_row, UI.caller_row, UI.history_row} do if row.Visible then row.Position = UDim2.new(0, 8, 0, Y) Y += 22 end end UI.code_scroll.Position = UDim2.new(0, 8, 0, Y + 2) UI.code_scroll.Size = UDim2.new(1, -16, 1, -(Y + 10)) end for _, row in {UI.loop_row, UI.caller_row, UI.history_row} do row.ClipsDescendants = true end Connect(UI.actions_list.GetPropertyChangedSignal(UI.actions_list, "AbsoluteContentSize"), function() UI.relayout_details() end) UI.code_scroll = New("ScrollingFrame", { Parent = UI.details_panel, Position = UDim2.new(0, 8, 0, 88), Size = UDim2.new(1, -16, 1, -96), BackgroundColor3 = T.Background, BorderSizePixel = 0, ScrollBarThickness = 3, CanvasSize = UDim2.new(0, 0, 0, 0), AutomaticCanvasSize = Enum.AutomaticSize.XY, ScrollingDirection = Enum.ScrollingDirection.XY, }) Accent(UI.code_scroll, "ScrollBarImageColor3") Stroke(UI.code_scroll, T.Outline) UI.code_body = New("Frame", {Parent = UI.code_scroll, Size = UDim2.new(0, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.XY, BackgroundTransparency = 1}) New("UIListLayout", {Parent = UI.code_body, SortOrder = Enum.SortOrder.LayoutOrder}) New("UIPadding", {Parent = UI.code_body, PaddingTop = UDim.new(0, 4), PaddingBottom = UDim.new(0, 8), PaddingLeft = UDim.new(0, 4), PaddingRight = UDim.new(0, 12)}) UI.syntax_colors = { Keyword = "#c792ea", String = "#a5d68a", number = "#f7a76c", Comment = "#5c6370", Global = "#6cb6ff", Call = "#e6c37a", Property = "#e5848c", Operator = "#8fa1b8", Boolean = "#f7a76c", } UI.lua_keywords = {} UI.lua_globals = {} for _, word in {"and", "break", "continue", "do", "else", "elseif", "end", "for", "function", "if", "in", "local", "not", "or", "repeat", "return", "then", "until", "while"} do UI.lua_keywords[word] = true end for _, word in {"game", "workspace", "script", "shared", "Instance", "Enum", "Vector3", "Vector2", "CFrame", "Color3", "UDim2", "UDim", "BrickColor", "TweenInfo", "Rect", "Ray", "NumberRange", "NumberSequence", "ColorSequence", "DateTime", "Font", "buffer", "table", "string", "math", "os", "task", "debug", "coroutine", "utf8", "bit32", "print", "warn", "error", "pcall", "xpcall", "require", "assert", "type", "typeof", "tostring", "tonumber", "select", "next", "pairs", "ipairs", "unpack", "setmetatable", "getmetatable", "rawget", "rawset", "tick", "wait", "spawn", "delay", "getgenv", "getrenv", "getnilinstances", "getgc", "filtergc", "hookmetamethod", "hookfunction", "newcclosure", "checkcaller", "firesignal", "fireproximityprompt", "firetouchinterest", "fireclickdetector", "replicatesignal", "getactors", "run_on_actor", "run_on_thread", "getactorthreads", "setclipboard", "loadstring", "getnamecallmethod", "setnamecallmethod"} do UI.lua_globals[word] = true end UI.code_last = setmetatable({}, {__mode = "k"}) UI.konstant_url = "http://api.plusgiant5.com/konstant/decompile" UI.source_cache = setmetatable({ }, {__mode = "k"}) local viewer = Panel(UI.logs_view, "source") viewer.Visible = false viewer.Active = true viewer.ZIndex = 10 viewer.Position = UDim2.new(0, 6, 0, 6) viewer.Size = UDim2.new(1, -12, 1, -12) viewer.Title.Size = UDim2.new(1, -200, 0, 12) UI.viewer_bar = New("Frame", {Parent = viewer, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -8, 0, 3), Size = UDim2.new(0, 180, 0, 16), BackgroundTransparency = 1}) HorizontalList(UI.viewer_bar, 4).HorizontalAlignment = Enum.HorizontalAlignment.Right UI.viewer_scroll = New("ScrollingFrame", { Parent = viewer, Position = UDim2.new(0, 8, 0, 24), Size = UDim2.new(1, -16, 1, -32), BackgroundColor3 = T.Background, BorderSizePixel = 0, ScrollBarThickness = 3, CanvasSize = UDim2.new(0, 0, 0, 0), AutomaticCanvasSize = Enum.AutomaticSize.XY, ScrollingDirection = Enum.ScrollingDirection.XY, }) Accent(UI.viewer_scroll, "ScrollBarImageColor3") Stroke(UI.viewer_scroll, T.Outline) UI.viewer_body = New("Frame", {Parent = UI.viewer_scroll, Size = UDim2.new(0, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.XY, BackgroundTransparency = 1}) New("UIListLayout", {Parent = UI.viewer_body, SortOrder = Enum.SortOrder.LayoutOrder}) New("UIPadding", {Parent = UI.viewer_body, PaddingTop = UDim.new(0, 4), PaddingBottom = UDim.new(0, 8), PaddingLeft = UDim.new(0, 4), PaddingRight = UDim.new(0, 12)}) UI.viewer_text = "" Button(UI.viewer_bar, "copy", {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X}, function() copy(UI.viewer_text) end) Button(UI.viewer_bar, "close", {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = 1}, function() viewer.Visible = false end) local function show_source(title, source) UI.viewer_text = source viewer.Title.Text = title if not viewer.Visible then UI.pop_in(viewer) end UI.viewer_scroll.CanvasPosition = Vector2.new(0, 0) fill_code(UI.viewer_body, source, true) end UI.show_source = show_source local function decompile_caller(script) if not script then set_status("no calling script for this call") return end local ok, path = pcall(path_of, script) path = ok and path or name_of(script) if UI.source_cache[script] then show_source("source " .. name_of(script), UI.source_cache[script]) return end show_source("source " .. name_of(script) .. " (decompiling...)", "-- decompiling " .. path .. "...") set_status("decompiling " .. name_of(script) .. "...") task.spawn(function() local success, result = __R.Decompile(script) if success then result = string.gsub(string.gsub(result, "\r\n", "\n"), "\t", " ") UI.source_cache[script] = result set_status("decompiled " .. name_of(script)) show_source("source " .. name_of(script), "-- " .. path .. "\n\n" .. result) else set_status(result) show_source("source " .. name_of(script) .. " (failed)", "-- couldn't decompile " .. path .. "\n-- " .. result) end end) end local block_modes = {"value", "type", "any"} local action_buttons = { } local sync_actors UI.remote_ids = function(remote) local ids = { } local ok, Id = pcall(function() return remote.GetDebugId(remote) end) if ok and type(Id) == "string" then table.insert(ids, Id) end local ok_name, Name = pcall(function() return remote.GetFullName(remote) end) if ok_name and type(Name) == "string" then table.insert(ids, "path:" .. Name) end return ids end UI.fire_all = function(kind, remote, Value) if not channel or typeof(remote) ~= "Instance" then return end local pushed = 0 for _, Id in UI.remote_ids(remote) do pcall(function() channel.Fire(channel, kind, Id, Value) end) local literal = type(Value) == "string" and string.format("%q", Value) or tostring(Value) local source = "local G = (getgenv and getgenv()) or _G local S = G.__LarpSpyActor if S and S.Apply then S.Apply(" .. string.format("%q", kind) .. ", " .. string.format("%q", Id) .. ", " .. literal .. ") end" for _, run in UI.injected or { } do if type(run) == "function" and pcall(run, source) then pushed += 1 end end end if pushed > 0 then set_status("sent " .. kind .. " to " .. pushed .. " actor hook(s)") end end local function send_override(remote) if not channel then return end local json = nil local spec = overrides[remote] if spec then local list = { } for index, item in spec do table.insert(list, {i = index, v = item.Value, n = item.Value == nil or nil}) end local ok, encoded = pcall(function() return http_service.JSONEncode(http_service, list) end) if not ok then set_status("this hook value can't be sent to actors (only text, numbers, booleans and plain tables)") end json = ok and encoded or nil end UI.fire_all("override", remote, json) end UI.sync_actor_state = function() if not channel then return end for remote in overrides do if typeof(remote) == "Instance" then send_override(remote) end end for remote in blocked do if typeof(remote) == "Instance" then UI.fire_all("block", remote, true) end end end local function action_button(Name, label, order, callback) action_buttons[Name] = Button(actions, label, {Size = UDim2.new(0, 0, 0, 18), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = order}, function() if selected then callback(selected) end end) end local hook_panel = Panel(UI.logs_view, "hook arguments") hook_panel.Visible = false hook_panel.Active = true hook_panel.ZIndex = 10 hook_panel.Position = UDim2.new(0, 6, 0, 6) hook_panel.Size = UDim2.new(1, -12, 1, -12) hook_panel.Title.Size = UDim2.new(1, -200, 0, 12) UI.hook_bar = New("Frame", {Parent = hook_panel, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -8, 0, 3), Size = UDim2.new(0, 200, 0, 16), BackgroundTransparency = 1}) HorizontalList(UI.hook_bar, 4).HorizontalAlignment = Enum.HorizontalAlignment.Right UI.hook_info = Text(hook_panel, {Position = UDim2.new(0, 8, 0, 22), Size = UDim2.new(1, -16, 0, 12), TextColor3 = T.Dim, Text = "empty = leave it. true / false / nil / 5 / text (\"quote\" to force a string)"}) UI.hook_scroll = New("ScrollingFrame", { Parent = hook_panel, Position = UDim2.new(0, 8, 0, 40), Size = UDim2.new(1, -16, 1, -48), BackgroundColor3 = T.Background, BorderSizePixel = 0, ScrollBarThickness = 3, CanvasSize = UDim2.new(0, 0, 0, 0), AutomaticCanvasSize = Enum.AutomaticSize.Y, ScrollingDirection = Enum.ScrollingDirection.Y, }) Accent(UI.hook_scroll, "ScrollBarImageColor3") Stroke(UI.hook_scroll, T.Outline) New("UIListLayout", {Parent = UI.hook_scroll, Padding = UDim.new(0, 3), SortOrder = Enum.SortOrder.LayoutOrder}) New("UIPadding", {Parent = UI.hook_scroll, PaddingTop = UDim.new(0, 4), PaddingLeft = UDim.new(0, 4), PaddingRight = UDim.new(0, 10), PaddingBottom = UDim.new(0, 4)}) UI.hook_remote = nil UI.hook_boxes = { } do local function apply_hook() local remote = UI.hook_remote if not remote then return end local spec = { } for index, box in UI.hook_boxes do local raw = string.match(box.Text, "^%s*(.-)%s*$") if raw ~= "" then spec[index] = {Value = __R.parse_value(raw)} end end overrides[remote] = next(spec) and spec or nil send_override(remote) hook_panel.Visible = false render() set_status(overrides[remote] and ("hooked arguments of " .. name_of(remote)) or "argument hook removed") end Button(UI.hook_bar, "apply", {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X}, apply_hook) end Button(UI.hook_bar, "remove", {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = 1}, function() if UI.hook_remote then overrides[UI.hook_remote] = nil send_override(UI.hook_remote) set_status("argument hook removed") end hook_panel.Visible = false render() end) Button(UI.hook_bar, "close", {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = 2}, function() hook_panel.Visible = false end) function __R.open_hook(Log) local remote = Log.Remote local hookable = Log.Kind == "event" or Log.Kind == "unreliable" or Log.Kind == "function" or Log.Kind == "bindable" or Log.Kind == "purchase" if Log.Kind == "purchase" then UI.purchase_hook_method = UI.purchase_hook_method or { } UI.purchase_hook_method[remote] = Log.Method end if typeof(remote) ~= "Instance" or not hookable then set_status("only remote / bindable calls can be hooked") return end local call = viewed(Log) local current = overrides[remote] or { } local rows = call.Count + 1 for index in current do rows = math.max(rows, index) end for _, child in UI.hook_scroll.GetChildren(UI.hook_scroll) do if child.IsA(child, "GuiObject") then child.Destroy(child) end end UI.hook_remote = remote UI.hook_boxes = { } hook_panel.Title.Text = "hook arguments " .. display_name(Log) for index = 1, rows do local row = New("Frame", {Parent = UI.hook_scroll, LayoutOrder = index, Size = UDim2.new(1, 0, 0, 18), BackgroundTransparency = 1}) local shown = "(new argument)" if index <= call.Count then local ok, code = pcall(serialize, call.Args[index]) shown = ok and string.gsub(code, "%s+", " ") or "?" end Text(row, {Size = UDim2.new(0.55, -6, 1, 0), Text = "[" .. index .. "] " .. shown}) local box = Input(row, {AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 0), Size = UDim2.new(0.45, 0, 1, 0)}, "override") if current[index] then box.Text = __R.show_value(current[index].Value) end UI.hook_boxes[index] = box end UI.pop_in(hook_panel) end UI.value_key = function(Value, depth) depth = depth or 0 if type(Value) == "table" then if depth > 3 then return "{...}" end local keys = { } for key, inner in next, Value do table.insert(keys, tostring(key) .. "=" .. UI.value_key(inner, depth + 1)) end table.sort(keys) return "{" .. table.concat(keys, ",") .. "}" end return typeof(Value) .. ":" .. tostring(Value) end UI.rule_matches = function(rule, total, ...) if rule.Count and rule.Count ~= total then return false end for index, Mode in rule.Modes do local Value = (select(index, ...)) if Mode == "type" then if typeof(Value) ~= rule.Types[index] then return false end elseif Mode == "value" and UI.value_key(Value) ~= rule.Values[index] then return false end end return true end do local block_panel = Panel(UI.logs_view, "ignore arguments") block_panel.Visible = false block_panel.Active = true block_panel.ZIndex = 10 block_panel.Position = UDim2.new(0, 6, 0, 6) block_panel.Size = UDim2.new(1, -12, 1, -12) block_panel.Title.Size = UDim2.new(1, -230, 0, 12) UI.block_bar = New("Frame", {Parent = block_panel, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -8, 0, 3), Size = UDim2.new(0, 230, 0, 16), BackgroundTransparency = 1}) HorizontalList(UI.block_bar, 4).HorizontalAlignment = Enum.HorizontalAlignment.Right UI.block_info = Text(block_panel, {Position = UDim2.new(0, 8, 0, 22), Size = UDim2.new(1, -16, 0, 12), TextColor3 = T.Dim, Text = "click a mode to change it. a call is hidden from the log (still fires) when everything set here matches"}) UI.block_scroll = New("ScrollingFrame", { Parent = block_panel, Position = UDim2.new(0, 8, 0, 40), Size = UDim2.new(1, -16, 1, -48), BackgroundColor3 = T.Background, BorderSizePixel = 0, ScrollBarThickness = 3, CanvasSize = UDim2.new(0, 0, 0, 0), AutomaticCanvasSize = Enum.AutomaticSize.Y, ScrollingDirection = Enum.ScrollingDirection.Y, }) Accent(UI.block_scroll, "ScrollBarImageColor3") Stroke(UI.block_scroll, T.Outline) New("UIListLayout", {Parent = UI.block_scroll, Padding = UDim.new(0, 3), SortOrder = Enum.SortOrder.LayoutOrder}) New("UIPadding", {Parent = UI.block_scroll, PaddingTop = UDim.new(0, 4), PaddingLeft = UDim.new(0, 4), PaddingRight = UDim.new(0, 10), PaddingBottom = UDim.new(0, 4)}) UI.block_draft = nil UI.open_block_args = function(Log) local remote = Log.Remote if typeof(remote) ~= "Instance" then set_status("only calls on an instance can be ignored by arguments") return end local call = viewed(Log) local draft = {Remote = remote, SameCount = true, Count = call.Count, Modes = { }, Types = { }, Values = { }} UI.block_draft = draft hook_panel.Visible = false for _, child in UI.block_scroll.GetChildren(UI.block_scroll) do if child.IsA(child, "GuiObject") then child.Destroy(child) end end local function add_row(order, label, start, cycle) local row = New("Frame", {Parent = UI.block_scroll, LayoutOrder = order, Size = UDim2.new(1, 0, 0, 18), BackgroundTransparency = 1}) Text(row, {Size = UDim2.new(1, -80, 1, 0), Text = label}) local box box = Button(row, start, {AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 0), Size = UDim2.new(0, 70, 1, 0)}, function() box.Text = cycle() end) end add_row(0, "amount of arguments (" .. call.Count .. ")", "same", function() draft.SameCount = not draft.SameCount return draft.SameCount and "same" or "any" end) for index = 1, call.Count do local Value = call.Args[index] local ok, code = pcall(serialize, Value) draft.Modes[index] = "value" draft.Types[index] = typeof(Value) draft.Values[index] = UI.value_key(Value) add_row(index, "[" .. index .. "] " .. (ok and string.gsub(code, "%s+", " ") or "?"), "value", function() local position = table.find(block_modes, draft.Modes[index]) or 1 draft.Modes[index] = block_modes[position % #block_modes + 1] return draft.Modes[index] end) end UI.block_info.Text = "value = same value, type = same type, any = anything. rules on this remote: " .. #(ignored_args[remote] or { }) block_panel.Title.Text = "ignore arguments " .. display_name(Log) UI.pop_in(block_panel) end Button(UI.block_bar, "add rule", {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = 0}, function() local draft = UI.block_draft if not draft then return end local rule = {Count = draft.SameCount and draft.Count or nil, Modes = { }, Types = draft.Types, Values = draft.Values} for index, Mode in draft.Modes do if Mode ~= "any" then rule.Modes[index] = Mode end end ignored_args[draft.Remote] = ignored_args[draft.Remote] or { } table.insert(ignored_args[draft.Remote], rule) block_panel.Visible = false set_status("ignoring calls that match this rule (" .. #ignored_args[draft.Remote] .. " on this remote)") end) Button(UI.block_bar, "clear rules", {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = 1}, function() if UI.block_draft then ignored_args[UI.block_draft.Remote] = nil set_status("ignore rules removed") end block_panel.Visible = false end) Button(UI.block_bar, "close", {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = 2}, function() block_panel.Visible = false end) end local binds = { } local binding_log = nil local binding_loop = false local function start_bind(Log, loop) binding_log = Log binding_loop = loop == true set_status("press a key to bind (Esc cancels)") end local function remove_bind(Log, loop) for code, Bind in binds do if Bind.Log == Log and (Bind.Loop == true) == (loop == true) then binds[code] = nil end end if loop then Log.LoopKey = nil else Log.BindKey = nil end render() if selected == Log then show_details(Log, true) end end UI.find_caller = function(Info) local options = {IgnoreExecutor = true, Name = Info.Name} local ok_list, list = pcall(filtergc, "function", options) if not ok_list or type(list) ~= "table" then list = getgc() end local best, best_line for _, candidate in list do if type(candidate) == "function" and debug.info(candidate, "s") == Info.Source and (not Info.Name or debug.info(candidate, "n") == Info.Name) then local defined = debug.info(candidate, "l") local count, vararg = debug.info(candidate, "a") if (not Info.Params or count == Info.Params) and vararg == (Info.Vararg and true or false) and defined <= (tonumber(Info.Line) or 0) and (not best_line or defined > best_line) then best, best_line = candidate, defined end end end return best end UI.is_packet_log = function(Log) return Log.Kind == "lib" and UI.packet_senders[Log.Remote] ~= nil end UI.fresh_packet_args = function(Log) local args = resolve(Log) local seen = { } local function fresh(Value, key) if type(Value) == "number" and type(key) == "string" and string.find(string.lower(key), "time", 1, true) then local ok, Now = pcall(function() return workspace.GetServerTimeNow(workspace) end) return ok and Now or Value end if type(Value) == "table" then if seen[Value] then return seen[Value] end local copy = { } seen[Value] = copy for index, item in next, Value do copy[index] = fresh(item, index) end return copy end return Value end local out = { } for index = 1, Log.Count do out[index] = fresh(args[index]) end return out end local function replay(Log) task.spawn(function() local remote = Log.Remote local args = resolve(Log) local ok, result if Settings.CallViaFunction and Log.Info and not Log.Actor and (Log.Kind == "event" or Log.Kind == "unreliable" or Log.Kind == "function") then local with_args = Settings.CallMode == "with args" local Info = with_args and Log.Info or (Log.Info.Outer or Log.Info) local Game = UI.find_caller(Info) if not Game then set_status("couldn't find the game function (do the action in-game first)") return end replaying = true if with_args then ok, result = pcall(Game, table.unpack(args, 1, Log.Count)) else ok, result = pcall(Game) end replaying = false set_status(ok and ("ran " .. (Info.Name or "game function")) or ("run failed: " .. tostring(result))) return end if Log.Kind == "debuginfo" then ok, result = pcall(function() return table.pack((raw_debug_info or debug.info)(table.unpack(args, 1, Log.Count))) end) if ok then Log.Result = result show_code(generate(Log)) end set_status(ok and "ran debug.info" or ("run failed: " .. tostring(result))) return end if Log.Kind == "http" then set_status("sending " .. display_name(Log) .. "...") env.__LarpHttpSelf = true ok, result = pcall(function() local Method = Log.Method if Method == "request" then assert(X.Request, "no request function in this executor") return X.Request(args[1]) elseif Method == "RequestAsync" then return http_service.RequestAsync(http_service, args[1]) elseif string.find(Method, "^Http") then return game[Method](game, table.unpack(args, 1, Log.Count)) end local service = game.GetService(game, "HttpService") return service[Method](service, table.unpack(args, 1, Log.Count)) end) env.__LarpHttpSelf = false if ok then local Text if type(result) == "table" then Text = "status " .. tostring(result.StatusCode) .. " " .. tostring(result.StatusMessage or "") .. "\n" .. tostring(result.Body) else Text = tostring(result) end show_code(generate(Log) .. "\n\n-- response:\n-- " .. (string.gsub(string.sub(Text, 1, 4000), "\n", "\n-- "))) end set_status(ok and ("sent " .. display_name(Log)) or ("send failed: " .. tostring(result))) return end if Log.Kind == "connection" then set_status("a connection can't be replayed (the callback is the game's own function)") return end if Log.Kind == "purchase" and string.find(Log.Method, "Finished$") and not string.find(Log.Method, "^Signal") then if not X.FireSignal then set_status("no firesignal in this executor") return end replaying = true ok, result = pcall(function() return X.FireSignal(Log.Remote[Log.Method], table.unpack(args, 1, Log.Count)) end) replaying = false set_status(ok and ("fired " .. Log.Method) or ("run failed: " .. tostring(result))) return end if Log.Signal then local Function = Log.Kind == "replicatesignal" and X.ReplicateSignal or X.FireSignal if not Function then set_status("no " .. Log.Kind .. " in this executor") return end replaying = true ok, result = pcall(Function, Log.Signal, table.unpack(args, 1, Log.Count)) replaying = false set_status(ok and ("ran " .. Log.Kind .. " " .. Log.EventName) or ("run failed: " .. tostring(result))) return elseif Log.Kind == "raknet" then UI.raknet_send(Log) return elseif (Log.Kind == "lib" and not UI.is_packet_log(Log)) or Log.Kind == "logservice" or Log.Kind == "wait" then set_status(Log.Kind == "lib" and "table / buffer calls aren't run" or (Log.Kind == "wait" and "waits aren't run" or "output lines aren't run")) return elseif Log.Kind == "kick" or Log.Kind == "shutdown" or Log.Kind == "parentnil" or Log.Kind == "create" then set_status("not running a " .. Log.Kind .. " on yourself") return elseif Log.Kind == "lib" then local sender = UI.packet_senders[Log.Remote] replaying = true ok, result = pcall(function() local packed = UI.fresh_packet_args(Log) return sender(table.unpack(packed, 1, Log.Count)) end) replaying = false elseif Log.Kind == "require" then ok, result = pcall(function() return table.pack(require(remote)) end) if ok then Log.Result = result show_code(generate(Log)) end elseif Log.Kind == "incoming" then if not X.FireSignal then set_status("no firesignal in this executor") return end replaying = true ok, result = pcall(X.FireSignal, remote.OnClientEvent, table.unpack(args, 1, Log.Count)) replaying = false elseif Log.Kind == "guiclick" then if not X.FireSignal then set_status("no firesignal in this executor") return end replaying = true ok, result = pcall(function() for _, Name in UI.gui_signals(remote) do X.FireSignal(remote[Name]) end end) replaying = false elseif Log.Kind == "touch" or Log.Kind == "click" then local Function = Log.Kind == "touch" and X.fire_touch or X.fire_click if not Function then set_status("no " .. Log.Method .. " in this executor") return end replaying = true ok, result = pcall(Function, remote, table.unpack(args, 1, Log.Count)) replaying = false elseif Log.Kind == "prompt" then if not X.fire_proximity then set_status("no fireproximityprompt in this executor") return end replaying = true ok, result = pcall(X.fire_proximity, remote, table.unpack(args, 1, Log.Count)) replaying = false elseif Log.Kind == "function" or Log.Method == "Invoke" then set_status("invoking " .. name_of(remote) .. "...") ok, result = pcall(function() return table.pack(remote[string.gsub(Log.Method, "^%l", string.upper)](remote, table.unpack(args, 1, Log.Count))) end) if ok then local parts = { } for index = 1, result.n do table.insert(parts, serialize(result[index])) end show_code(generate(Log) .. "\n\n-- returned:\n-- " .. (string.gsub(table.concat(parts, ", "), "\n", "\n-- "))) end else ok, result = pcall(function() remote[string.gsub(Log.Method, "^%l", string.upper)](remote, table.unpack(args, 1, Log.Count)) end) end set_status(ok and ("ran " .. display_name(Log)) or ("run failed: " .. tostring(result))) end) end UI.block_touch_part = function(part, Bool) if typeof(part) ~= "Instance" or not pcall(function() return part.IsA(part, "BasePart") end) or not part.IsA(part, "BasePart") then return end pcall(function() if Bool then if UI.touch_blocked[part] == nil then UI.touch_blocked[part] = part.CanTouch end part.CanTouch = false if UI.start_touch_poll then UI.start_touch_poll() end elseif UI.touch_blocked[part] ~= nil then part.CanTouch = UI.touch_blocked[part] UI.touch_blocked[part] = nil end end) end UI.auto_block = function(object) if not Settings.BlockAllTouches or object.Name ~= "TouchInterest" then return end local part = object.Parent local character = players.LocalPlayer.Character if typeof(part) ~= "Instance" or not part.IsA(part, "BasePart") or (character and part.IsDescendantOf(part, character)) then return end UI.auto_blocked[part] = true UI.block_touch_part(part, true) end UI.set_block_all_touches = function(Bool) if Bool then if not UI.auto_block_connection then UI.auto_block_connection = Connect(game.DescendantAdded, function(object) pcall(UI.auto_block, object) end) end task.spawn(function() local ok, all = pcall(game.GetDescendants, game) for index, object in ok and all or { } do if Settings.BlockAllTouches then pcall(UI.auto_block, object) end if index % 3000 == 0 then task.wait() end end local count = 0 for _ in UI.auto_blocked do count += 1 end set_status("blocked touches on " .. count .. " parts") end) else for part in UI.auto_blocked do if not blocked[part] then UI.block_touch_part(part, false) end UI.auto_blocked[part] = nil end set_status("touch blocking off") end end UI.apply_name_block = function(object, Bool) pcall(function() if object.IsA(object, "BasePart") then UI.block_touch_part(object, Bool) elseif object.IsA(object, "ClickDetector") then if Bool then if UI.name_original[object] == nil then UI.name_original[object] = object.MaxActivationDistance end object.MaxActivationDistance = 0 elseif UI.name_original[object] ~= nil then object.MaxActivationDistance = UI.name_original[object] UI.name_original[object] = nil end elseif object.IsA(object, "ProximityPrompt") then if Bool then if UI.name_original[object] == nil then UI.name_original[object] = object.Enabled end object.Enabled = false elseif UI.name_original[object] ~= nil then object.Enabled = UI.name_original[object] UI.name_original[object] = nil end elseif object.IsA(object, "RemoteEvent") or object.IsA(object, "RemoteFunction") or object.IsA(object, "UnreliableRemoteEvent") then UI.fire_all("block", object, Bool) end end) end UI.refresh_lists = function() if UI.lists_queued then return end UI.lists_queued = true task.defer(function() UI.lists_queued = false if active and UI.draw_lists and UI.blocks_view and UI.blocks_view.Visible then pcall(UI.draw_lists) end end) end UI.set_name_blocked = function(Name, Bool) blocked_names[Name] = Bool or nil if Bool and not UI.name_block_connection then UI.name_block_connection = Connect(game.DescendantAdded, function(object) if blocked_names[object.Name] then UI.apply_name_block(object, true) end end) end task.spawn(function() local ok, all = pcall(game.GetDescendants, game) for index, object in ok and all or { } do if object.Name == Name then UI.apply_name_block(object, Bool) end if index % 3000 == 0 then task.wait() end end end) set_status((Bool and "blocking everything named " or "unblocked everything named ") .. Name) UI.refresh_lists() render() if selected then show_details(selected, true) end end local function set_blocked(remote, Bool) blocked[remote] = Bool or nil UI.block_touch_part(remote, Bool) UI.refresh_lists() if UI.refresh_lib_block then UI.refresh_lib_block() end if channel then UI.fire_all("block", remote, Bool) end render() if selected then show_details(selected) end end local function set_ignored(remote, Bool) ignored[remote] = Bool or nil UI.refresh_lists() if channel then UI.fire_all("ignore", remote, Bool) end if Bool then local kept = { } for _, Log in logs do if Log.Remote ~= remote then table.insert(kept, Log) end end logs = kept stacks[remote] = nil if selected and selected.Remote == remote then show_details(nil) end end rebuild() end UI.set_ignored_name = function(Name, Bool) ignored_names[Name] = Bool or nil UI.refresh_lists() if Bool then local kept = { } for _, Log in logs do if UI.log_name(Log) ~= Name then table.insert(kept, Log) else unstack(Log) end end logs = kept if selected and UI.log_name(selected) == Name then show_details(nil) end end set_status((Bool and "ignoring everything named " or "no longer ignoring ") .. Name) rebuild() end do local function latest_call(row) local picked = row.ViewIndex row.ViewIndex = nil local latest = viewed(row) row.ViewIndex = picked return latest end UI.refresh_loop = function(Log) if not UI.loop_button then return end local Running = UI.loops[Log] ~= nil UI.loop_button.Text = (Running and "stop loop" or "loop") .. (Log.LoopKey and (" [" .. Log.LoopKey .. "]") or "") UI.loop_button.TextColor3 = Running and T.Accent or T.Text end UI.set_loop = function(Log, Bool) if (Log.Kind == "lib" and not UI.is_packet_log(Log)) or Log.Kind == "logservice" or Log.Kind == "wait" or Log.Kind == "raknet" then set_status("not looping a " .. kinds[Log.Kind].Tag .. " row") return end if Log.Kind == "kick" or Log.Kind == "shutdown" or Log.Kind == "parentnil" or Log.Kind == "create" then set_status("not looping a " .. Log.Kind .. " on yourself") return end if not Bool then UI.loops[Log] = nil set_status("loop stopped: " .. display_name(Log)) else local token = { } UI.loops[Log] = token set_status("looping " .. display_name(Log) .. " every " .. tostring(Settings.RunDelay) .. "s") task.spawn(function() while active and UI.loops[Log] == token and table.find(logs, Log) do replay(latest_call(Log)) task.wait(math.max(0.01, tonumber(Settings.RunDelay) or 0.1)) end if UI.loops[Log] == token then UI.loops[Log] = nil end render() if selected == Log then UI.refresh_loop(Log) end end) end render() if selected == Log then UI.refresh_loop(Log) end end end UI.export_logs = function() if not writefile then set_status("no writefile in this executor") return end ensure_folder() local out = { } for index = #logs, 1, -1 do local Log = logs[index] if Settings.ExportFormat == "summary" then table.insert(out, string.format("[%s] %s %s %s (%d args) x%d", Log.Time, kinds[Log.Kind].Tag, display_name(Log), Log.Method, Log.Count, Log.Calls)) else local ok, code = pcall(generate, viewed(Log)) table.insert(out, "-- [" .. Log.Time .. "] " .. display_name(Log) .. "\n" .. (ok and code or "-- couldn't generate")) end end local Name = folder .. "/export_" .. os.date("%Y%m%d_%H%M%S") .. ".txt" local ok, Error = pcall(writefile, Name, table.concat(out, "\n\n")) set_status(ok and ("exported " .. #logs .. " logs to " .. Name) or ("export failed: " .. tostring(Error))) end do local function view_call(index) if not selected or not selected.History then return end local count = #selected.History index = math.clamp(index, 1, count) selected.ViewIndex = index < count and index or nil show_details(selected) end do local function current_index() return selected and (selected.ViewIndex or #selected.History) or 1 end UI.copy_hook_code = function(Log, with_args) local rows = { } if with_args then local current = overrides[Log.Remote] if not current or next(current) == nil then set_status("no argument hook on this remote (right click -> Hook arguments)") return end local indexes = { } for index in current do table.insert(indexes, index) end table.sort(indexes) for _, index in indexes do local ok, code = pcall(serialize, current[index].Value) table.insert(rows, "\t[" .. index .. "] = " .. (ok and code or "nil") .. ",") end end local lines = { "-- " .. (with_args and "hooked arguments" or "blocked") .. ": " .. display_name(Log) .. " (generated by Larp Spy)", "local remote = " .. display_path(Log), 'local method = "' .. Log.Method .. '"', "", } if with_args then table.insert(lines, "local overrides = {") for _, row in rows do table.insert(lines, row) end table.insert(lines, "}") table.insert(lines, "") table.insert(lines, "local function apply(...)") table.insert(lines, "\tlocal args = table.pack(...)") table.insert(lines, "") table.insert(lines, "\tfor index, value in overrides do") table.insert(lines, "\t\targs[index] = value") table.insert(lines, "") table.insert(lines, "\t\tif index > args.n then") table.insert(lines, "\t\t\targs.n = index") table.insert(lines, "\t\tend") table.insert(lines, "\tend") table.insert(lines, "") table.insert(lines, "\treturn table.unpack(args, 1, args.n)") table.insert(lines, "end") table.insert(lines, "") table.insert(lines, "local old") table.insert(lines, "old = hookmetamethod(game, \"__namecall\", newcclosure(function(self, ...)") table.insert(lines, "\tif self == remote and getnamecallmethod() == method and not checkcaller() then") table.insert(lines, "\t\tif setnamecallmethod then") table.insert(lines, "\t\t\tsetnamecallmethod(method)") table.insert(lines, "\t\tend") table.insert(lines, "") table.insert(lines, "\t\treturn old(self, apply(...))") table.insert(lines, "\tend") table.insert(lines, "") table.insert(lines, "\treturn old(self, ...)") table.insert(lines, "end))") table.insert(lines, "") table.insert(lines, "-- Remote.FireServer(Remote, ...) style calls") table.insert(lines, "local direct") table.insert(lines, "direct = hookfunction(remote[method], newcclosure(function(self, ...)") table.insert(lines, "\tif self == remote and not checkcaller() then") table.insert(lines, "\t\treturn direct(self, apply(...))") table.insert(lines, "\tend") table.insert(lines, "") table.insert(lines, "\treturn direct(self, ...)") table.insert(lines, "end))") else table.insert(lines, "local old") table.insert(lines, "old = hookmetamethod(game, \"__namecall\", newcclosure(function(self, ...)") table.insert(lines, "\tif self == remote and getnamecallmethod() == method and not checkcaller() then") table.insert(lines, "\t\treturn") table.insert(lines, "\tend") table.insert(lines, "") table.insert(lines, "\treturn old(self, ...)") table.insert(lines, "end))") table.insert(lines, "") table.insert(lines, "-- Remote.FireServer(Remote, ...) style calls") table.insert(lines, "local direct") table.insert(lines, "direct = hookfunction(remote[method], newcclosure(function(self, ...)") table.insert(lines, "\tif self == remote and not checkcaller() then") table.insert(lines, "\t\treturn") table.insert(lines, "\tend") table.insert(lines, "") table.insert(lines, "\treturn direct(self, ...)") table.insert(lines, "end))") end copy(UI.tidy(table.concat(lines, "\n"))) set_status(with_args and "copied hooked arguments code" or "copied block code") end UI.copy_oth_hook = function(Log) local remote = Log.Remote if typeof(remote) ~= "Instance" then set_status("oth.hook code is only made for calls on an instance") return end if not (oth and oth.hook) then set_status("this executor has no oth.hook (the code is copied anyway)") end local current = overrides[remote] local with_args = current ~= nil and next(current) ~= nil local lines = { "-- oth.hook " .. (with_args and "hooked arguments" or "block") .. ": " .. display_name(Log) .. " (generated by Larp Spy)", "local remote = " .. display_path(Log), 'local method = "' .. Log.Method .. '"', "", } if with_args then local indexes = { } for index in current do table.insert(indexes, index) end table.sort(indexes) table.insert(lines, "local overrides = {") for _, index in indexes do local ok, code = pcall(serialize, current[index].Value) table.insert(lines, "\t[" .. index .. "] = " .. (ok and code or "nil") .. ",") end table.insert(lines, "}") table.insert(lines, "") table.insert(lines, "local function apply(...)") table.insert(lines, "\tlocal args = table.pack(...)") table.insert(lines, "") table.insert(lines, "\tfor index, value in overrides do") table.insert(lines, "\t\targs[index] = value") table.insert(lines, "") table.insert(lines, "\t\tif index > args.n then") table.insert(lines, "\t\t\targs.n = index") table.insert(lines, "\t\tend") table.insert(lines, "\tend") table.insert(lines, "") table.insert(lines, "\treturn table.unpack(args, 1, args.n)") table.insert(lines, "end") table.insert(lines, "") end table.insert(lines, "-- Remote:" .. Log.Method .. "(...) style calls") table.insert(lines, "local namecall = getrawmetatable(game).__namecall") table.insert(lines, "local old_namecall") table.insert(lines, "old_namecall = oth.hook(namecall, function(self, ...)") table.insert(lines, "\tif self == remote and getnamecallmethod() == method and not checkcaller() then") if with_args then table.insert(lines, "\t\tsetnamecallmethod(method)") table.insert(lines, "") table.insert(lines, "\t\treturn old_namecall(self, apply(...))") else table.insert(lines, "\t\treturn") end table.insert(lines, "\tend") table.insert(lines, "") table.insert(lines, "\treturn old_namecall(self, ...)") table.insert(lines, "end)") table.insert(lines, "") table.insert(lines, "-- Remote." .. Log.Method .. "(Remote, ...) style calls") table.insert(lines, "local method_function = remote[method]") table.insert(lines, "local old_direct") table.insert(lines, "old_direct = oth.hook(method_function, function(self, ...)") table.insert(lines, "\tif self == remote and not checkcaller() then") if with_args then table.insert(lines, "\t\treturn old_direct(self, apply(...))") else table.insert(lines, "\t\treturn") end table.insert(lines, "\tend") table.insert(lines, "") table.insert(lines, "\treturn old_direct(self, ...)") table.insert(lines, "end)") table.insert(lines, "") table.insert(lines, "-- to remove the hooks again:") table.insert(lines, "-- oth.unhook(namecall)") table.insert(lines, "-- oth.unhook(method_function)") copy(UI.tidy(table.concat(lines, "\n"))) set_status(with_args and "copied oth.hook arguments code" or "copied oth.hook block code") end UI.packet_senders = UI.packet_senders or { } UI.touch_blocked = { } UI.auto_blocked = setmetatable({ }, {__mode = "k"}) UI.name_original = setmetatable({ }, {__mode = "k"}) UI.log_name = function(Log) if Log.Signal then return Log.EventName end if typeof(Log.Remote) == "Instance" then return name_of(Log.Remote) end return nil end action_button("Copy", "copy code", 0, function() copy(current_code) end) action_button("Path", "copy path", 1, function(Log) copy(display_path(Log)) end) action_button("Run", "run", 2, function(Log) replay(viewed(Log)) end) action_button("Block", "block", 3, function(Log) set_blocked(Log.Remote, not blocked[Log.Remote]) end) action_button("Ignore", "ignore", 4, function(Log) set_ignored(Log.Remote, true) end) action_button("Freeze", "freeze", 4, function(Log) if Log.Remote ~= nil then UI.frozen[Log.Remote] = (not UI.frozen[Log.Remote]) or nil show_details(Log) end end) action_button("IgnoreArgs", "ignore args", 5, function(Log) UI.open_block_args(Log) end) action_button("BlockName", "block name", 6, function(Log) local Name = UI.log_name(Log) if Name then UI.set_name_blocked(Name, not blocked_names[Name]) end end) action_button("IgnoreName", "ignore name", 7, function(Log) local Name = UI.log_name(Log) if Name then UI.set_ignored_name(Name, true) end end) action_button("Decompile", "decompile stack", 8, function(Log) UI.decompile_stack(Log) end) action_buttons.Decompile.Visible = false action_button("CopyAll", "copy all", 5, function(Log) local parts = { } for _, record in Log.History or {Log} do local ok, code = pcall(generate, { Remote = Log.Remote, Method = Log.Method, Kind = Log.Kind, Actor = Log.Actor, Calls = Log.Calls, Signal = record.Signal or Log.Signal, EventName = Log.EventName, Owner = Log.Owner, Args = record.Args, Count = record.Count, Script = record.Script, Info = record.Info, Time = record.Time, Result = record.Result, }) if ok then table.insert(parts, code) end end copy(table.concat(parts, "\n\n")) end) Connect(action_buttons.Run.MouseButton2Click, function() if not selected then return end if selected.BindKey then remove_bind(selected) set_status("bind removed") else start_bind(selected) end end) UI.loop_button = Button(UI.loop_row, "loop", {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = 0}, function() if selected then UI.set_loop(selected, UI.loops[selected] == nil) end end) UI.loop_delay_label = Text(UI.loop_row, {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, TextColor3 = T.Dim, Text = "delay (s)", LayoutOrder = 1}) do local box = Input(UI.loop_row, {Size = UDim2.new(0, 50, 1, 0), LayoutOrder = 2}, "0.1") box.Text = tostring(Settings.RunDelay) Connect(box.FocusLost, function() local Value = tonumber(box.Text) if Value then Settings.RunDelay = math.max(0.01, Value) save_settings() end box.Text = tostring(Settings.RunDelay) end) end UI.loop_hint = Text(UI.loop_row, {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, TextColor3 = T.Dim, Text = "right click loop to bind a key", LayoutOrder = 3}) Connect(UI.loop_button.MouseButton2Click, function() if not selected then return end if selected.LoopKey then remove_bind(selected, true) set_status("loop bind removed") else start_bind(selected, true) end end) UI.caller_label = Text(UI.caller_row, {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, TextColor3 = T.Dim, Text = "caller", LayoutOrder = 0}) Button(UI.caller_row, "decompile caller", {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = 1}, function() if selected then decompile_caller(viewed(selected).Script) end end) Button(UI.caller_row, "copy caller path", {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = 2}, function() local script = selected and viewed(selected).Script if script then copy(path_of(script)) end end) Button(UI.history_row, "<", {Size = UDim2.new(0, 20, 1, 0), LayoutOrder = 0}, function() view_call(current_index() - 1) end) Button(UI.history_row, ">", {Size = UDim2.new(0, 20, 1, 0), LayoutOrder = 1}, function() view_call(current_index() + 1) end) Button(UI.history_row, "latest", {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = 2}, function() view_call(math.huge) end) UI.history_match = function(record, label, query) if string.find(string.lower(label), query, 1, true) then return true end local parts = { } for index = 1, record.Count or 0 do local ok, text = pcall(function() local arg = record.Args[index] if type(arg) == "string" then return arg end if typeof(arg) == "buffer" then return buffer.tostring(arg) end return tostring(arg) end) if ok and text then table.insert(parts, text) end end local stack = record.Info and record.Info.Stack if stack then for _, frame in stack do table.insert(parts, tostring(frame.Name or "") .. " " .. tostring(frame.Source)) end end return string.find(string.lower(table.concat(parts, " ")), query, 1, true) ~= nil end UI.open_history = function(query) if not selected or not selected.History then return end query = string.lower(query or "") local options = { } local current = current_index() for index = #selected.History, 1, -1 do local record = selected.History[index] local caller = record.Script and (" " .. name_of(record.Script)) or "" local label = "#" .. record.number .. " " .. record.Time .. " " .. record.Count .. " args" .. caller local exact = string.match(query, "^#(%d+)$") if query == "" or (exact and record.number == tonumber(exact)) or (not exact and UI.history_match(record, label, query)) then table.insert(options, {label, function() view_call(index) end, index == current and T.Accent or nil}) end end open_menu(options, 260) local menu_frame = UI.menu_frame menu_frame.Size = UDim2.new(0, 260, 0, math.min(#options * 18 + 22, 280)) local box = Input(menu_frame, {Size = UDim2.new(1, 0, 0, 18)}, #options .. " shown - type + Enter to search") box.LayoutOrder = 0 box.ZIndex = 52 box.Text = query Connect(box.FocusLost, function(entered) if entered then UI.open_history(box.Text) for _, child in menu_frame.GetChildren(menu_frame) do if child.IsA(child, "TextBox") then child.CaptureFocus(child) end end end end) end Button(UI.history_row, "history", {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = 3}, function() UI.open_history("") end) end end UI.history_label = Text(UI.history_row, {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, TextColor3 = T.Dim, LayoutOrder = 4}) log_menu = function(Log) open_menu({ {"Copy code", function() copy(generate(viewed(Log))) end}, {"Copy remote path", function() copy(display_path(Log)) end}, {"Copy block code", function() UI.copy_hook_code(Log, false) end}, {"Copy hooked arguments code", function() UI.copy_hook_code(Log, true) end}, {"Copy oth.hook code", function() UI.copy_oth_hook(Log) end}, {"Run again", function() replay(viewed(Log)) end}, {overrides[Log.Remote] and "Edit argument hook" or "Hook arguments", function() __R.open_hook(Log) end, T.Accent}, {Log.BindKey and ("Remove bind (" .. Log.BindKey .. ")") or "Bind run to key", function() if Log.BindKey then remove_bind(Log) set_status("bind removed") else start_bind(Log) end end, T.Accent}, {"Decompile caller", function() decompile_caller(viewed(Log).Script) end}, {"Ignore by arguments...", function() UI.open_block_args(Log) end, T.Bad}, {blocked[Log.Remote] and "Unblock remote" or "Block remote", function() set_blocked(Log.Remote, not blocked[Log.Remote]) end, T.Bad}, {UI.log_name(Log) and blocked_names[UI.log_name(Log)] and "Unblock all with this name" or "Block all with this name", function() local Name = UI.log_name(Log) if Name then UI.set_name_blocked(Name, not blocked_names[Name]) end end, T.Bad}, {"Ignore remote", function() set_ignored(Log.Remote, true) end}, {"Reset config to defaults", function() UI.reset_config() end, T.Bad}, {"Remove this log", function() local position = table.find(logs, Log) if position then table.remove(logs, position) end unstack(Log) if selected == Log then show_details(nil) end rebuild() end}, }, 160) end find_owner = function(Log) Log.OwnerSearched = true task.spawn(function() local signal, Event = Log.Signal, Log.EventName local scanned = 0 local callbacks = { } if Log.Kind == "connection" and getconnections then for _, record in Log.History or { } do if type(record.Args[1]) == "function" then callbacks[record.Args[1]] = true end end if type(Log.Args[1]) == "function" then callbacks[Log.Args[1]] = true end end local function matches(object) if next(callbacks) then local other = object[Event] if typeof(other) ~= "RBXScriptSignal" then return false end for _, Connection in getconnections(other) do if callbacks[Connection.Function] then return true end end return false end return object[Event] == signal end local function check(list) for _, object in list do local ok, same = pcall(matches, object) if ok and same then return object end scanned += 1 if scanned % 4000 == 0 then task.wait() end end return nil end local found = nil local Gui = players.LocalPlayer.FindFirstChildOfClass(players.LocalPlayer, "PlayerGui") if Gui then found = check(Gui.GetDescendants(Gui)) end if not found then local ok, all = pcall(game.GetDescendants, game) found = check(ok and all or { }) end if not found and getnilinstances then local ok_nil, nils = pcall(getnilinstances) found = check(ok_nil and nils or { }) end Log.Owner = found if found and selected == Log then show_details(Log, true) render() elseif not found then set_status("couldn't find which instance owns " .. tostring(Event)) end end) end show_details = function(Log, keep_scroll) selected = Log for _, object in action_buttons do object.Visible = Log ~= nil end if not Log then UI.info_name.Text = 'select a call' UI.info_path.Text = "" UI.info_meta.Text = "" UI.caller_row.Visible = false UI.history_row.Visible = false UI.loop_row.Visible = false show_code("") render() return end local kind_tint = kind_color(Log.Kind) local color = "#" .. kind_tint.ToHex(kind_tint) UI.info_name.Text = Esc(display_name(Log)) .. ' ' .. Esc(__R.display_class(Log)) .. ' ' .. kinds[Log.Kind].Tag .. "" local ok_path, path = pcall(display_path, Log) UI.info_path.Text = ok_path and path or "" if Log.Signal and not Log.OwnerSearched then find_owner(Log) end local call = viewed(Log) local meta = {Log.Method, call.Count .. " args", call.Time} if Log.Calls > 1 then table.insert(meta, "x" .. Log.Calls) end if Log.Actor then table.insert(meta, "actor " .. Log.Actor) end UI.info_meta.Text = table.concat(meta, " · ") if not keep_scroll and Settings.LogAnimations then for _, label in {UI.info_name, UI.info_path, UI.info_meta} do label.TextTransparency = 1 UI.Smooth(label, {TextTransparency = 0}, 0.45) end end local Y = 130 UI.loop_row.Visible = Log.Kind ~= "kick" and Log.Kind ~= "shutdown" and Log.Kind ~= "parentnil" and Log.Kind ~= "create" and (Log.Kind ~= "lib" or UI.is_packet_log(Log)) and Log.Kind ~= "wait" and Log.Kind ~= "logservice" and Log.Kind ~= "raknet" UI.loop_row.Position = UDim2.new(0, 8, 0, 108) if UI.refresh_loop then UI.refresh_loop(Log) end UI.caller_row.Visible = call.Script ~= nil if call.Script then UI.caller_label.Text = "caller " .. name_of(call.Script) UI.caller_row.Position = UDim2.new(0, 8, 0, Y) Y += 22 end local history = Log.History or { } UI.history_row.Visible = #history > 1 if #history > 1 then local index = Log.ViewIndex or #history UI.history_label.Text = "call #" .. (call.number or Log.Calls) .. " of " .. Log.Calls .. " (" .. index .. "/" .. #history .. " kept)" .. (Log.ViewIndex and "" or " latest") UI.history_row.Position = UDim2.new(0, 8, 0, Y) Y += 22 end UI.code_scroll.Position = UDim2.new(0, 8, 0, Y + 2) UI.code_scroll.Size = UDim2.new(1, -16, 1, -(Y + 10)) UI.relayout_details() action_buttons.Block.Text = blocked[Log.Remote] and "unblock" or "block" action_buttons.Block.TextColor3 = blocked[Log.Remote] and T.Bad or T.Text local log_name = UI.log_name(Log) action_buttons.BlockName.Text = log_name and blocked_names[log_name] and "unblock name" or "block name" action_buttons.BlockName.TextColor3 = log_name and blocked_names[log_name] and T.Bad or T.Text action_buttons.BlockName.Visible = log_name ~= nil action_buttons.IgnoreName.Visible = log_name ~= nil action_buttons.Decompile.Visible = Log.Info ~= nil and Log.Info.Stack ~= nil action_buttons.Freeze.Text = UI.frozen[Log.Remote] and "unfreeze" or "freeze" action_buttons.Freeze.TextColor3 = UI.frozen[Log.Remote] and T.Bad or T.Text action_buttons.Run.Text = (Log.Kind == "incoming" and "fire locally") or (Log.Kind == "require" and "require & dump") or "run" if Log.BindKey then action_buttons.Run.Text ..= " [" .. Log.BindKey .. "]" end if Log.Kind == "raknet" then action_buttons.Block.Visible = false action_buttons.BlockName.Visible = false action_buttons.IgnoreArgs.Visible = false end action_buttons.Run.Visible = Log.Kind ~= "kick" and Log.Kind ~= "shutdown" and Log.Kind ~= "parentnil" and Log.Kind ~= "create" and (Log.Kind ~= "lib" or UI.is_packet_log(Log)) and Log.Kind ~= "wait" and Log.Kind ~= "logservice" and (Log.Kind ~= "raknet" or Log.Method == "send") local ok, code = pcall(generate, call) show_code(ok and code or ("-- couldn't generate code: " .. tostring(code)), not keep_scroll) if ok and Settings.AutoCopy and not keep_scroll and X.SetClipboard then pcall(X.SetClipboard, code) set_status("auto copied code") end if not keep_scroll then UI.code_scroll.CanvasPosition = Vector2.new(0, 0) end render() end show_details(nil) UI.incoming_connections = { } do local function watch_incoming(remote) if UI.incoming_connections[remote] or self_ignore[remote] then return end local kind = remote.ClassName if kind ~= "RemoteEvent" and kind ~= "UnreliableRemoteEvent" then return end UI.incoming_connections[remote] = remote.OnClientEvent.Connect(remote.OnClientEvent, function(...) if active and not paused and Settings.Incoming and not ignored[remote] and not name_ignored(remote.Name) then push(remote, "OnClientEvent", "incoming", nil, nil, select("#", ...), ...) end end) end do local function set_incoming(Bool) if Bool then local ok, all = pcall(game.GetDescendants, game) for _, object in ok and all or { } do pcall(watch_incoming, object) end UI.incoming_added = UI.incoming_added or game.DescendantAdded.Connect(game.DescendantAdded, function(object) pcall(watch_incoming, object) end) else for remote, Connection in UI.incoming_connections do Connection.Disconnect(Connection) UI.incoming_connections[remote] = nil end if UI.incoming_added then UI.incoming_added.Disconnect(UI.incoming_added) UI.incoming_added = nil end end end UI.watch_click = function(detector) if UI.watched_clicks[detector] or not detector.IsA(detector, "ClickDetector") then return end UI.watched_clicks[detector] = true for _, Event in {"MouseClick", "RightMouseClick"} do Connect(detector[Event], function(player) if not active or paused or replaying or not Settings.Clicks or player ~= players.LocalPlayer then return end if os.clock() - (click_fired[detector] or 0) < 0.3 or ignored[detector] or name_ignored(detector.Name) then return end local distance = 0 pcall(function() local root = players.LocalPlayer.Character.HumanoidRootPart distance = (root.Position - detector.Parent.Position).Magnitude end) push(detector, "fireclickdetector", "click", nil, nil, 2, math.floor(distance * 100) / 100, Event) end) end end UI.watch_gui = function(Button) if UI.gui_watched[Button] or not Button.IsA(Button, "GuiButton") then return end UI.gui_watched[Button] = true local handler = function() if not active or paused or replaying or not Settings.GuiClicks or ignored[Button] or name_ignored(Button.Name) then return end push(Button, "Activated", "guiclick", nil, nil, 0) end UI.gui_handlers[handler] = true Connect(Button.Activated, handler) end UI.touch_name_match = function(other) local names = { } local current = other for _ = 1, 4 do if not current or current == workspace or current == game then break end table.insert(names, string.lower(current.Name)) current = current.Parent end for piece in string.gmatch(Settings.TouchNames, "[^,]+") do piece = string.lower(string.match(piece, "^%s*(.-)%s*$")) if piece ~= "" then for _, Name in names do local ok, found = pcall(string.find, Name, piece) if ok and found then return true end end end end return false end UI.log_touch = function(character, other, part) if not active or paused or replaying or not Settings.Touches or typeof(other) ~= "Instance" or not other.IsA(other, "BasePart") or other.IsA(other, "Terrain") then return end if other.IsDescendantOf(other, character) then return end local wired = false pcall(function() wired = other.FindFirstChild(other, "TouchInterest") ~= nil or other.FindFirstChildOfClass(other, "TouchTransmitter") ~= nil end) local tool_wired = false if Settings.ToolTouches and part then pcall(function() tool_wired = part.FindFirstAncestorOfClass(part, "Tool") ~= nil and (part.FindFirstChild(part, "TouchInterest") ~= nil or part.FindFirstChildOfClass(part, "TouchTransmitter") ~= nil) end) end if tool_wired and Settings.ToolOnlyWired and not wired then tool_wired = false end if not wired and not tool_wired and not Settings.TouchAll and not UI.touch_name_match(other) then return end local Now = os.clock() if Now - (click_fired[other] or 0) < 0.3 or Now - (UI.touch_seen[other] or 0) < 0.25 or ignored[other] or name_ignored(other.Name) then return end UI.touch_seen[other] = Now push(other, "firetouchinterest", "touch", nil, nil, 2, part, 0) end UI.watch_touch = function(character, part) if UI.touch_watched[part] or not part.IsA(part, "BasePart") then return end UI.touch_watched[part] = true Connect(part.Touched, function(other) UI.log_touch(character, other, part) end) end UI.watch_tool = function(Tool) if UI.tool_watched[Tool] or not Tool.IsA(Tool, "Tool") then return end UI.tool_watched[Tool] = true for signal, Method in {Activated = "Activate", Deactivated = "Deactivate"} do Connect(Tool[signal], function() if not active or paused or replaying or not Settings.Tools or ignored[Tool] or name_ignored(Tool.Name) then return end local Now = os.clock() if Now - (UI.tool_fired[Tool] or 0) < 0.3 then return end push(Tool, Method, "tool", nil, nil, 0) end) end for signal, Method in {Equipped = "Equipped", Unequipped = "Unequipped"} do Connect(Tool[signal], function() if not active or paused or replaying or not Settings.Tools or ignored[Tool] or name_ignored(Tool.Name) then return end push(Tool, Method, "tool", nil, nil, 0) end) end end UI.watch_tools = function(container) for _, object in container.GetChildren(container) do pcall(UI.watch_tool, object) end Connect(container.ChildAdded, function(object) pcall(UI.watch_tool, object) end) end UI.watch_character = function(character) pcall(UI.watch_tools, character) for _, object in character.GetDescendants(character) do pcall(UI.watch_touch, character, object) end Connect(character.DescendantAdded, function(object) pcall(UI.watch_touch, character, object) end) end UI.anim_seen = function(track, animator) if not active then return end local animation = track.Animation local raw = animation and animation.AnimationId if type(raw) ~= "string" or raw == "" or string.sub(raw, 1, 10) == "rbxasset:/" then return end local entry = UI.anims[raw] if entry then return end if not Settings.AnimDefaults and UI.anim_default_ids[string.match(raw, "%d+") or ""] then return end local model = animator.FindFirstAncestorOfClass(animator, "Model") entry = {Id = raw, Name = track.Name ~= "" and track.Name or animation.Name, Owner = model and model.Name or "?", Length = track.Length, Looped = track.Looped} UI.anims[raw] = entry table.insert(UI.anim_order, raw) UI.anim_dirty = true if Settings.Animations and not paused and not replaying then pcall(push, animation, "Play", "anim", nil, nil, 1, raw) end end UI.watch_animator = function(animator) if UI.anim_watched[animator] then return end UI.anim_watched[animator] = true Connect(animator.AnimationPlayed, function(track) pcall(UI.anim_seen, track, animator) end) for _, track in animator.GetPlayingAnimationTracks(animator) do pcall(UI.anim_seen, track, animator) end end UI.anim_add = function(object) local raw = object.AnimationId if type(raw) ~= "string" or raw == "" or string.sub(raw, 1, 10) == "rbxasset:/" then return end if not Settings.AnimDefaults and UI.anim_default_ids[string.match(raw, "%d+") or ""] then return end local path = object.GetFullName(object) if string.sub(path, 1, 7) == "CoreGui" or string.sub(path, 1, 12) == "CorePackages" then return end local entry = UI.game_anims[raw] if entry then entry.Copies += 1 return end UI.game_anims[raw] = {Id = raw, Name = object.Name, Path = path, Copies = 1} table.insert(UI.game_anim_order, raw) UI.game_anim_dirty = true end UI.anim_scan = function() if UI.anim_scanning then return end UI.anim_scanning = true UI.game_anims, UI.game_anim_order = { }, { } local done = 0 for _, object in game.GetDescendants(game) do if object.ClassName == "Animation" then pcall(UI.anim_add, object) end done += 1 if done % 3000 == 0 then task.wait() end end if getnilinstances then pcall(function() for _, object in getnilinstances() do if typeof(object) == "Instance" and object.ClassName == "Animation" then pcall(UI.anim_add, object) end end end) end if not UI.anim_scan_hooked then UI.anim_scan_hooked = true Connect(game.DescendantAdded, function(object) if object.ClassName == "Animation" then pcall(UI.anim_add, object) end end) end UI.anim_scanning = false UI.game_anim_dirty = true end UI.anim_info = function(Id) local num = tonumber(string.match(tostring(Id), "%d+")) if not num then return "no asset id in " .. tostring(Id) end local ok, Info = pcall(function() local market = game.GetService(game, "MarketplaceService") return market.GetProductInfo(market, num, Enum.InfoType.Asset) end) if not ok or type(Info) ~= "table" then return "couldn't read asset " .. num end return tostring(Info.Name) .. " by " .. tostring(Info.Creator and Info.Creator.Name) .. " (asset type " .. tostring(Info.AssetTypeId) .. ")" end UI.anim_http = function(Url) local Req = (syn and syn.request) or request or http_request or (http and http.request) if not Req then return nil, "this executor has no request function" end local ok, res = pcall(Req, {Url = Url, Method = "GET"}) if not ok or type(res) ~= "table" then return nil, "request failed" end if res.StatusCode ~= 200 then return nil, "HTTP " .. tostring(res.StatusCode) end local decoded, Data = pcall(function() return http_service.JSONDecode(http_service, res.Body) end) if not decoded then return nil, "unreadable answer" end return Data end UI.anim_api_add = function(num, Name) local Id = "rbxassetid://" .. tostring(num) if not UI.api_anims[Id] then UI.api_anims[Id] = {Id = Id, Name = Name or "?", Path = "creator animation"} table.insert(UI.api_anim_order, Id) elseif Name and UI.api_anims[Id].Name == "?" then UI.api_anims[Id].Name = Name end end UI.anim_api_load = function() if UI.anim_api_busy then return end UI.anim_api_busy = true UI.api_anims, UI.api_anim_order = { }, { } UI.api_status = "looking up the game's creator..." UI.api_dirty = true local ok, Info = pcall(function() local market = game.GetService(game, "MarketplaceService") return market.GetProductInfo(market, game.PlaceId) end) local creator = ok and type(Info) == "table" and Info.Creator if not creator then UI.api_status = "couldn't read the game's creator" UI.anim_api_busy = false UI.api_dirty = true return end local creator_id = creator.CreatorTargetId or creator.Id local is_group = creator.CreatorType == "Group" local failure if is_group then local ids = { } for page = 1, 10 do UI.api_status = "loading page " .. page .. " (group " .. tostring(creator.Name) .. ")..." UI.api_dirty = true local Data, why = UI.anim_http("https://apis.roblox.com/toolbox-service/v1/marketplace/24?limit=100&pageNumber=" .. page .. "&creatorType=2&creatorTargetId=" .. tostring(creator_id)) if not Data then failure = why break end local list = type(Data.data) == "table" and Data.data or { } for _, item in list do local num = type(item) == "table" and (item.id or (item.asset and item.asset.id)) or item if tonumber(num) then table.insert(ids, tonumber(num)) UI.anim_api_add(num, type(item) == "table" and (item.name or (item.asset and item.asset.name)) or nil) end end if #list == 0 then break end end else local cursor = "" for page = 1, 10 do UI.api_status = "loading page " .. page .. " (user " .. tostring(creator.Name) .. ")..." UI.api_dirty = true local Data, why = UI.anim_http("https://inventory.roblox.com/v2/users/" .. tostring(creator_id) .. "/inventory/24?limit=100&sortOrder=Asc" .. cursor) if not Data then failure = why break end for _, item in type(Data.data) == "table" and Data.data or { } do UI.anim_api_add(item.assetId or item.id, item.assetName or item.name) end if not Data.nextPageCursor then break end cursor = "&cursor=" .. tostring(Data.nextPageCursor) end end UI.api_status = #UI.api_anim_order .. " animations by " .. tostring(creator.Name) .. (failure and (" (stopped: " .. failure .. ")") or "") .. (#UI.api_anim_order == 0 and " - Roblox doesn't expose them for this creator" or "") UI.anim_api_busy = false UI.api_dirty = true end UI.anim_rbxm = function(Id, Name) if not writefile then return "no writefile in this executor" end local function U32(Value) return string.pack("") local dir = folder .. "/animations" if makefolder and isfolder then for _, path in {folder, dir} do if not isfolder(path) then pcall(makefolder, path) end end end local base = dir .. "/" .. (string.gsub(Name, "[^%w_%-]", "_")) .. "_" .. (string.match(tostring(Id), "%d+") or "anim") .. ".rbxm" local failure for _, path in {base, base .. ".txt"} do local ok, err = pcall(writefile, path, Data) if ok and (not isfile or isfile(path)) then return "saved " .. path .. (path ~= base and " (executor blocks .rbxm: remove the .txt)" or "") .. " [" .. #Data .. " bytes]" end failure = ok and "file was not created" or tostring(err) end return "couldn't write the file: " .. tostring(failure) end UI.anim_save = function(Id, Name) Name = tostring(Name or "Animation") local ok, sequence = pcall(function() local provider = game.GetService(game, "KeyframeSequenceProvider") return provider.GetKeyframeSequenceAsync(provider, tostring(Id)) end) if not ok or typeof(sequence) ~= "Instance" then return "keyframes unavailable (" .. tostring(sequence) .. "); " .. UI.anim_rbxm(Id, Name) end if not UI.ssi then local loaded, result = pcall(function() return loadstring(game.HttpGet(game, "https://raw.githubusercontent.com/luau/UniversalSynSaveInstance/main/saveinstance.luau", true), "saveinstance")() end) if not loaded or type(result) ~= "function" then return "couldn't load UniversalSynSaveInstance (" .. tostring(result) .. "); " .. UI.anim_rbxm(Id, Name) end UI.ssi = result end pcall(function() sequence.Name = Name end) local dir = folder .. "/animations" if makefolder and isfolder then for _, path in {folder, dir} do if not isfolder(path) then pcall(makefolder, path) end end end local path = dir .. "/" .. (string.gsub(Name, "[^%w_%-]", "_")) .. "_" .. (string.match(tostring(Id), "%d+") or "anim") .. "_keyframes.rbxm" local saved, err = pcall(UI.ssi, { mode = "invalid", ExtraInstances = {sequence}, IsModel = true, Binary = true, FilePath = path, ReadMe = false, ShowStatus = false, SafeMode = false, KillAllScripts = false, BoostFPS = false, AntiIdle = false, ShutdownWhenDone = false, Decompile = false, }) pcall(function() sequence.Destroy(sequence) end) if not saved then return "save failed (" .. tostring(err) .. "); " .. UI.anim_rbxm(Id, Name) end if isfile and not isfile(path) then return "saveinstance finished but no file at " .. path .. "; " .. UI.anim_rbxm(Id, Name) end return "saved keyframes to " .. path end UI.anim_match = function(...) if UI.anim_filter == "" then return true end for _, part in {...} do if string.find(string.lower(tostring(part)), UI.anim_filter, 1, true) then return true end end return false end UI.anim_stop_all = function() local count = 0 for Id, track in UI.anim_tracks do UI.anim_tracks[Id] = nil pcall(function() track.stop(track) end) count += 1 end local character = players.LocalPlayer.Character local humanoid = character and character.FindFirstChildOfClass(character, "Humanoid") local animator = humanoid and humanoid.FindFirstChildOfClass(humanoid, "Animator") if animator then local ok, tracks = pcall(function() return animator.GetPlayingAnimationTracks(animator) end) for _, track in ok and tracks or { } do pcall(function() track.stop(track) end) count += 1 end end UI.anim_dirty, UI.game_anim_dirty = true, true return "stopped " .. count .. " animations" end UI.anim_play = function(Id) local old = UI.anim_tracks[Id] if old then UI.anim_tracks[Id] = nil pcall(function() old.stop(old) end) return "stopped " .. Id end local character = players.LocalPlayer.Character local humanoid = character and character.FindFirstChildOfClass(character, "Humanoid") local loader = humanoid and (humanoid.FindFirstChildOfClass(humanoid, "Animator") or humanoid) if not loader then return "no character to play it on" end local animation = Instance.new("Animation") animation.AnimationId = Id local ok, track = pcall(function() return loader.LoadAnimation(loader, animation) end) if not ok or not track then return "couldn't load " .. Id end if not pcall(function() track.Priority = Enum.AnimationPriority.Action4 end) then pcall(function() track.Priority = Enum.AnimationPriority.action end) end local play_ok, play_err = pcall(function() track.Play(track) end) if not play_ok then return "play error: " .. tostring(play_err) end local waited = 0 while track.Length == 0 and waited < 2 do task.wait(0.1) waited += 0.1 end if track.Length == 0 then pcall(function() track.stop(track) end) return "Roblox won't play " .. Id .. " (track never loaded - not allowed to use this animation, or it isn't an animation)" end UI.anim_tracks[Id] = track Connect(track.Stopped, function() if UI.anim_tracks[Id] == track then UI.anim_tracks[Id] = nil UI.anim_dirty = true end end) return "playing " .. Id .. string.format(" (%.2fs)", track.Length) end UI.upvalue_spy = function(Name) Name = tostring(Name or "") local get = getupvalues or (debug and debug.getupvalues) if Name == "" then return "type the name of the function first" end if not (X.hook_function and get and filtergc) then return "needs hookfunction, getupvalues and filtergc" end local ok, found = pcall(filtergc, "function", {Name = Name, IgnoreExecutor = true}, false) if not ok or type(found) ~= "table" or #found == 0 then return "no game function named " .. Name end local state = UI.upvalue local hooks, watching = 0, 0 state.On = true for fn_index, fn in found do if fn_index > 15 then break end local got, ups = pcall(get, fn) for index, up in got and type(ups) == "table" and ups or { } do local label = "upvalue_" .. string.gsub(Name, "[^%w_]", "_") .. "_" .. index if type(up) == "function" then local is_executor = false pcall(function() is_executor = isexecutorclosure and isexecutorclosure(up) or false end) if not state.Hooked[up] and not is_executor and not X.is_c(up) then state.Hooked[up] = true local called = label .. "_" .. (debug.info(up, "n") ~= "" and debug.info(up, "n") or "anonymous") local old local done = pcall(function() old = X.hook_function(up, X.new_c_closure(function(...) if state.On and active and not paused and not state.Busy and not X.check_caller() then state.Busy = true pcall(function(...) push(called, called, "lib", X.get_calling_script(), nil, select("#", ...), ...) end, ...) state.Busy = false end return old(...) end)) end) if done then hooks += 1 else state.Hooked[up] = nil end end elseif type(up) ~= "table" and type(up) ~= "userdata" or typeof(up) == "Instance" then if watching < 80 and not state.Watched[fn] then state.Watched[fn] = state.Watched[fn] or { } end if watching < 80 and state.Watched[fn] and state.Watched[fn][index] == nil then state.Watched[fn][index] = {Last = up, Label = label .. "_changed"} watching += 1 end end end end if not state.Polling then state.Polling = true task.spawn(function() while active do task.wait(0.25) if state.On and not paused then for fn, slots in state.Watched do local got, ups = pcall(get, fn) if got and type(ups) == "table" then for index, slot in slots do local Value = ups[index] if not rawequal(Value, slot.Last) then local before = slot.Last slot.Last = Value pcall(push, slot.Label, slot.Label, "lib", nil, nil, 2, before, Value) end end end end end end end) end return "upvalue spy: " .. hooks .. " functions hooked, " .. watching .. " values watched (" .. math.min(#found, 15) .. " functions named " .. Name .. ")" end do local ok, service = pcall(function() return clone_ref(game.GetService(game, "ProximityPromptService")) end) if ok and service then Connect(service.PromptTriggered, function(Prompt, player) if not active or paused or replaying or not Settings.Prompts or player ~= players.LocalPlayer then return end if os.clock() - (__R.prompt_fired[Prompt] or 0) < 0.3 or ignored[Prompt] or name_ignored(Prompt.Name) then return end push(Prompt, "Triggered", "prompt", nil, nil, 0) end) end end do local ok, market = pcall(function() return clone_ref(game.GetService(game, "MarketplaceService")) end) if ok and market then for _, Name in {"PromptProductPurchaseFinished", "PromptGamePassPurchaseFinished", "PromptPurchaseFinished", "PromptBundlePurchaseFinished", "PromptPremiumPurchaseFinished"} do pcall(function() local handler handler = function(...) if not active or paused or replaying or not Settings.Purchases or ignored[market] or name_ignored(Name) then return end local listener = nil if getconnections then local got, list = pcall(getconnections, market[Name]) for _, Conn in got and list or { } do local Fn = Conn.Function if Fn and not UI.own_callbacks[Fn] then local ok_env, fenv = pcall(getfenv, Fn) local scr = ok_env and type(fenv) == "table" and rawget(fenv, "script") if typeof(scr) == "Instance" then listener = scr break end end end end push(market, Name, "purchase", listener, nil, select("#", ...), ...) end UI.own_callbacks[handler] = true Connect(market[Name], handler) end) end end end UI.watched_clicks = setmetatable({ }, {__mode = "k"}) task.spawn(function() local ok, all = pcall(game.GetDescendants, game) for index, object in ok and all or { } do pcall(UI.watch_click, object) if index % 3000 == 0 then task.wait() end end Connect(game.DescendantAdded, function(object) pcall(UI.watch_click, object) end) end) UI.gui_handlers = setmetatable({ }, {__mode = "k"}) UI.gui_watched = setmetatable({ }, {__mode = "k"}) UI.gui_signals = function(Button) local names = { } if getconnections then for _, Name in {"MouseButton1Click", "Activated", "MouseButton1Down", "MouseButton1Up"} do pcall(function() for _, Connection in getconnections(Button[Name]) do if not UI.gui_handlers[Connection.Function] then table.insert(names, Name) break end end end) end end return #names > 0 and names or {"Activated"} end task.spawn(function() local Gui = players.LocalPlayer.WaitForChild(players.LocalPlayer, "PlayerGui") for index, object in Gui.GetDescendants(Gui) do pcall(UI.watch_gui, object) if index % 2000 == 0 then task.wait() end end Connect(Gui.DescendantAdded, function(object) pcall(UI.watch_gui, object) end) end) UI.touch_seen = setmetatable({ }, {__mode = "k"}) UI.touch_watched = setmetatable({ }, {__mode = "k"}) UI.start_touch_poll = function() if UI.touch_polling then return end UI.touch_polling = true task.spawn(function() local inside = setmetatable({ }, {__mode = "k"}) while active and next(UI.touch_blocked) ~= nil do task.wait(0.1) local character = players.LocalPlayer.Character local root = character and character.FindFirstChild(character, "HumanoidRootPart") if root and Settings.Touches and not paused then local params = OverlapParams.new() params.FilterType = Enum.RaycastFilterType.Include params.FilterDescendantsInstances = {character} for part in UI.touch_blocked do pcall(function() if (part.Position - root.Position).Magnitude > part.Size.Magnitude / 2 + 25 then inside[part] = nil return end local hits = workspace.GetPartsInPart(workspace, part, params) if #hits > 0 then if not inside[part] then inside[part] = true UI.log_touch(character, part, hits[1]) end else inside[part] = nil end end) end end end UI.touch_polling = false end) end UI.tool_watched = setmetatable({ }, {__mode = "k"}) UI.tool_fired = setmetatable({ }, {__mode = "k"}) do local player = players.LocalPlayer if player.Character then task.spawn(pcall, UI.watch_character, player.Character) end task.spawn(function() local backpack = player.WaitForChild(player, "Backpack", 10) if backpack then pcall(UI.watch_tools, backpack) end Connect(player.ChildAdded, function(object) if object.IsA(object, "Backpack") then pcall(UI.watch_tools, object) end end) end) Connect(player.CharacterAdded, function(character) task.wait(0.5) pcall(UI.watch_character, character) end) end UI.anims = { } UI.anim_order = { } UI.anim_tracks = { } UI.anim_watched = setmetatable({ }, {__mode = "k"}) UI.anim_default_ids = { } for _, default_id in {507766388, 507766666, 507766951, 507777826, 507771019, 507767714, 507784897, 507785072, 507765000, 507767968, 507765644, 2506281703, 507768375, 522635514, 522638767, 507770239, 507770453, 507771955, 507772104, 507770818, 507770677, 180435571, 180435792, 180426354, 125750702, 180436148, 180436334, 178130996, 182393478, 129967478, 129967390} do UI.anim_default_ids[tostring(default_id)] = true end UI.game_anims, UI.game_anim_order = { }, { } task.spawn(UI.anim_scan) UI.api_anims, UI.api_anim_order, UI.api_status = { }, { }, "not loaded" UI.anim_filter = "" UI.anim_code = function(Id, loop) local entry = UI.anims[Id] local lines = { "-- generated by Larp Spy", "local Players = game:GetService(\"Players\")", "local Humanoid = Players.LocalPlayer.Character:WaitForChild(\"Humanoid\")", "local Animator = Humanoid:FindFirstChildOfClass(\"Animator\") or Humanoid", "", "local animation = Instance.new(\"Animation\")", "animation.AnimationId = " .. string.format("%q", tostring(Id)), "", "local track = Animator:LoadAnimation(animation)", "track.Priority = Enum.AnimationPriority.Action4", } if loop or (loop == nil and entry and entry.Looped) then table.insert(lines, "track.Looped = true") end table.insert(lines, "track:Play()") return table.concat(lines, "\n") end task.spawn(function() for index, object in workspace.GetDescendants(workspace) do if object.ClassName == "Animator" then pcall(UI.watch_animator, object) end if index % 3000 == 0 then task.wait() end end Connect(workspace.DescendantAdded, function(object) if object.ClassName == "Animator" then pcall(UI.watch_animator, object) end end) while active do task.wait(0.5) do for animator in UI.anim_watched do local ok, tracks = pcall(function() return animator.GetPlayingAnimationTracks(animator) end) if ok then for _, track in tracks do pcall(UI.anim_seen, track, animator) end end end end end end) UI.upvalue = {On = false, Hooked = { }, Watched = { }, Polling = false} do local prompt_original = setmetatable({ }, {__mode = "k"}) do local auto_shown = setmetatable({ }, {__mode = "k"}) do local function make_instant(Prompt) if not Prompt.IsA(Prompt, "ProximityPrompt") then return end if prompt_original[Prompt] == nil then prompt_original[Prompt] = Prompt.HoldDuration end Prompt.HoldDuration = 0 end do local function set_instant_prompts(Bool) if not Bool then for Prompt, hold in prompt_original do pcall(function() Prompt.HoldDuration = hold end) prompt_original[Prompt] = nil end end end do local function auto_fire(Prompt) if auto_shown[Prompt] then return end local token = { } auto_shown[Prompt] = token task.spawn(function() while active and Settings.AutoPrompts and auto_shown[Prompt] == token and Prompt.Parent do if Prompt.Enabled then replaying = true if X.fire_proximity then pcall(X.fire_proximity, Prompt) else pcall(function() Prompt.InputHoldBegin(Prompt) Prompt.InputHoldEnd(Prompt) end) end replaying = false end task.wait(math.max(0.05, tonumber(Settings.AutoPromptDelay) or 0.3)) end if auto_shown[Prompt] == token then auto_shown[Prompt] = nil end end) end UI.parse_watch = function() UI.watch_specs = { } for piece in string.gmatch(tostring(Settings.WatchSignals), "[^,]+") do local class, signal = string.match(piece, "^%s*([%w_]+)%.([%w_]+)%s*$") if class then table.insert(UI.watch_specs, {class, signal}) end end end UI.watch_object = function(object) for _, spec in UI.watch_specs do local ok_class, is_class = pcall(function() return object.IsA(object, spec[1]) end) if ok_class and is_class then local marks = UI.watch_marks[object] or { } UI.watch_marks[object] = marks if not marks[spec[2]] then local ok_signal, signal = pcall(function() return object[spec[2]] end) if ok_signal and typeof(signal) == "RBXScriptSignal" and pcall(function() Connect(signal, function(...) if not active or paused or replaying or #UI.watch_specs == 0 then return end local key = tostring(signal) local Event = string.match(key, "^Signal (.+)$") or key if ignored[key] or name_ignored(Event) then return end local before = #queue push(key, "replicatesignal", "replicatesignal", nil, false, select("#", ...), ...) local Log = queue[#queue] if Log and #queue > before then Log.Signal = signal Log.EventName = Event Log.Owner = object Log.OwnerSearched = true end end) end) then marks[spec[2]] = true end end end end end UI.scan_watch = function() local ok, all = pcall(game.GetDescendants, game) for index, object in ok and all or { } do if not active or #UI.watch_specs == 0 then return end pcall(UI.watch_object, object) if index % 3000 == 0 then task.wait() end end set_status("watching " .. #UI.watch_specs .. " signal" .. (#UI.watch_specs == 1 and "" or "s")) end do local ok, service = pcall(function() return clone_ref(game.GetService(game, "ProximityPromptService")) end) if ok and service then Connect(service.PromptShown, function(Prompt) if active and Settings.InstantPrompts then pcall(make_instant, Prompt) end if active and Settings.AutoPrompts then auto_fire(Prompt) end end) Connect(service.PromptHidden, function(Prompt) auto_shown[Prompt] = nil end) end end end UI.watch_specs = { } UI.watch_marks = setmetatable({ }, {__mode = "k"}) UI.parse_watch() Connect(game.DescendantAdded, function(object) if #UI.watch_specs > 0 then pcall(UI.watch_object, object) end end) if #UI.watch_specs > 0 then task.spawn(UI.scan_watch) end do local actor_source = [==[ local Channel = %CHANNEL% if not Channel then return end local G = (getgenv and getgenv()) or _G local Settings = game.GetService(game, "HttpService"):JSONDecode(%SETTINGS%) local Label = %LABEL% local State = G.__LarpSpyActor -- plain function calls, not method calls: a method call inside the hook would change the namecall method local function IdsOf(Object) local Ids = { } local Ok, Id = pcall(function() return Object.GetDebugId(Object) end) if Ok and type(Id) == "string" then table.insert(Ids, Id) end local OkName, Name = pcall(function() return Object.GetFullName(Object) end) if OkName and type(Name) == "string" then table.insert(Ids, "path:" .. Name) end return Ids end local function Note(Message) pcall(function() State.Channel.Fire(State.Channel, "note", Message) end) end local function Handle(Kind, A, B) if Kind == "settings" then State.Settings = A elseif Kind == "block" then State.Blocked[A] = B or nil elseif Kind == "ignore" then State.Ignored[A] = B or nil elseif Kind == "override" then -- B: json list of {i = argument index, v = value, n = true when the value is nil} local Spec = nil if B then local Ok, List = pcall(function() return game.GetService(game, "HttpService"):JSONDecode(B) end) if Ok and type(List) == "table" then Spec = { } for _, Item in List do local Value = nil if not Item.n then Value = Item.v end Spec[Item.i] = {Value = Value} end end end State.Overrides[A] = Spec if Spec then Note("actor " .. tostring(State.Label) .. " received an argument hook") end elseif Kind == "stop" then State.Active = false end end local function Listen(Target) Target.Event:Connect(function(Kind, A, B) if State.Channel ~= Target then return end Handle(Kind, A, B) end) end if State and State.Rev == 7 then State.Channel, State.Settings, State.Label, State.Active = Channel, Settings, Label, true State.Blocked, State.Ignored, State.Overrides = { }, { }, { } State.Apply = Handle Listen(Channel) return end -- a hook from an older version of this script stays installed in this actor, but with Active off it only passes calls through; -- the new hook below goes on top of it (so the old one doesn't log the original arguments a second time) if State then State.Active = false end State = {Rev = 7, Channel = Channel, Settings = Settings, Label = Label, Active = true, Blocked = { }, Ignored = { }, Overrides = { }} G.__LarpSpyActor = State State.Apply = Handle Listen(Channel) local Methods = {FireServer = true, fireServer = true, InvokeServer = true, invokeServer = true, Fire = true, Invoke = true, SendMessage = true, Activate = true, Deactivate = true, EquipTool = true, UnequipTools = true} local function Wanted(Class, Method) local S = State.Settings if Method == "FireServer" or Method == "fireServer" then return (Class == "RemoteEvent" and S.Events) or (Class == "UnreliableRemoteEvent" and S.Unreliable) elseif Method == "InvokeServer" or Method == "invokeServer" then return Class == "RemoteFunction" and S.Functions elseif Method == "Fire" then return Class == "BindableEvent" and S.Bindables elseif Method == "Invoke" then return Class == "BindableFunction" and S.Bindables elseif Method == "SendMessage" then return Class == "Actor" and S.ActorMessages elseif Method == "Activate" or Method == "Deactivate" then return Class == "Tool" and S.Tools elseif Method == "EquipTool" or Method == "UnequipTools" then return Class == "Humanoid" and S.Tools end end local function Capture(self, Method, ...) if not State.Active or typeof(self) ~= "Instance" or self == State.Channel then return false end if not Wanted(self.ClassName, Method) then return false end local FromExecutor = checkcaller and checkcaller() if FromExecutor and not State.Settings.Executor then return false end local Blocked, Spec, IsIgnored = false, nil, false if next(State.Blocked) ~= nil or next(State.Overrides) ~= nil or next(State.Ignored) ~= nil then for _, Id in IdsOf(self) do Blocked = Blocked or State.Blocked[Id] == true Spec = Spec or State.Overrides[Id] IsIgnored = IsIgnored or State.Ignored[Id] == true end end local Block = Blocked and not FromExecutor local Replace = nil if Spec and not Block and not FromExecutor then Replace = table.pack(...) for Index, Item in Spec do Replace[Index] = Item.Value if Index > Replace.n then Replace.n = Index end end pcall(State.Channel.Fire, State.Channel, "applied", self, State.Label) end if not IsIgnored then local Caller = getcallingscript and getcallingscript() or nil if not pcall(State.Channel.Fire, State.Channel, "call", self, Method, Caller, State.Label, select("#", ...), ...) then pcall(State.Channel.Fire, State.Channel, "call", self, Method, Caller, State.Label, 1, "") end end return Block, Replace end local Close = newcclosure or function(f) return f end local Old Old = hookmetamethod(game, "__namecall", Close(function(self, ...) local Method = getnamecallmethod() if Methods[Method] then local Ok, Block, Replace = pcall(Capture, self, Method, ...) if not Ok and not State.ErrorShown then State.ErrorShown = true Note("actor hook error: " .. tostring(Block)) end if Ok and Block then return nil end if setnamecallmethod then setnamecallmethod(Method) end if Ok and Replace then return Old(self, table.unpack(Replace, 1, Replace.n)) end end return Old(self, ...) end)) ]==] do local injected = { } do local function actor_settings() return {Events = Settings.Events, Functions = Settings.Functions, Unreliable = Settings.Unreliable, Bindables = Settings.Bindables, ActorMessages = Settings.ActorMessages, Tools = Settings.Tools, Executor = Settings.Executor} end do local function setup_channel() if channel then return true end if X.CreateCommChannel then local ok, Id, Event = pcall(X.CreateCommChannel) if ok and Event then channel = Event UI.channel_expression = "(get_comm_channel or (syn and syn.get_comm_channel))(" .. (type(Id) == "number" and tostring(Id) or string.format("%q", tostring(Id))) .. ")" end end if not channel then local Name = http_service.GenerateGUID(http_service, false) local Event = Instance.new("BindableEvent") Event.Name = Name if not pcall(function() Event.Parent = core_gui end) then Event.Parent = Gui end channel = Event UI.channel_expression = string.format(('(game:GetService("CoreGui"):FindFirstChild(%q) or (gethui and gethui():FindFirstChild(%q, true)))'), Name, Name) end self_ignore[channel] = true Connect(channel.Event, function(kind, remote, Method, script, label, count, ...) if kind == "note" then set_status(tostring(remote)) return end if kind == "applied" then if typeof(remote) == "Instance" then set_status("argument hook applied in " .. tostring(Method) .. ": " .. name_of(remote)) end return end if kind ~= "call" or not active or paused or typeof(remote) ~= "Instance" then return end if ignored[remote] or name_ignored(name_of(remote)) then return end local kind2 = __R.kind_of(class_of(remote), Method) if kind2 then push(remote, Method, kind2, script, label, count or select("#", ...), ...) end end) return true end do local function actor_targets() local targets = { } if X.get_actors and X.RunOnActor then local ok, list = pcall(X.get_actors) for index, Actor in ok and list or { } do table.insert(targets, {Key = Actor, Label = typeof(Actor) == "Instance" and UI.actor_label_of(Actor, index) or ("actor " .. index), Run = function(source) X.RunOnActor(Actor, source) end}) end elseif X.get_actor_threads and X.RunOnThread then local ok, list = pcall(X.get_actor_threads) for index, thread in ok and list or { } do table.insert(targets, {Key = thread, Label = "actor thread " .. index, Run = function(source) X.RunOnThread(thread, source) end}) end end return targets end do local function update_actor_info() if UI.actor_info then UI.actor_info.Text = UI.actor_status end end do local function inject_actors(force) if not Settings.Actors then UI.actor_status = "off" update_actor_info() return end if not ((X.get_actors and X.RunOnActor) or (X.get_actor_threads and X.RunOnThread)) then UI.actor_status = "not supported (needs getactors + run_on_actor)" update_actor_info() return end setup_channel() local json = http_service.JSONEncode(http_service, actor_settings()) local failed = 0 local added = 0 local ran = 0 for _, target in actor_targets() do if force or not injected[target.Key] then local source = string.gsub(string.gsub(string.gsub(actor_source , "%%CHANNEL%%", function() return UI.channel_expression end) , "%%SETTINGS%%", function() return string.format("%q", json) end) , "%%LABEL%%", function() return string.format("%q", target.Label) end) if pcall(target.Run, source) then ran += 1 if not injected[target.Key] then UI.injected_count += 1 added += 1 end injected[target.Key] = target.Run else failed += 1 end end end if ran > 0 then task.delay(0.5, UI.sync_actor_state) end UI.actor_status = UI.injected_count .. " actor" .. (UI.injected_count == 1 and "" or "s") .. " hooked" .. (failed > 0 and (", " .. failed .. " failed") or "") update_actor_info() end UI.channel_expression = nil UI.injected = injected UI.injected_count = 0 UI.actor_status = "off" sync_actors = function() if channel then pcall(function() channel.Fire(channel, "settings", actor_settings()) end) end end UI.settings_scroll = New("ScrollingFrame", { Parent = UI.settings_view, Position = UDim2.new(0, 6, 0, 6), Size = UDim2.new(1, -12, 1, -12), BackgroundTransparency = 1, BorderSizePixel = 0, ScrollBarThickness = 2, CanvasSize = UDim2.new(0, 0, 0, 0), AutomaticCanvasSize = Enum.AutomaticSize.Y, ScrollingDirection = Enum.ScrollingDirection.Y, }) UI.titles = UI.titles or { } do local columns = { } do local section_order = 0 do local set_accent do local function section(side, title) section_order += 1 local frame = New("Frame", {Parent = columns[side], LayoutOrder = section_order, Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundColor3 = T.Inline, BorderSizePixel = UI.classic and 2 or 0, BorderColor3 = T.Outline}) UI.Dual(Stroke(frame), "Border", "Outline") UI.only(Accent(New("Frame", {Parent = frame, Size = UDim2.new(1, 0, 0, 1), BorderSizePixel = 0, ZIndex = 2}), "BackgroundColor3")) UI.only(Glow(frame, 15, 0)) table.insert(UI.titles, Text(frame, {Position = UDim2.new(0, UI.classic and 7 or 10, 0, UI.classic and 5 or 6), Size = UDim2.new(1, UI.classic and -14 or -20, 0, UI.classic and 12 or 14), Text = title, FontFace = UI.bold_face, TextColor3 = UI.classic and T.Text or T.Accent})) local content = New("Frame", {Parent = frame, Position = UDim2.new(0, 8, 0, 24), Size = UDim2.new(1, -16, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1}) New("UIListLayout", {Parent = content, Padding = UDim.new(0, 6), SortOrder = Enum.SortOrder.LayoutOrder}) New("UIPadding", {Parent = frame, PaddingBottom = UDim.new(0, 8)}) return content end UI.apply_game_only = function(Bool) local function redraw() for _, draw in UI.check_draws do pcall(draw) end end if not writefile then Settings.GameOnly = false redraw() set_status("no writefile in this executor, settings can't be saved") return end ensure_folder() if Bool then pcall(writefile, UI.game_file, http_service.JSONEncode(http_service, Settings)) set_status("this game now has its own settings (" .. UI.game_key .. ")") else if not delfile then Settings.GameOnly = true redraw() set_status("can't go back to the shared settings: this executor has no delfile") return end pcall(delfile, UI.game_file) set_status("this game uses the shared settings again") end end UI.reset_config = function() for key, Value in UI.default_settings do Settings[key] = type(Value) == "table" and table.clone(Value) or Value end if delfile and isfile and isfile(UI.game_file) then pcall(delfile, UI.game_file) end save_settings() UI.classic = Settings.Look == "classic" pcall(function() UI.apply_look() end) pcall(function() UI.apply_colors() end) pcall(sync_actors) for _, draw in UI.check_draws do pcall(draw) end set_status("config reset to defaults") end do local function changed(key) if key == "GameOnly" then UI.apply_game_only(Settings.GameOnly) return end save_settings() if key == "Events" or key == "Functions" or key == "Unreliable" or key == "Bindables" or key == "Executor" then sync_actors() end end do local function check(content, label, key, on_change) local row = New("TextButton", {Parent = content, Size = UDim2.new(1, 0, 0, UI.classic and 16 or 18), BackgroundTransparency = 1, Text = "", AutoButtonColor = false}) local box = New("Frame", {Parent = row, AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0, 0, 0.5, 0), Size = UDim2.new(0, 14, 0, 14), BackgroundColor3 = T.Element, BorderSizePixel = 0}) local box_stroke = Stroke(box, T.Outline) UI.Round(box, 4) local fill = Accent(New("Frame", {Parent = box, Position = UDim2.new(0, UI.classic and 2 or 3, 0, UI.classic and 2 or 3), Size = UDim2.new(1, UI.classic and -4 or -6, 1, UI.classic and -4 or -6), BorderSizePixel = 0}), "BackgroundColor3") UI.Round(fill, 2) local icon_name = UI.check_icons[key] local icon = icon_name and kind_icons[icon_name] local Offset = icon and 16 or 0 local glyph if icon then glyph = New("ImageLabel", {Parent = row, BackgroundTransparency = 1, Position = UDim2.new(0, 22, 0.5, -6), Size = UDim2.new(0, 12, 0, 12), ScaleType = Enum.ScaleType.Fit, Image = icon, ImageColor3 = kind_color(icon_name)}) end local Name = Text(row, {Position = UDim2.new(0, 22 + Offset, 0, 0), Size = UDim2.new(1, -22 - Offset, 1, 0), Text = label}) table.insert(UI.check_rows, {row, box, fill, Name, Offset}) local marks = { } for _, spec in (UI.check_image and { } or {{6, -3, 2, -45}, {10.5, 1.8, 0, 45}}) do local mark = New("Frame", {Parent = box, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, spec[2], 0.5, spec[3]), Size = UDim2.new(0, 2, 0, spec[1]), Rotation = spec[4], BackgroundColor3 = T.Background, BorderSizePixel = 0, Visible = false, ZIndex = 3}) New("UICorner", {Parent = mark, CornerRadius = UDim.new(0, 1)}) table.insert(marks, mark) end if UI.check_image then table.insert(marks, New("ImageLabel", {Parent = box, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, 0, 0.5, 0), Size = UDim2.new(0, 14, 0, 14), BackgroundTransparency = 1, Image = UI.check_image, ImageColor3 = T.Background, ScaleType = Enum.ScaleType.Fit, Visible = false, ZIndex = 3})) end local hovered = false local function draw() local on = Settings[key] == true local bright = T.Accent.Lerp(T.Accent, Color3.new(1, 1, 1), 0.3) fill.Visible = false for _, mark in marks do mark.Visible = on end Tween(box, {BackgroundColor3 = on and (hovered and bright or T.Accent) or (hovered and T.Hover or T.Element)}) Tween(box_stroke, {Color = on and (hovered and bright or T.Accent) or (hovered and T.Accent or T.Outline)}) Name.TextColor3 = (on or hovered) and T.Text or T.Dim if glyph then Tween(glyph, {ImageTransparency = (on or hovered) and 0 or 0.55}) end end draw() table.insert(UI.check_draws, draw) Connect(row.MouseEnter, function() hovered = true draw() end) Connect(row.MouseLeave, function() hovered = false draw() end) Connect(row.MouseButton1Click, function() Settings[key] = not Settings[key] draw() changed(key) if on_change then on_change(Settings[key]) end end) end do local function choice(content, label, key, options, on_change) local row = New("Frame", {Parent = content, Size = UDim2.new(1, 0, 0, 18), BackgroundTransparency = 1}) Text(row, {Size = UDim2.new(0.5, 0, 0, 18), Text = label}) local open, hovering = false, false local visible = math.min(#options, 6) local buttons = { } local Arrow local holder = New("Frame", {Parent = row, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 0), Size = UDim2.new(0.5, 0, 0, 18), BackgroundColor3 = T.Element, BorderSizePixel = 0}) local holder_stroke = Stroke(holder, T.Outline) local picker = Text(holder, {Position = UDim2.new(0, 6, 0, 0), Size = UDim2.new(1, -28, 1, 0), Text = tostring(Settings[key])}, "TextButton") local drop = New("ScrollingFrame", {Parent = row, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 21), Size = UDim2.new(0.5, 0, 0, visible * 18 + 6), BackgroundColor3 = T.Element, BorderSizePixel = 0, ScrollBarThickness = 2, CanvasSize = UDim2.new(0, 0, 0, #options * 18 + 6), ScrollingDirection = Enum.ScrollingDirection.Y, Visible = false, ZIndex = 5}) Accent(drop, "ScrollBarImageColor3") Stroke(drop, T.Outline) New("UIListLayout", {Parent = drop, SortOrder = Enum.SortOrder.LayoutOrder}) New("UIPadding", {Parent = drop, PaddingTop = UDim.new(0, 3), PaddingBottom = UDim.new(0, 3), PaddingLeft = UDim.new(0, 3), PaddingRight = UDim.new(0, 5)}) local function paint() if open then Tween(holder_stroke, {Color = T.Accent}) Tween(holder, {BackgroundColor3 = T.Element}) elseif hovering then Tween(holder_stroke, {Color = T.Outline.Lerp(T.Outline, T.Accent, 0.5)}) Tween(holder, {BackgroundColor3 = T.Element.Lerp(T.Element, T.Hover, 0.5)}) else Tween(holder_stroke, {Color = T.Outline}) Tween(holder, {BackgroundColor3 = T.Element}) end end local function refresh() picker.Text = tostring(Settings[key]) for option, object in buttons do object.TextColor3 = Settings[key] == option and T.Accent or T.Text end end local function set_open(Bool) open = Bool if Bool then if UI.open_drop and UI.open_drop ~= set_open then UI.open_drop(false) end UI.open_drop = set_open elseif UI.open_drop == set_open then UI.open_drop = nil end drop.Visible = open UI.Smooth(row, {Size = UDim2.new(1, 0, 0, open and (18 + 3 + visible * 18 + 6 + 2) or 18)}, 0.3) UI.Smooth(Arrow, {Rotation = open and 180 or 0}, 0.3) paint() end Arrow = New("Frame", {Parent = holder, AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -6, 0.5, 0), Size = UDim2.new(0, 10, 0, 10), BackgroundTransparency = 1, ZIndex = 3}) if kind_icons.arrow then New("ImageLabel", {Parent = Arrow, Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1, Image = kind_icons.arrow, ImageColor3 = T.Dim, ScaleType = Enum.ScaleType.Fit, ZIndex = 3}) else for _, spec in {{-2.5, -45}, {2.5, 45}} do New("Frame", {Parent = Arrow, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, spec[1], 0.5, 0), Size = UDim2.new(0, 2, 0, 7), Rotation = spec[2], BackgroundColor3 = T.Dim, BorderSizePixel = 0, ZIndex = 3}) end end local Click = New("TextButton", {Parent = holder, Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1, Text = "", AutoButtonColor = false, ZIndex = 4}) Connect(Click.MouseEnter, function() hovering = true paint() end) Connect(Click.MouseLeave, function() hovering = false paint() end) Connect(Click.MouseButton1Click, function() set_open(not open) end) for index, option in options do local object = Text(drop, {LayoutOrder = index, Size = UDim2.new(1, 0, 0, 18), BackgroundColor3 = T.Hover, BackgroundTransparency = 1, Text = tostring(option)}, "TextButton") New("UIPadding", {Parent = object, PaddingLeft = UDim.new(0, 4)}) UI.Round(object, 4) buttons[option] = object Connect(object.MouseEnter, function() Tween(object, {BackgroundTransparency = 0.5}, 0.1) end) Connect(object.MouseLeave, function() Tween(object, {BackgroundTransparency = 1}, 0.1) end) Connect(object.MouseButton1Click, function() Settings[key] = option refresh() set_open(false) changed(key) if on_change then on_change(Settings[key]) end end) end refresh() end UI.multi_choice = function(content, label, key, options, empty_text, on_change) local row = New("Frame", {Parent = content, Size = UDim2.new(1, 0, 0, 18), BackgroundTransparency = 1}) Text(row, {Size = UDim2.new(0.5, 0, 0, 18), Text = label}) local open, hovering = false, false local visible = math.min(#options, 6) local buttons = { } local Arrow local holder = New("Frame", {Parent = row, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 0), Size = UDim2.new(0.5, 0, 0, 18), BackgroundColor3 = T.Element, BorderSizePixel = 0}) local holder_stroke = Stroke(holder, T.Outline) local picker = Text(holder, {Position = UDim2.new(0, 6, 0, 0), Size = UDim2.new(1, -28, 1, 0), Text = ""}, "TextButton") local drop = New("ScrollingFrame", {Parent = row, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 21), Size = UDim2.new(0.5, 0, 0, visible * 18 + 6), BackgroundColor3 = T.Element, BorderSizePixel = 0, ScrollBarThickness = 2, CanvasSize = UDim2.new(0, 0, 0, #options * 18 + 6), ScrollingDirection = Enum.ScrollingDirection.Y, Visible = false, ZIndex = 5}) Accent(drop, "ScrollBarImageColor3") Stroke(drop, T.Outline) New("UIListLayout", {Parent = drop, SortOrder = Enum.SortOrder.LayoutOrder}) New("UIPadding", {Parent = drop, PaddingTop = UDim.new(0, 3), PaddingBottom = UDim.new(0, 3), PaddingLeft = UDim.new(0, 3), PaddingRight = UDim.new(0, 5)}) local function paint() if open then Tween(holder_stroke, {Color = T.Accent}) elseif hovering then Tween(holder_stroke, {Color = T.Outline.Lerp(T.Outline, T.Accent, 0.5)}) else Tween(holder_stroke, {Color = T.Outline}) end end local function chosen() local set = { } for piece in string.gmatch(tostring(Settings[key]), "[^,]+") do set[string.match(piece, "^%s*(.-)%s*$")] = true end return set end local function refresh() local set, names = chosen(), { } for _, option in options do local on = set[option] == true buttons[option].Text = (on and "[x] " or "[ ] ") .. option buttons[option].TextColor3 = on and T.Accent or T.Text if on then table.insert(names, option) end end picker.Text = #names == 0 and (empty_text or "none") or table.concat(names, ", ") end local function set_open(Bool) open = Bool if Bool then if UI.open_drop and UI.open_drop ~= set_open then UI.open_drop(false) end UI.open_drop = set_open elseif UI.open_drop == set_open then UI.open_drop = nil end drop.Visible = open UI.Smooth(row, {Size = UDim2.new(1, 0, 0, open and (18 + 3 + visible * 18 + 6 + 2) or 18)}, 0.3) UI.Smooth(Arrow, {Rotation = open and 180 or 0}, 0.3) paint() end Arrow = New("Frame", {Parent = holder, AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -6, 0.5, 0), Size = UDim2.new(0, 10, 0, 10), BackgroundTransparency = 1, ZIndex = 3}) if kind_icons.arrow then New("ImageLabel", {Parent = Arrow, Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1, Image = kind_icons.arrow, ImageColor3 = T.Dim, ScaleType = Enum.ScaleType.Fit, ZIndex = 3}) else for _, spec in {{-2.5, -45}, {2.5, 45}} do New("Frame", {Parent = Arrow, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, spec[1], 0.5, 0), Size = UDim2.new(0, 2, 0, 7), Rotation = spec[2], BackgroundColor3 = T.Dim, BorderSizePixel = 0, ZIndex = 3}) end end local Click = New("TextButton", {Parent = holder, Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1, Text = "", AutoButtonColor = false, ZIndex = 4}) Connect(Click.MouseEnter, function() hovering = true paint() end) Connect(Click.MouseLeave, function() hovering = false paint() end) Connect(Click.MouseButton1Click, function() set_open(not open) end) for index, option in options do local object = Text(drop, {LayoutOrder = index, Size = UDim2.new(1, 0, 0, 18), BackgroundColor3 = T.Hover, BackgroundTransparency = 1, Text = tostring(option)}, "TextButton") New("UIPadding", {Parent = object, PaddingLeft = UDim.new(0, 4)}) UI.Round(object, 4) buttons[option] = object Connect(object.MouseEnter, function() Tween(object, {BackgroundTransparency = 0.5}, 0.1) end) Connect(object.MouseLeave, function() Tween(object, {BackgroundTransparency = 1}, 0.1) end) Connect(object.MouseButton1Click, function() local set, picked = chosen(), { } set[option] = not set[option] or nil for _, Name in options do if set[Name] then table.insert(picked, Name) end end Settings[key] = table.concat(picked, ", ") refresh() changed(key) if on_change then on_change(Settings[key]) end end) end refresh() table.insert(UI.check_draws, refresh) end do local function field(content, label, key, placeholder, parse, on_change) local row = New("Frame", {Parent = content, Size = UDim2.new(1, 0, 0, 18), BackgroundTransparency = 1}) Text(row, {Size = UDim2.new(0.5, 0, 1, 0), Text = label}) local box = Input(row, {AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 0), Size = UDim2.new(0.5, 0, 1, 0)}, placeholder) box.Text = tostring(Settings[key]) Connect(box.FocusLost, function() local Value = box.Text if parse then Value = parse(box.Text) end if Value == nil then box.Text = tostring(Settings[key]) return end Settings[key] = Value box.Text = tostring(Value) changed(key) if on_change then on_change(Value) end end) end do local function action(content, label, callback) Button(content, label, {Size = UDim2.new(1, 0, 0, 18)}, callback) end UI.net_hinted = function(Name) Name = string.lower(tostring(Name)) for _, hint in UI.net_hints do if string.find(Name, hint, 1, true) then return true end end return false end UI.net_score = function(caller, entry) return entry.Count + entry.Hint * 3 + (UI.net_hinted(caller.Name) and 5 or 0) end UI.net_report = function() local list = { } for caller, entry in UI.net_loaders do table.insert(list, {Caller = caller, Entry = entry, Score = UI.net_score(caller, entry)}) end if #list == 0 then set_status("network finder: nothing yet (turn it on, then rejoin or let the game load its modules)") return end table.sort(list, function(A, B) return A.Score > B.Score end) local lines = { } for index = 1, math.min(5, #list) do local item = list[index] local ok, path = pcall(path_of, item.Caller) table.insert(lines, string.format("%d. %s (%d modules, %d network-like, %s)", index, ok and path or item.Caller.Name, item.Entry.Count, item.Entry.Hint, item.Caller.ClassName)) end local best = list[1] local ok, path = pcall(path_of, best.Caller) if ok and X.SetClipboard then X.SetClipboard(path .. "\n\n" .. table.concat(lines, "\n")) end set_status("network finder: " .. (ok and path or best.Caller.Name) .. " (" .. best.Entry.Count .. " modules), top 5 copied") end -- decompiles every game script in a log's call stack (e.g. the script holding updatePosition) and copies the result UI.decompile_stack = function(Log) local decompile_fn = decompile if not decompile_fn then set_status("decompile stack: this executor has no decompile") return end local Info = Log and Log.Info if not (Info and Info.Stack) then set_status("decompile stack: this log has no call stack (turn on debug.info: full call stack, then catch a new call)") return end local order, frames_of = { }, { } for _, frame in Info.Stack do local instance = __R.resolve_source(frame.Source) if instance and instance.IsA(instance, "LuaSourceContainer") then if not frames_of[instance] then frames_of[instance] = { } table.insert(order, instance) end table.insert(frames_of[instance], (frame.Name or "") .. " (line " .. tostring(frame.Line) .. ")") end end if #order == 0 then set_status("decompile stack: no game scripts in this call stack") return end set_status("decompile stack: decompiling " .. #order .. " script(s)...") UI.show_source("call stack (decompiling...)", "-- decompiling " .. #order .. " script(s) from the call stack...") task.spawn(function() local parts = { } for index, Script in order do if not active then return end local ok_path, path = pcall(path_of, Script) local ok, text = pcall(decompile_fn, Script) table.insert(parts, table.concat({ "-- " .. string.rep("=", 60), "-- " .. (ok_path and path or Script.Name), "-- frames from the call stack: " .. table.concat(frames_of[Script], ", "), "-- the line numbers above are bytecode lines; the text below is numbered differently, so search for the function name", "-- " .. string.rep("=", 60), (ok and type(text) == "string") and text or ("-- decompile failed: " .. tostring(text)), }, "\n")) set_status("decompile stack: " .. index .. " / " .. #order) task.wait() end local report = table.concat(parts, "\n\n") report = string.gsub(string.gsub(report, "\r\n", "\n"), "\t", " ") UI.show_source("call stack (" .. #order .. " script" .. (#order == 1 and "" or "s") .. ")", report) set_status("decompile stack: " .. #order .. " script(s) shown (use copy in the viewer to copy)") end) end UI.debug_find_busy = false UI.debug_find_report = function(Title, lines, Total) local report = Title .. "\n" .. table.concat(lines, "\n") if X.SetClipboard then pcall(X.SetClipboard, report) else print(report) end set_status(Title .. " (" .. Total .. ")" .. (X.SetClipboard and ", copied to clipboard" or ", printed to the console")) end -- scans every running function: anything whose constants hold "debug" + "info", or that keeps debug.info in an upvalue UI.find_debug_info = function() local get_gc = getgc local get_constants = getconstants or (debug and debug.getconstants) local get_upvalues = getupvalues or (debug and debug.getupvalues) if not get_gc or not (get_constants or get_upvalues) then set_status("find debug.info: needs getgc and getconstants / getupvalues") return end if UI.debug_find_busy then set_status("find debug.info: already searching") return end UI.debug_find_busy = true set_status("find debug.info: scanning running functions...") task.spawn(function() local ok_scan, scan_error = pcall(function() local raw = raw_debug_info or debug.info local own = raw(1, "s") local targets = { } local function add_target(Function) if type(Function) == "function" then targets[Function] = true end end add_target(raw) add_target(debug.info) local game_debug = getrenv and getrenv().debug add_target(game_debug and game_debug.info) local is_executor = isexecutorclosure or is_executor_closure or checkclosure or is_synapse_function local found, seen = { }, { } local scanned = 0 for _, Function in get_gc(true) do scanned += 1 if scanned % 2500 == 0 then task.wait() if not active then return end end if type(Function) == "function" and not X.is_c(Function) and not (is_executor and is_executor(Function)) then local how if get_constants then local ok, constants = pcall(get_constants, Function) if ok and type(constants) == "table" then local has_debug, has_info = false, false for _, constant in constants do if constant == "debug" then has_debug = true elseif constant == "info" then has_info = true end end if has_debug and has_info then how = "constants: debug + info" end end end if not how and get_upvalues then local ok, upvalues = pcall(get_upvalues, Function) if ok and type(upvalues) == "table" then for _, Value in upvalues do if targets[Value] then how = "upvalue: debug.info" break end end end end if how then local ok, source, line, Name = pcall(raw, Function, "sln") if ok and source and source ~= own and source ~= "[C]" then local key = tostring(source) .. "|" .. tostring(line) .. "|" .. tostring(Name) if not seen[key] then seen[key] = true table.insert(found, {Source = source, Line = line, Name = (Name and Name ~= "") and Name or nil, How = how}) end end end end end if #found == 0 then set_status("find debug.info: nothing in " .. scanned .. " objects (the caller may be Roblox / executor code, or not loaded yet; try the call stack option)") return end table.sort(found, function(A, B) if A.Source ~= B.Source then return tostring(A.Source) < tostring(B.Source) end return (tonumber(A.Line) or 0) < (tonumber(B.Line) or 0) end) UI.debug_finds = found local lines = { } for index, item in found do if index > 150 then table.insert(lines, "... " .. (#found - 150) .. " more") break end table.insert(lines, string.format("%d. %s -> %s:%s (%s)", index, item.Name or "", UI.frame_path(item.Source), tostring(item.Line), item.How)) end UI.debug_find_report("debug.info used by " .. #found .. " function(s)", lines, #found .. " found") end) UI.debug_find_busy = false if not ok_scan then set_status("find debug.info failed: " .. tostring(scan_error)) end end) end -- decompiles every LocalScript / ModuleScript and looks for debug.info (or debug["info"]) in the text UI.search_debug_info_source = function() local decompile_fn = decompile if not decompile_fn then set_status("search debug.info: this executor has no decompile") return end if UI.debug_find_busy then set_status("search debug.info: already searching") return end UI.debug_find_busy = true set_status("search debug.info: collecting scripts...") task.spawn(function() local ok_scan, scan_error = pcall(function() local list = { } local ok_all, all = pcall(function() return getinstances and getinstances() or game.GetDescendants(game) end) if ok_all and type(all) == "table" then for index, object in all do if index % 1000 == 0 then task.wait() end local ok_class, wanted = pcall(function() return (object.IsA(object, "LocalScript") or object.IsA(object, "ModuleScript")) and not object.IsDescendantOf(object, core_gui) end) if ok_class and wanted then table.insert(list, object) if #list >= 3000 then break end end end end local total = #list local lines, hits, scripts_hit = { }, 0, 0 for index, Script in list do if not active then return end if index % 5 == 0 then set_status(string.format("search debug.info: decompiling %d / %d (%d hits)", index, total, hits)) end local ok, text = pcall(decompile_fn, Script) if ok and type(text) == "string" then local line_number, matched = 0, 0 for line in string.gmatch(text .. "\n", "(.-)\r?\n") do line_number += 1 if string.find(line, "debug%s*%.%s*info") or string.find(line, "debug%s*%[%s*[\"']info[\"']%s*%]") then matched += 1 hits += 1 if matched <= 10 then local shown = string.match(line, "^%s*(.-)%s*$") if #shown > 120 then shown = string.sub(shown, 1, 120) .. "..." end local ok_path, path = pcall(path_of, Script) table.insert(lines, string.format("%s:%d %s", ok_path and path or Script.Name, line_number, shown)) end end end if matched > 0 then scripts_hit += 1 end end if index % 3 == 0 then task.wait() end end if hits == 0 then set_status("search debug.info: not found in " .. total .. " decompiled scripts (could be Roblox / executor code, a server script, or an alias; try the call stack option)") return end UI.debug_find_report("debug.info found in " .. scripts_hit .. " script(s) [line numbers are lines of the decompiled text]", lines, hits .. " hits") end) UI.debug_find_busy = false if not ok_scan then set_status("search debug.info failed: " .. tostring(scan_error)) end end) end do local function Info(content, String) return Text(content, {Size = UDim2.new(1, 0, 0, 12), TextColor3 = T.Dim, Text = String, TextWrapped = true, AutomaticSize = Enum.AutomaticSize.Y, TextTruncate = Enum.TextTruncate.None}) end UI.keybind = function(content, label, key, allow_none) local row = New("Frame", {Parent = content, Size = UDim2.new(1, 0, 0, 18), BackgroundTransparency = 1}) Text(row, {Size = UDim2.new(0.5, 0, 1, 0), Text = label}) local box = Button(row, tostring(Settings[key]), {AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 0), Size = UDim2.new(0.5, 0, 1, 0)}) local function draw(waiting) box.Text = waiting and "press a key..." or tostring(Settings[key]) box.TextColor3 = waiting and T.Accent or T.Text end draw(false) table.insert(UI.check_draws, function() draw(false) end) Connect(box.MouseButton1Click, function() if UI.key_capture_cancel then UI.key_capture_cancel() end draw(true) UI.key_capture_cancel = function() UI.key_capture, UI.key_capture_cancel = nil, nil draw(false) end UI.key_capture = function(input_object) UI.key_capture, UI.key_capture_cancel = nil, nil local code = input_object.KeyCode if input_object.UserInputType ~= Enum.UserInputType.Keyboard or code == Enum.KeyCode.Escape or code == Enum.KeyCode.Unknown then draw(false) set_status("key not changed") return end if allow_none and (code == Enum.KeyCode.Backspace or code == Enum.KeyCode.Delete) then Settings[key] = "None" changed(key) draw(false) set_status(label .. " cleared") return end local other = key == "ToggleKey" and Settings.PauseKey or Settings.ToggleKey if code.Name == other or binds[code] then draw(false) set_status(code.Name .. " is already used, pick another") return end Settings[key] = code.Name changed(key) draw(false) set_status(label .. " = " .. code.Name) end end) end Accent(UI.settings_scroll, "ScrollBarImageColor3") New("UIPadding", {Parent = UI.settings_scroll, PaddingTop = UDim.new(0, 2), PaddingLeft = UDim.new(0, 2), PaddingRight = UDim.new(0, 8), PaddingBottom = UDim.new(0, 4)}) for index = 1, 2 do local column = New("Frame", {Parent = UI.settings_scroll, Position = UDim2.new((index - 1) * 0.5, index == 1 and 0 or 4, 0, 0), Size = UDim2.new(0.5, -6, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1}) New("UIListLayout", {Parent = column, Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder}) columns[index] = column end UI.theme_view = New("Frame", {Parent = inner, Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1, Visible = false}) UI.theme_scroll = New("ScrollingFrame", { Parent = UI.theme_view, Position = UDim2.new(0, 6, 0, 6), Size = UDim2.new(1, -12, 1, -12), BackgroundTransparency = 1, BorderSizePixel = 0, ScrollBarThickness = 2, CanvasSize = UDim2.new(0, 0, 0, 0), AutomaticCanvasSize = Enum.AutomaticSize.Y, ScrollingDirection = Enum.ScrollingDirection.Y, }) Accent(UI.theme_scroll, "ScrollBarImageColor3") New("UIPadding", {Parent = UI.theme_scroll, PaddingTop = UDim.new(0, 2), PaddingLeft = UDim.new(0, 2), PaddingRight = UDim.new(0, 8), PaddingBottom = UDim.new(0, 4)}) for index = 3, 4 do local column = New("Frame", {Parent = UI.theme_scroll, Position = UDim2.new((index - 3) * 0.5, index == 3 and 0 or 4, 0, 0), Size = UDim2.new(0.5, -6, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1}) New("UIListLayout", {Parent = column, Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder}) columns[index] = column end UI.blocks_view = New("Frame", {Parent = inner, Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1, Visible = false}) UI.blocks_scroll = New("ScrollingFrame", { Parent = UI.blocks_view, Position = UDim2.new(0, 6, 0, 6), Size = UDim2.new(1, -12, 1, -12), BackgroundTransparency = 1, BorderSizePixel = 0, ScrollBarThickness = 2, CanvasSize = UDim2.new(0, 0, 0, 0), AutomaticCanvasSize = Enum.AutomaticSize.Y, ScrollingDirection = Enum.ScrollingDirection.Y, }) Accent(UI.blocks_scroll, "ScrollBarImageColor3") New("UIPadding", {Parent = UI.blocks_scroll, PaddingTop = UDim.new(0, 2), PaddingLeft = UDim.new(0, 2), PaddingRight = UDim.new(0, 8), PaddingBottom = UDim.new(0, 4)}) for index = 5, 6 do local column = New("Frame", {Parent = UI.blocks_scroll, Position = UDim2.new((index - 5) * 0.5, index == 5 and 0 or 4, 0, 0), Size = UDim2.new(0.5, -6, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1}) New("UIListLayout", {Parent = column, Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder}) columns[index] = column end UI.misc_view = New("Frame", {Parent = inner, Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1, Visible = false}) UI.misc_scroll = New("ScrollingFrame", { Parent = UI.misc_view, Position = UDim2.new(0, 6, 0, 6), Size = UDim2.new(1, -12, 1, -12), BackgroundTransparency = 1, BorderSizePixel = 0, ScrollBarThickness = 2, CanvasSize = UDim2.new(0, 0, 0, 0), AutomaticCanvasSize = Enum.AutomaticSize.Y, ScrollingDirection = Enum.ScrollingDirection.Y, }) Accent(UI.misc_scroll, "ScrollBarImageColor3") New("UIPadding", {Parent = UI.misc_scroll, PaddingTop = UDim.new(0, 2), PaddingLeft = UDim.new(0, 2), PaddingRight = UDim.new(0, 8), PaddingBottom = UDim.new(0, 4)}) for index = 7, 8 do local column = New("Frame", {Parent = UI.misc_scroll, Position = UDim2.new((index - 7) * 0.5, index == 7 and 0 or 4, 0, 0), Size = UDim2.new(0.5, -6, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1}) New("UIListLayout", {Parent = column, Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder}) columns[index] = column end UI.check_draws = { } UI.check_icons = { Events = "event", Functions = "function", Unreliable = "unreliable", Bindables = "bindable", Incoming = "incoming", Direct = "event", Executor = "event", Require = "require", DebugCalls = "debuginfo", DebugInfo = "debuginfo", Kicks = "kick", Teleports = "teleport", FireSignals = "firesignal", ReplicateSignals = "replicatesignal", Connections = "connection", LogHistory = "loghistory", BlockEvents = "event", BlockFunctions = "function", BlockUnreliable = "unreliable", BlockBindables = "bindable", BlockActorMessages = "actormsg", BlockTools = "tool", BlockLogHistory = "loghistory", BlockHttp = "http", BlockPrompts = "prompt", BlockTouchCalls = "touch", BlockClickCalls = "click", BlockFireSignals = "firesignal", BlockReplicateSignals = "replicatesignal", Tables = "create", Buffers = "create", LogReaders = "connection", BlockLogReaders = "connection", BlockTables = "create", BlockBuffers = "create", Http = "http", Creates = "create", BlockCreates = "create", InstanceNew = "create", BlockInstanceNew = "create", BlockPrint = "create", BlockWarn = "create", BlockError = "create", BlockKicks = "kick", CoreState = "corestate", BlockCoreState = "corestate", Shutdowns = "shutdown", BlockShutdowns = "shutdown", ParentNil = "parentnil", BlockParentNil = "parentnil", BlockTeleports = "teleport", Prompts = "prompt", Touches = "touch", GuiClicks = "guiclick", Clicks = "click", Tools = "tool", ActorMessages = "actormsg", Actors = "actormsg", WatchActors = "actormsg", } for key, icon in { Animations = "anim", AnimDefaults = "anim", LogAnimations = "anim", NetFinder = "lib", Http = "http", CoreState = "corestate", Shutdowns = "shutdown", Creates = "create", InstanceNew = "instancenew", GetAttributes = "getattr", SetAttributes = "setattr", AttrAntiSpam = "setattr", Sounds = "sound", Waits = "wait", RakNet = "raknet", RakNetReceive = "raknet", Tables = "tables", Buffers = "buffers", LogService = "logservice", LogBacklog = "logservice", ParentNil = "parentnil", LogReaders = "logservice", Prompts = "prompt", InstantPrompts = "prompt", AutoPrompts = "prompt", Touches = "touch", ToolOnlyWired = "touch", TouchAll = "touch", GuiClicks = "guiclick", Clicks = "click", Tools = "tool", ActorMessages = "actormsg", Actors = "actors", WatchActors = "actors", Purchases = "purchase", BlockPurchases = "purchase", OwnsSpoof = "purchase", BlockKicks = "kick", BlockCoreState = "corestate", BlockTeleports = "teleport", BlockShutdowns = "shutdown", BlockCreates = "create", BlockInstanceNew = "instancenew", BlockSounds = "sound", BlockGetAttributes = "getattr", BlockSetAttributes = "setattr", BlockWaits = "wait", BlockPrint = "logservice", BlockWarn = "logservice", BlockError = "logservice", BlockTables = "tables", BlockBuffers = "buffers", BlockLogReaders = "logservice", BlockTools = "tool", SmartPaths = "code", Beautify = "code", BeautifyRename = "code", TrackRenames = "code", RemoteVariable = "code", StripComments = "code", CallViaFunction = "code", EscapeUnicode = "code", GetAttrCodeSet = "code", CallerComment = "code", DecodeBuffers = "code", HookPackets = "code", BufferCode = "code", ShowSchema = "code", StackToTop = "logs", AntiSpam = "logs", UpvalueSpy = "lib", GameOnly = "settings", UseOthHook = "settings", AskAdonis = "settings", } do UI.check_icons[key] = UI.check_icons[key] or icon end UI.net_loaders = setmetatable({ }, {__mode = "k"}) UI.net_hints = {"net", "remote", "packet", "event", "signal", "client", "replic", "comm", "bridge", "rpc", "socket"} UI.net_find = function(module) if not active or typeof(module) ~= "Instance" or X.check_caller() then return end local caller = X.get_calling_script() if typeof(caller) ~= "Instance" or caller == module then return end local entry = UI.net_loaders[caller] if not entry then entry = {Count = 0, Hint = 0, Seen = setmetatable({ }, {__mode = "k"})} UI.net_loaders[caller] = entry end if entry.Seen[module] then return end entry.Seen[module] = true entry.Count += 1 if UI.net_hinted(module.Name) then entry.Hint += 1 end local Min = tonumber(Settings.NetFinderMin) or 8 if entry.Count >= Min and not entry.Told then entry.Told = true task.defer(function() local ok, path = pcall(path_of, caller) set_status("network finder: " .. (ok and path or caller.Name) .. " loads " .. entry.Count .. "+ modules") end) end end ;(function() do local hooks = section(1, "hooks") check(hooks, "RemoteEvent:FireServer", "Events") check(hooks, "RemoteFunction:InvokeServer", "Functions") check(hooks, "UnreliableRemoteEvent:FireServer", "Unreliable") check(hooks, "Bindable Fire / Invoke", "Bindables") check(hooks, "Incoming OnClientEvent", "Incoming", set_incoming) check(hooks, "Direct calls (Remote.FireServer(Remote))", "Direct") check(hooks, "Calls from executor scripts", "Executor") Info(hooks, "hook: " .. hook_status .. (X.hook_function and ", direct calls hooked" or ", no hookfunction")) end do UI.anim_view = New("Frame", {Parent = inner, Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1, Visible = false}) local anim_scroll = New("ScrollingFrame", {Parent = UI.anim_view, Position = UDim2.new(0, 6, 0, 6), Size = UDim2.new(1, -12, 1, -12), BackgroundTransparency = 1, BorderSizePixel = 0, ScrollBarThickness = 2, CanvasSize = UDim2.new(0, 0, 0, 0), AutomaticCanvasSize = Enum.AutomaticSize.Y, ScrollingDirection = Enum.ScrollingDirection.Y}) Accent(anim_scroll, "ScrollBarImageColor3") New("UIPadding", {Parent = anim_scroll, PaddingTop = UDim.new(0, 2), PaddingLeft = UDim.new(0, 2), PaddingRight = UDim.new(0, 8), PaddingBottom = UDim.new(0, 4)}) New("UIListLayout", {Parent = anim_scroll, Padding = UDim.new(0, 5), SortOrder = Enum.SortOrder.LayoutOrder}) check(anim_scroll, "Log animations (not Roblox's)", "Animations") check(anim_scroll, "include Roblox default ones", "AnimDefaults") action(anim_scroll, "stop all animations (mine + playing on my character)", function() UI.anim_say(UI.anim_stop_all()) end) local anim_search = Input(anim_scroll, {Size = UDim2.new(1, 0, 0, 20)}, "search name / owner / path / id...") Connect(anim_search.GetPropertyChangedSignal(anim_search, "Text"), function() UI.anim_filter = string.lower(anim_search.Text) local stamp = os.clock() UI.anim_search_stamp = stamp task.delay(0.25, function() if UI.anim_search_stamp == stamp then UI.anim_dirty, UI.game_anim_dirty, UI.api_dirty = true, true, true end end) end) local anim_note = Info(anim_scroll, "") UI.anim_say = function(Message) Message = tostring(Message) anim_note.Text = Message anim_note.TextColor3 = T.Accent set_status(Message) print("[Larp Spy] " .. Message) end local anim_count = Info(anim_scroll, "no animations seen yet - right click one to play it or copy the code") local anim_list = New("Frame", {Parent = anim_scroll, Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1}) New("UIListLayout", {Parent = anim_list, Padding = UDim.new(0, 3), SortOrder = Enum.SortOrder.LayoutOrder}) local function anim_menu(entry) local playing = UI.anim_tracks[entry.Id] ~= nil UI.open_menu({ {playing and "stop" or "play on me", function() UI.anim_say(UI.anim_play(entry.Id)) UI.anim_dirty = true UI.game_anim_dirty = true end}, {"copy code", function() UI.copy_text(UI.anim_code(entry.Id, false)) end}, {"copy code (looped)", function() UI.copy_text(UI.anim_code(entry.Id, true)) end}, {"copy id", function() UI.copy_text(entry.Id) end}, {"asset info (name / creator)", function() UI.anim_say(UI.anim_info(entry.Id)) end}, {"save as .rbxm (keyframes)", function() UI.anim_say("saving keyframes...") local ok, Message = pcall(UI.anim_save, entry.Id, entry.Name) UI.anim_say(ok and Message or ("save failed: " .. tostring(Message))) end}, {"play + save as .rbxm (keyframes)", function() local play_message = UI.anim_tracks[entry.Id] and "already playing" or UI.anim_play(entry.Id) UI.anim_say(play_message .. " - saving keyframes...") local ok, Message = pcall(UI.anim_save, entry.Id, entry.Name) UI.anim_say(ok and (play_message .. " | " .. Message) or ("save failed: " .. tostring(Message))) UI.anim_dirty, UI.game_anim_dirty, UI.api_dirty = true, true, true end}, {"save as .rbxm (id only)", function() local ok, Message = pcall(UI.anim_rbxm, entry.Id, entry.Name) UI.anim_say(ok and Message or ("save failed: " .. tostring(Message))) end}, }, 220) end UI.anim_refresh = function() for _, child in anim_list.GetChildren(anim_list) do if child.IsA(child, "GuiObject") then child.Destroy(child) end end anim_count.Text = #UI.anim_order .. " animations seen, newest first (click or right click: play / copy code)" local shown = 0 for index = #UI.anim_order, 1, -1 do local entry = UI.anims[UI.anim_order[index]] if not UI.anim_match(entry.Name, entry.Owner, entry.Id) then continue end shown += 1 if shown > 100 then break end local row = Text(anim_list, {LayoutOrder = shown, Size = UDim2.new(1, 0, 0, 32), BackgroundColor3 = T.Inline, BackgroundTransparency = 0.3, Text = ""}, "TextButton") Text(row, {Position = UDim2.new(0, 6, 0, 2), Size = UDim2.new(1, -12, 0, 13), Text = (UI.anim_tracks[entry.Id] and "[playing] " or "") .. entry.Name .. " - " .. entry.Owner .. string.format(" (%.1fs%s)", entry.Length, entry.Looped and ", loop" or ""), TextTruncate = Enum.TextTruncate.AtEnd}) Text(row, {Position = UDim2.new(0, 6, 0, 16), Size = UDim2.new(1, -12, 0, 13), Text = entry.Id, TextColor3 = T.Dim, TextTruncate = Enum.TextTruncate.AtEnd}) Connect(row.MouseEnter, function() row.BackgroundTransparency = 0.1 end) Connect(row.MouseLeave, function() row.BackgroundTransparency = 0.3 end) Connect(row.MouseButton1Click, function() anim_menu(entry) end) Connect(row.MouseButton2Click, function() anim_menu(entry) end) end end Text(anim_scroll, {Size = UDim2.new(1, 0, 0, 16), Text = "game animations (Animation instances in the game)", FontFace = UI.bold_face, TextColor3 = T.Accent}) local game_count = Info(anim_scroll, "scanning...") action(anim_scroll, "scan the game again", function() set_status("scanning the game for animations...") task.spawn(UI.anim_scan) UI.game_anim_dirty = true end) local game_list = New("Frame", {Parent = anim_scroll, Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1}) New("UIListLayout", {Parent = game_list, Padding = UDim.new(0, 3), SortOrder = Enum.SortOrder.LayoutOrder}) UI.game_anim_refresh = function() for _, child in game_list.GetChildren(game_list) do if child.IsA(child, "GuiObject") then child.Destroy(child) end end game_count.Text = #UI.game_anim_order .. " animation ids in the game" .. (UI.anim_scanning and " (scanning...)" or "") .. " - click or right click: play / copy code" local game_shown = 0 for _, Id in UI.game_anim_order do local entry = UI.game_anims[Id] if not UI.anim_match(entry.Name, entry.Path, entry.Id) then continue end game_shown += 1 if game_shown > 300 then break end local index = game_shown local row = Text(game_list, {LayoutOrder = index, Size = UDim2.new(1, 0, 0, 32), BackgroundColor3 = T.Inline, BackgroundTransparency = 0.3, Text = ""}, "TextButton") Text(row, {Position = UDim2.new(0, 6, 0, 2), Size = UDim2.new(1, -12, 0, 13), Text = (UI.anim_tracks[Id] and "[playing] " or "") .. entry.Path .. (entry.Copies > 1 and (" x" .. entry.Copies) or ""), TextTruncate = Enum.TextTruncate.AtEnd}) Text(row, {Position = UDim2.new(0, 6, 0, 16), Size = UDim2.new(1, -12, 0, 13), Text = Id, TextColor3 = T.Dim, TextTruncate = Enum.TextTruncate.AtEnd}) Connect(row.MouseEnter, function() row.BackgroundTransparency = 0.1 end) Connect(row.MouseLeave, function() row.BackgroundTransparency = 0.3 end) Connect(row.MouseButton1Click, function() anim_menu(entry) end) Connect(row.MouseButton2Click, function() anim_menu(entry) end) end end Text(anim_scroll, {Size = UDim2.new(1, 0, 0, 16), Text = "creator animations (Roblox API)", FontFace = UI.bold_face, TextColor3 = T.Accent}) local api_count = Info(anim_scroll, UI.api_status) action(anim_scroll, "load the game creator's animations from the Roblox API", function() task.spawn(UI.anim_api_load) end) local api_list = New("Frame", {Parent = anim_scroll, Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1}) New("UIListLayout", {Parent = api_list, Padding = UDim.new(0, 3), SortOrder = Enum.SortOrder.LayoutOrder}) UI.api_anim_refresh = function() for _, child in api_list.GetChildren(api_list) do if child.IsA(child, "GuiObject") then child.Destroy(child) end end api_count.Text = UI.api_status local api_shown = 0 for _, Id in UI.api_anim_order do local entry = UI.api_anims[Id] if not UI.anim_match(entry.Name, entry.Id) then continue end api_shown += 1 if api_shown > 300 then break end local row = Text(api_list, {LayoutOrder = api_shown, Size = UDim2.new(1, 0, 0, 32), BackgroundColor3 = T.Inline, BackgroundTransparency = 0.3, Text = ""}, "TextButton") Text(row, {Position = UDim2.new(0, 6, 0, 2), Size = UDim2.new(1, -12, 0, 13), Text = (UI.anim_tracks[Id] and "[playing] " or "") .. entry.Name, TextTruncate = Enum.TextTruncate.AtEnd}) Text(row, {Position = UDim2.new(0, 6, 0, 16), Size = UDim2.new(1, -12, 0, 13), Text = Id, TextColor3 = T.Dim, TextTruncate = Enum.TextTruncate.AtEnd}) Connect(row.MouseEnter, function() row.BackgroundTransparency = 0.1 end) Connect(row.MouseLeave, function() row.BackgroundTransparency = 0.3 end) Connect(row.MouseButton1Click, function() anim_menu(entry) end) Connect(row.MouseButton2Click, function() anim_menu(entry) end) end end task.spawn(function() while active do task.wait(1) if UI.api_dirty then UI.api_dirty = false pcall(UI.api_anim_refresh) end if UI.anim_dirty then UI.anim_dirty = false pcall(UI.anim_refresh) end if UI.game_anim_dirty then UI.game_anim_dirty = false pcall(UI.game_anim_refresh) end end end) end do local extra = section(1, "other spies") check(extra, "HTTP requests (request, HttpGet, HttpService)", "Http", function(Bool) if Bool and not UI.install_http() then set_status("couldn't hook the request functions (needs hookfunction); HttpGet / HttpService calls are still logged") end end) check(extra, "require (ModuleScripts)", "Require", function(Bool) if Bool and not install_require() then set_status("couldn't hook require (needs hookfunction + getrenv)") end end) check(extra, "auto network finder (script loading many modules)", "NetFinder", function(Bool) if Bool and not install_require() then set_status("couldn't hook require (needs hookfunction + getrenv)") end end) field(extra, " announce at (modules)", "NetFinderMin", "8", function(String) return tonumber(String) end) action(extra, "show network loaders (copies top 5)", function() UI.net_report() end) Info(extra, "Finds the game script that requires the most modules (usually the network loader) and shows it in the status bar. Turn it on before the game loads, or rejoin.") check(extra, "debug.info calls (hooks debug.info)", "DebugCalls", function(Bool) if Bool and not install_debug_info() then set_status("couldn't hook debug.info (needs hookfunction)") end end) choice(extra, "debug.info rows", "DebugGroup", {"caller", "script", "all"}) check(extra, "debug.info: full call stack (shows the real call site)", "DebugStack") action(extra, "find debug.info usages (running functions)", function() UI.find_debug_info() end) action(extra, "find debug.info usages (decompile scripts)", function() UI.search_debug_info_source() end) Info(extra, "Call stack adds every calling function (script, function name, line) to the debug.info code view, not just the guessed caller script. The two find buttons search for scripts that use debug.info without waiting for a call; results are copied to the clipboard.") check(extra, "LogService:GetLogHistory (output scanning)", "LogHistory") check(extra, "LocalPlayer:Kick", "Kicks") UI.enable_all = function() local Gui = game.GetService(game, "StarterGui") shared.EnablingCore = true local ok = pcall(function() Gui.SetCoreGuiEnabled(Gui, Enum.CoreGuiType.All, true) Gui.SetCoreGuiEnabled(Gui, Enum.CoreGuiType.Backpack, true) Gui.SetCoreGuiEnabled(Gui, Enum.CoreGuiType.Health, true) Gui.SetCoreGuiEnabled(Gui, Enum.CoreGuiType.PlayerList, true) Gui.SetCoreGuiEnabled(Gui, Enum.CoreGuiType.EmotesMenu, true) Gui.SetCore(Gui, "ResetButtonCallback", true) end) shared.EnablingCore = false set_status(ok and "enabled reset button, backpack, health, player list, emotes" or "couldn't enable everything") end check(extra, "Reset / inventory toggles (SetCore, SetCoreGuiEnabled)", "CoreState") check(extra, "Teleports (TeleportService)", "Teleports") check(extra, "Purchases (UserOwnsGamePassAsync, prompts, PurchaseFinished)", "Purchases") check(extra, "game:Shutdown()", "Shutdowns") check(extra, "buffer.create / table.create", "Creates") check(extra, "Instance.new", "InstanceNew", function() UI.set_instance_new() end) check(extra, "Instance:GetAttribute", "GetAttributes", function() UI.set_misc() end) check(extra, "Instance:SetAttribute", "SetAttributes", function() UI.set_misc() end) UI.multi_choice(extra, " attribute targets", "AttrTargets", {"LocalPlayer", "Character", "Workspace", "Humanoid", "Tool", "PlayerGui", "ReplicatedStorage", "Other players"}, "all") check(extra, " anti spam (same instance + same args)", "AttrAntiSpam") Info(extra, "Only logs calls on the picked targets. None picked = every instance.") check(extra, "Sound:Play", "Sounds", function() UI.set_misc() end) check(extra, "task.wait / wait", "Waits", function() UI.set_wait() end) check(extra, "RakNet send hook (log outgoing packets)", "RakNet", function() UI.set_raknet() end) check(extra, "RakNet receive hook (log incoming packets)", "RakNetReceive", function() UI.set_raknet() end) Info(extra, "Uses raknet.add_send_hook / add_receive_hook (Potassium). Hooks only fire if RakNet hooks are also enabled in the executor's own UI settings, and the executor warns this can get you banned. Off by default. Sent packets can be sent again with run (raknet.send).") check(extra, "table.* (every function: insert, remove, sort...)", "Tables", function() UI.set_lib() end) check(extra, "buffer.* (every function: read / write, copy...)", "Buffers", function() UI.set_lib() end) field(extra, " max logged per frame (0 = all)", "LibRate", "60", function(String) local Value = tonumber(String) return Value and math.clamp(math.floor(Value), 0, 100000) or nil end) field(extra, " max entries copied per table (0 = all)", "LibBigTables", "200", function(String) local Value = tonumber(String) return Value and math.clamp(math.floor(Value), 0, 100000) or nil end) Info(extra, "Table / buffer calls are capped per frame, so xN counts are a minimum. Actor scripts aren't seen.") check(extra, "LogService output (print / warn / error)", "LogService", function(Bool) if Bool and Settings.LogBacklog then UI.load_log_backlog() end end) choice(extra, " message types", "LogTypes", {"all", "no info", "warnings + errors", "errors only"}) check(extra, " also load the existing output", "LogBacklog", function(Bool) if Bool and Settings.LogService then UI.load_log_backlog() end end) check(extra, "LocalPlayer.Parent = nil", "ParentNil") check(extra, "Signal connections (:Connect / :Once)", "Connections", function(Bool) UI.sync_connections() end) check(extra, "LogService.MessageOut readers (game connections)", "LogReaders", function(Bool) if UI.sync_connections() and Bool then UI.scan_log_readers() end end) action(extra, " scan existing MessageOut connections", function() UI.scan_log_readers() end) check(extra, "firesignal (executor scripts)", "FireSignals") check(extra, "replicatesignal (executor scripts)", "ReplicateSignals") field(extra, " watch signals (engine fired)", "WatchSignals", "Humanoid.ServerResetCharacter, Player.Sig", nil, function() UI.parse_watch() if #UI.watch_specs > 0 then task.spawn(UI.scan_watch) else set_status("watch signals cleared (connections already made stay until you rerun the script)") end end) Info(extra, "Comma separated Class.Signal pairs for engine-fired signals (reset button, friend request, block). Logged as replicatesignal rows.") check(extra, "ProximityPrompt (triggers + fireproximityprompt)", "Prompts") check(extra, "TouchInterest (your touches + firetouchinterest)", "Touches") check(extra, " tool touches (mop, sword...)", "ToolTouches") check(extra, " only if touched part has TouchInterest", "ToolOnlyWired") check(extra, " also parts without a TouchInterest", "TouchAll") field(extra, " always log touch names", "TouchNames", "kill, lava, damage", nil) check(extra, "GUI buttons you click (firesignal)", "GuiClicks") check(extra, "ClickDetector (your clicks + fireclickdetector)", "Clicks") check(extra, "Tools: Activate / Deactivate / Equip / Unequip (your tools + calls)", "Tools") field(extra, " upvalue spy: function name", "UpvalueFn", "name of the game function") check(extra, "Upvalue spy (calls + changes of a game function's upvalues)", "UpvalueSpy", function(Bool) if Bool then set_status(UI.upvalue_spy(Settings.UpvalueFn)) else UI.upvalue.On = false set_status("upvalue spy paused") end end) check(extra, "Actor:SendMessage (messages sent to actors)", "ActorMessages") if not X.hook_function or not (X.FireSignal or X.ReplicateSignal) then Info(extra, "firesignal / replicatesignal spying needs hookfunction and those functions.") end Info(extra, shared.Installed.Legacy and "old hooks from an earlier version: rejoin for kick / teleport spying" or "blocked kicks and teleports are logged too") end do local actors = section(1, "actors") check(actors, "Spy on actors", "Actors", function(Bool) if Bool then inject_actors(false) else UI.actor_status = "off (actors already hooked keep logging until you rejoin)" if channel then pcall(function() channel.Fire(channel, "stop") end) end injected = { } UI.injected = injected UI.injected_count = 0 update_actor_info() end end) check(actors, "Watch for new actors", "WatchActors") action(actors, "hook actors now", function() inject_actors(true) end) UI.actor_info = Info(actors, UI.actor_status) Info(actors, "Actors run in their own VM. This hooks each one and sends its calls back here.") end do local logging = section(2, "logging") field(logging, "Max logs", "MaxLogs", "300", function(String) local Value = tonumber(String) return Value and math.clamp(math.floor(Value), 10, 5000) or nil end) choice(logging, "Stack calls", "Stack", {"remote", "same args", "off"}, function() stacks = { } end) check(logging, "Move stacked calls to top", "StackToTop") field(logging, "History per row", "HistoryLimit", "500", function(String) local Value = tonumber(String) return Value and math.clamp(math.floor(Value), 1, 20000) or nil end) check(logging, "Anti spam (skip identical calls)", "AntiSpam", function() UI.spam_seen = { } UI.spam_size = 0 end) field(logging, " anti spam window (s, 0 = forever)", "AntiSpamWindow", "1", function(String) local Value = tonumber(String) return Value and math.max(0, Value) or nil end, function() UI.spam_seen = { } UI.spam_size = 0 end) Info(logging, "Anti spam: skips calls identical to one seen within the window. They still run, they just aren't logged.") Info(logging, "remote: one row per remote (xN). same args: only identical repeats stack.") end do local code = section(2, "code") local function redraw() if selected then show_details(selected, true) end end choice(code, "Args style", "CodeStyle", {"table", "array", "inline", "variables"}, redraw) choice(code, "Paths", "PathStyle", {"GetService", "dot", "WaitForChild", "FindFirstChild"}, redraw) check(code, "Smart paths (renamed / random remotes)", "SmartPaths", redraw) check(code, "Beautify remote names", "Beautify", function() rebuild() redraw() end) check(code, " overwrite remote names (Name = readable)", "BeautifyRename", function(Bool) if not Bool then UI.restore_names() end rebuild() redraw() end) check(code, "Track remote renames", "TrackRenames", redraw) check(code, "Remote in a variable", "RemoteVariable", redraw) check(code, "Remove comments", "StripComments", redraw) check(code, "Call the game function (filtergc)", "CallViaFunction", redraw) choice(code, " game function mode", "CallMode", {"no args", "with args"}, redraw) check(code, "Escape non-ASCII text (\\u{...})", "EscapeUnicode") check(code, "GetAttribute code also changes the value (SetAttribute)", "GetAttrCodeSet", redraw) choice(code, "Wrap call", "Wrap", {"none", "loop", "while", "spawn", "pcall"}, redraw) field(code, "Loop count", "LoopCount", "10", function(String) local Value = tonumber(String) return Value and math.clamp(math.floor(Value), 1, 100000) or nil end, redraw) field(code, "Loop delay (s)", "LoopDelay", "0", function(String) local Value = tonumber(String) return Value and math.max(0, Value) or nil end, redraw) choice(code, "Unpack", "Unpack", {"unpack", "table.unpack"}, function() if selected then show_details(selected) end end) check(code, "Caller / actor comment", "CallerComment", redraw) check(code, "debug.info of the caller", "DebugInfo", redraw) check(code, "full call stack on every log (remotes, signals, etc.)", "RemoteStack", redraw) check(code, "Decode buffer arguments (ByteNet)", "DecodeBuffers", redraw) field(code, " header bytes (packet id)", "BufferHeader", "1", function(String) local Value = tonumber(String) return Value and math.clamp(math.floor(Value), 0, 8) or nil end, redraw) check(code, " full packet view (name, type = value)", "BufferFull", redraw) field(code, " buffer layouts", "BufferLayouts", "3=ViewCamera:Position=vec3,Rotation=vec3", nil, redraw) check(code, "Hook all ByteNet packets (log their real arguments)", "HookPackets", function() UI.set_packets() end) check(code, " read packets from the modules (path, arguments)", "AutoPackets", redraw) check(code, " generate code with the packet modules (not buffer.fromstring)", "BufferCode", redraw) choice(code, " module code uses", "BufferCodeMode", {"require", "filtergc"}, redraw) check(code, " dump all module packets when nothing matches", "PacketDump", redraw) field(code, " packet module path contains", "PacketModules", "ByteNetPackets", nil, redraw) check(code, " show module packet arguments", "ShowSchema", redraw) field(code, " packet schemas", "PacketSchemas", "ViewStart=reliable; ViewerStart=reliable:TargetName=string", nil, redraw) Info(code, "Schemas: Name=reliable|unreliable:Field=type,... Link a packet id to it with a layout that has no fields, e.g. 38=ViewStart: (fields then come from the schema).") Info(code, "Layouts: id=PacketName:field=type,field=type; next id... (the =PacketName is optional, '*:' = fallback). Types: u8 i8 u16 i16 u32 i32 f32 f64 bool string vec2 vec3.") check(code, "Search upvalues of arguments (counters, ids)", "UpvalueSearch", function(Bool) UI.up_seen = setmetatable({ }, {__mode = "k"}) UI.deep_funcs = { } UI.deep_scan_at = 0 set_status(Bool and "upvalue search on: fire the remote 2+ times, then copy its code" or "upvalue search off") redraw() end) check(code, " also search the scripts' other functions (slow)", "UpvalueDeep") field(code, " arguments to search", "UpvalueArgs", "all or 1, 3", function(String) String = string.match(String, "^%s*(.-)%s*$") if string.lower(String) == "all" or string.match(String, "^[%d%s,]+$") and string.match(String, "%d") then return string.lower(String) == "all" and "all" or String end return nil end, redraw) check(code, "Auto fill time args (tick, os.time...)", "AutoFill", redraw) end do local interface = section(2, "interface") local accent_names = { } for _, preset in UI.accent_presets do table.insert(accent_names, preset[1]) end check(interface, "Ask to load Adonis bypass on start", "AskAdonis") action(interface, "load Adonis bypass now", function() UI.load_adonis() end) check(interface, "Hook with oth.hook (applies on next run)", "UseOthHook") local theme = section(3, "theme") choice(theme, "Theme", "Theme", UI.theme_names, function() UI.apply_colors() end) choice(theme, "Accent", "Accent", accent_names, function() Settings.AccentHex = "" UI.apply_colors() end) field(theme, "Custom accent", "AccentHex", "#78c8ff", function(String) String = string.match(String, "^%s*(.-)%s*$") if String == "" then return "" end local code = string.match(String, "^#?(%x%x%x%x%x%x)$") return code and "#" .. code or nil end, function() UI.apply_colors() end) Info(theme, "Theme and accent apply instantly. Empty custom accent = preset.") end do local look = section(4, "look") choice(look, "Look", "Look", {"modern", "classic"}, function(Value) UI.classic = Value == "classic" UI.apply_look() end) check(look, "Animations on the logs tab", "LogAnimations") Info(look, "modern: rounded, larger text. classic: the original look. Applies instantly.") UI.build_appearance_extras = function() local window = section(3, "window") UI.keybind(window, "UI key", "ToggleKey", false) Info(window, "Show / hide key. Click the box, then press a key (Esc cancels).") local profile = section(4, "profile") check(profile, "Save settings for this game only", "GameOnly") Info(profile, "On: this game (id " .. UI.game_key .. ") gets its own settings file. Off: shared settings.") end UI.build_appearance_extras() UI.build_blocks = function() end do local ignoring = section(5, "ignore") field(ignoring, "Ignore names", "IgnoreNames", "ping, ^Mouse", nil, __R.parse_ignore) Info(ignoring, "Comma separated Lua patterns, matched against remote names.") field(ignoring, "Only log names", "OnlyNames", "Damage, ^Shop", nil, __R.parse_only) Info(ignoring, "Whitelist: when set, only matching remotes are logged.") action(ignoring, "unignore all names", function() for Name in ignored_names do UI.set_ignored_name(Name, false) end set_status("unignored all names") end) action(ignoring, "unignore all remotes", function() for remote in ignored do set_ignored(remote, false) end set_status("unignored all") end) end do local blocking = section(5, "block") check(blocking, "Block kicks", "BlockKicks") check(blocking, "Block reset / inventory being disabled", "BlockCoreState") check(blocking, "Block teleports", "BlockTeleports") check(blocking, "Block PurchaseFinished signals (prompts are never blocked)", "BlockPurchases") choice(blocking, " gamepass / asset ownership returns", "OwnsSpoof", {"off", "true", "false"}) check(blocking, "Block shutdown", "BlockShutdowns") check(blocking, "Block buffer.create / table.create", "BlockCreates") check(blocking, "Block Instance.new (game gets a Folder)", "BlockInstanceNew", function() UI.set_instance_new() end) choice(blocking, " Instance.new returns", "InstanceNewReturn", {"Folder", "nil", "true", "false", "Part", "Model", "Frame", "same class", "custom"}) field(blocking, " custom class", "InstanceNewCustom", "ScreenGui", nil) check(blocking, "Block Sound:Play", "BlockSounds", function() UI.set_misc() end) check(blocking, "Block GetAttribute (fake value)", "BlockGetAttributes", function() UI.set_misc() end) check(blocking, "Block SetAttribute (value stays)", "BlockSetAttributes", function() UI.set_misc() end) choice(blocking, " if it is a boolean", "GetAttrBool", {"true", "false", "flip"}) field(blocking, " if it is a number", "GetAttrNumber", "100", function(String) return tonumber(String) end) field(blocking, " if it is a string", "GetAttrString", "text", nil) Info(blocking, "Blocked GetAttribute returns a fake value by the real type: bool = true / false / flipped, number = the number above, string = the text above. Other types and missing attributes pass through. Blocked SetAttribute does nothing. Both follow the attribute targets filter.") check(blocking, "Block task.wait / wait (1 frame only)", "BlockWaits", function() UI.set_wait() end) field(blocking, " change wait args", "WaitMap", "2=7, any=0.1", nil, function() UI.set_wait() end) Info(blocking, "Wait args: comma separated old=new pairs. 2=7 turns wait(2) into 7s, any=... matches every wait, none=... a wait without argument. Game waits only.") check(blocking, "Block print", "BlockPrint", function() UI.set_output() end) check(blocking, "Block warn", "BlockWarn", function() UI.set_output() end) check(blocking, "Block error", "BlockError", function() UI.set_output() end) check(blocking, "Block table.* calls", "BlockTables", function() UI.set_lib() end) check(blocking, "Block buffer.* calls", "BlockBuffers", function() UI.set_lib() end) Info(blocking, "Blocking everything breaks most games. To block one function, select its row in Logs and press Block.") check(blocking, "Block LogService.MessageOut readers", "BlockLogReaders", function(Bool) if Bool then if UI.sync_connections() then UI.scan_log_readers() end else UI.sync_connections() UI.restore_log_readers() end end) check(blocking, "Block RemoteEvent:FireServer", "BlockEvents") check(blocking, "Block RemoteFunction:InvokeServer", "BlockFunctions") check(blocking, "Block UnreliableRemoteEvent:FireServer", "BlockUnreliable") check(blocking, "Block Bindable Fire / Invoke", "BlockBindables") check(blocking, "Block Actor:SendMessage", "BlockActorMessages") check(blocking, "Block Tool Activate / Deactivate + Humanoid EquipTool / UnequipTools", "BlockTools") check(blocking, "Block LogService:GetLogHistory", "BlockLogHistory") check(blocking, "Block HTTP requests", "BlockHttp", function(Bool) if Bool and not UI.install_http() then set_status("couldn't hook the request functions (needs hookfunction); HttpGet / HttpService calls are still blocked") end end) check(blocking, "Block fireproximityprompt", "BlockPrompts") check(blocking, "Block firetouchinterest", "BlockTouchCalls") check(blocking, "Block fireclickdetector", "BlockClickCalls") check(blocking, "Block firesignal", "BlockFireSignals") check(blocking, "Block replicatesignal", "BlockReplicateSignals") Info(blocking, "Blocks only hit game calls (remotes, bindables, tools, table / buffer, GetLogHistory) and work with logging off. Blocked GetLogHistory returns an empty list.") check(blocking, "Block LocalPlayer.Parent = nil", "BlockParentNil") choice(blocking, "Kick / shutdown / parent nil / create blocks apply to", "BlockSource", {"game", "executor", "both"}) check(blocking, "Block ALL TouchInterests (CanTouch off)", "BlockAllTouches", function(Bool) UI.set_block_all_touches(Bool) end) end do local debug_blocks = section(5, "debug.info block") choice(debug_blocks, "debug.info block (returns)", "DebugBlock", {"off", "nothing", "true", "false", "nil", "zero", "empty string", "custom"}) field(debug_blocks, "Block only callers", "DebugOnly", "Anticheat, ^Players%.", nil) field(debug_blocks, "Custom return value", "DebugCustom", "true / 5 / text", nil) end do local clearing = section(5, "clear") action(clearing, "reset config to defaults", function() UI.reset_config() end) action(clearing, "unblock all names", function() for Name in blocked_names do UI.set_name_blocked(Name, false) end set_status("unblocked all names") end) action(clearing, "unblock all remotes", function() for remote in blocked do set_blocked(remote, false) end set_status("unblocked all") end) action(clearing, "remove all ignored argument rules", function() for remote in ignored_args do ignored_args[remote] = nil end UI.refresh_lists() set_status("removed all ignored argument rules") end) action(clearing, "remove all argument hooks", function() for remote in overrides do overrides[remote] = nil send_override(remote) end render() set_status("removed all argument hooks") end) end local blocked_list = section(6, "blocked") local ignored_list = section(6, "ignored") local function describe(key) if typeof(key) == "Instance" then local ok, label = pcall(function() return key.ClassName .. " " .. key.Name end) return ok and label or tostring(key) end return tostring(key) end local function make_list(content, empty_text) local holder = New("Frame", {Parent = content, Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1}) New("UIListLayout", {Parent = holder, Padding = UDim.new(0, 2), SortOrder = Enum.SortOrder.LayoutOrder}) return function(entries) for _, child in holder.GetChildren(holder) do if child.IsA(child, "GuiObject") then child.Destroy(child) end end table.sort(entries, function(A, B) return A.Label < B.Label end) if #entries == 0 then Text(holder, {LayoutOrder = 0, Size = UDim2.new(1, 0, 0, 14), TextColor3 = T.Dim, Text = empty_text}) return end for index, entry in entries do if index > 60 then Text(holder, {LayoutOrder = index, Size = UDim2.new(1, 0, 0, 14), TextColor3 = T.Dim, Text = "+ " .. (#entries - 60) .. " more"}) break end local row = New("Frame", {Parent = holder, LayoutOrder = index, Size = UDim2.new(1, 0, 0, 18), BackgroundTransparency = 1}) Text(row, {Size = UDim2.new(1, -24, 1, 0), Text = entry.Label}) Button(row, UI.classic and "x" or "×", {AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 0), Size = UDim2.new(0, 20, 0, 18)}, entry.Remove) end end end local draw_blocked = make_list(blocked_list, "nothing blocked") local draw_ignored = make_list(ignored_list, "nothing ignored") UI.draw_lists = function() local Blocks, ignores = { }, { } for Name in blocked_names do table.insert(Blocks, {Label = "name " .. tostring(Name), Remove = function() UI.set_name_blocked(Name, false) end}) end for key in blocked do table.insert(Blocks, {Label = describe(key), Remove = function() set_blocked(key, false) end}) end for Name in ignored_names do table.insert(ignores, {Label = "name " .. tostring(Name), Remove = function() UI.set_ignored_name(Name, false) end}) end for key in ignored do table.insert(ignores, {Label = describe(key), Remove = function() set_ignored(key, false) end}) end for key, rules in ignored_args do table.insert(ignores, {Label = "args " .. describe(key) .. " (" .. #rules .. ")", Remove = function() ignored_args[key] = nil UI.refresh_lists() end}) end draw_blocked(Blocks) draw_ignored(ignores) end UI.draw_lists() end UI.build_blocks() UI.build_misc = function() local prompts = section(7, "proximity prompts") check(prompts, "Instant ProximityPrompts (HoldDuration = 0)", "InstantPrompts", set_instant_prompts) check(prompts, "Auto fire ProximityPrompts when shown", "AutoPrompts") field(prompts, "Auto fire delay (s)", "AutoPromptDelay", "0.3", function(String) local Value = tonumber(String) return Value and math.max(0.05, Value) or nil end) Info(prompts, "Instant removes hold time. Auto fire presses each shown prompt once per delay.") local upvalues = section(7, "upvalue spy") field(upvalues, "function name", "UpvalueFn", "name of the game function") action(upvalues, "spy this function's upvalues", function() set_status(UI.upvalue_spy(Settings.UpvalueFn)) end) action(upvalues, "pause the upvalue spy", function() UI.upvalue.On = false set_status("upvalue spy paused (press spy again to resume)") end) Info(upvalues, "Hooks every function upvalue of the game functions with that name (calls logged as lib rows with their arguments) and logs changes of their numbers, strings, booleans and instances.") local export = section(7, "export / copy") choice(export, "Export format", "ExportFormat", {"code", "summary"}) action(export, "export logs to file", function() UI.export_logs() end) check(export, "Auto copy code on select", "AutoCopy") local crash = UI.crash local finder = section(7, "crash remote finder") local function count(String) local Value = tonumber(String) return Value and math.max(1, math.floor(Value)) or nil end check(finder, "Find remotes that fire crash code", "CrashFinder", function() crash.sync() end) check(finder, "Auto block (stop the call, block remote + args)", "CrashAutoBlock") choice(finder, "Block args matches", "CrashArgMode", {"value", "type"}) field(finder, "print calls / frame", "CrashPrint", "150", count) field(finder, "Instance.new calls / frame", "CrashNew", "400", count) field(finder, "buffer.create max size (MB)", "CrashBufferMB", "32", count) Info(finder, "Counts print / Instance.new calls per frame (each while true loop separately) and buffer.create sizes made by game scripts. The suspect remote is the one fired by the same script shortly before (fire, wait, crash function), in the same frame, or just recently (weak, never auto blocked). block remote = every call, block args = only calls with the same arguments, block code = the crash code is stopped at its first call (a remote block alone does not stop client side loops). Bigger buffer.create calls are cut to size 0 while this is on.") local detected = section(7, "detected crash calls") local holder = New("Frame", {Parent = detected, Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1}) New("UIListLayout", {Parent = holder, Padding = UDim.new(0, 5), SortOrder = Enum.SortOrder.LayoutOrder}) crash.Blocked = function(entry) local remote = entry.Remote return remote ~= nil and (blocked[remote] == true or crash.FullIn[remote] == true or crash.ArgBlocks[remote] ~= nil) end crash.block_entry = function(entry, by_args) local remote = entry.Remote if not remote then return end if by_args then crash.ArgBlocks[remote] = crash.ArgBlocks[remote] or { } if not entry.ArgRule then entry.ArgRule = crash.make_rule(entry.Args) table.insert(crash.ArgBlocks[remote], entry.ArgRule) end elseif entry.Dir == "in" then crash.FullIn[remote] = true else set_blocked(remote, true) end if entry.Dir == "in" and not crash.ensure_proxy(remote) then set_status("this executor has no getconnections: incoming remotes can't be blocked") else set_status("blocked " .. remote.Name .. (by_args and " (these arguments)" or "")) end crash.redraw() end crash.unblock_entry = function(entry) local remote = entry.Remote if not remote then return end set_blocked(remote, false) crash.FullIn[remote] = nil crash.ArgBlocks[remote] = nil for _, other in crash.Found do if other.Remote == remote then other.ArgRule = nil end end crash.unproxy(remote) set_status("unblocked " .. remote.Name) crash.redraw() end crash.on_found = function(entry) if Settings.CrashAutoBlock and entry.Remote and not entry.Weak and not crash.Blocked(entry) then crash.block_entry(entry, true) end crash.Dirty = true end crash.preview = function(args) local parts = { } for index = 1, math.min(args.n, 4) do local Value = args[index] local ok, shown = pcall(tostring, Value) shown = ok and shown or "?" parts[index] = type(Value) == "string" and ('"' .. string.sub(shown, 1, 24) .. '"') or string.sub(shown, 1, 30) end return table.concat(parts, ", ") .. (args.n > 4 and ", ..." or "") end crash.draw = function() for _, child in holder.GetChildren(holder) do if child.IsA(child, "GuiObject") then child.Destroy(child) end end if #crash.Found == 0 then Text(holder, {LayoutOrder = 0, Size = UDim2.new(1, 0, 0, 14), TextColor3 = T.Dim, Text = "nothing detected yet"}) return end for index, entry in crash.Found do local from = "no remote fired near it" if entry.Remote then local ok, path = pcall(function() return entry.Remote.GetFullName(entry.Remote) end) from = (entry.Dir == "in" and "incoming " or "outgoing ") .. (ok and path or tostring(entry.Remote)) .. " args: " .. crash.preview(entry.Args) .. " [" .. tostring(entry.Conf) .. "]" .. (entry.Fired and ("\nfired by " .. entry.Fired) or "") end local row = New("Frame", {Parent = holder, LayoutOrder = index, Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1}) New("UIListLayout", {Parent = row, Padding = UDim.new(0, 2), SortOrder = Enum.SortOrder.LayoutOrder}) Text(row, {LayoutOrder = 0, Size = UDim2.new(1, 0, 0, 12), AutomaticSize = Enum.AutomaticSize.Y, TextWrapped = true, Text = "[" .. entry.Kind .. " x" .. entry.Hits .. "] " .. tostring(entry.Detail) .. "\n" .. tostring(entry.Source) .. ":" .. tostring(entry.Line) .. " (" .. tostring(entry.Func) .. (entry.Defined and (", function starts at line " .. entry.Defined) or "") .. ")\n" .. from .. (entry.root and ("\nthread started by " .. entry.root) or "")}) local bar = New("Frame", {Parent = row, LayoutOrder = 1, Size = UDim2.new(1, 0, 0, 18), BackgroundTransparency = 1}) local order = 0 HorizontalList(bar, 4) local function add(label, callback) order += 1 Button(bar, label, {Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = order}, callback) end if entry.Remote then if crash.Blocked(entry) then add("unblock", function() crash.unblock_entry(entry) end) else add("block remote", function() crash.block_entry(entry, false) end) add("block args", function() crash.block_entry(entry, true) end) end end if crash.BlockedCode[entry.Key] then add("unblock code", function() crash.BlockedCode[entry.Key] = nil crash.redraw() end) else add("block code", function() crash.BlockedCode[entry.Key] = true set_status("blocked the code at " .. tostring(entry.Source) .. ":" .. tostring(entry.Line)) crash.redraw() end) end if entry.root then if crash.BadFns[entry.root] then add("unblock spawn", function() crash.BadFns[entry.root] = nil crash.redraw() end) else add("block spawn", function() crash.BadFns[entry.root] = "manual" if not Settings.BlockSpawnCrash then set_status("listed, but 'Block crash task.spawn' (right column) is off") end crash.redraw() end) end end end end crash.redraw = function() crash.Drawing = true crash.safe(crash.draw) crash.safe(crash.draw_spawns) crash.Drawing = false end action(detected, "clear list", function() crash.Found, crash.Pending = { }, { } crash.redraw() end) crash.redraw() local character = section(8, "reset / inventory") action(character, "Enable all (reset + inventory etc.)", UI.enable_all) local keys = section(8, "keys") UI.keybind(keys, "Pause key", "PauseKey", true) Info(keys, "Click the box, then press a key. Esc cancels, Backspace / Delete clears.") local binding = section(8, "binds") action(binding, "clear all binds", function() for code, Bind in binds do Bind.Log.BindKey = nil Bind.Log.LoopKey = nil binds[code] = nil end binding_log = nil render() set_status("cleared all binds") end) local guard = section(8, "task.spawn guard") check(guard, "Block crash task.spawn / defer / delay", "BlockSpawnCrash", function() crash.sync() end) field(guard, "same function spawned / frame", "CrashSpawn", "200", count) Info(guard, "Hooks getrenv().task. A function that loops print / Instance.new (same limits as the finder, it is stopped on the spot) or that is spawned in a flood is put on the list and the game can't spawn it again. A loop that never calls anything this spy can see can't be detected. If a game breaks, remove its entry with x.") local spawned = New("Frame", {Parent = guard, Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1}) New("UIListLayout", {Parent = spawned, Padding = UDim.new(0, 2), SortOrder = Enum.SortOrder.LayoutOrder}) crash.draw_spawns = function() for _, child in spawned.GetChildren(spawned) do if child.IsA(child, "GuiObject") then child.Destroy(child) end end local shown = 0 for key, reason in crash.BadFns do shown += 1 if shown > 40 then break end local row = New("Frame", {Parent = spawned, LayoutOrder = shown, Size = UDim2.new(1, 0, 0, 18), BackgroundTransparency = 1}) Text(row, {Size = UDim2.new(1, -24, 1, 0), TextTruncate = Enum.TextTruncate.AtEnd, Text = tostring(key) .. " (" .. tostring(reason) .. ")"}) Button(row, UI.classic and "x" or "×", {AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 0), Size = UDim2.new(0, 20, 0, 18)}, function() crash.BadFns[key] = nil crash.redraw() end) end if shown == 0 then Text(spawned, {LayoutOrder = 0, Size = UDim2.new(1, 0, 0, 14), TextColor3 = T.Dim, Text = "no spawns blocked"}) end end crash.redraw() end UI.build_misc() end)() end end end end end end end set_accent = function() UI.apply_colors() end end end end function UI.apply_colors() local Next = table.clone(UI.themes[UI.theme_for(Settings.Theme)]) Next.Accent = UI.accent_color() local map = { } for key, old in T do if Next[key] and old ~= Next[key] then map[old.ToHex(old)] = Next[key] end end local function swap(object, property) local ok, color = pcall(function() return object[property] end) if ok and typeof(color) == "Color3" then local target = map[color.ToHex(color)] if target then pcall(function() object[property] = target end) end end end for _, object in Gui.GetDescendants(Gui) do if object.IsA(object, "GuiObject") then swap(object, "BackgroundColor3") swap(object, "BorderColor3") if object.IsA(object, "TextLabel") or object.IsA(object, "TextButton") or object.IsA(object, "TextBox") then swap(object, "TextColor3") end if object.IsA(object, "TextBox") then swap(object, "PlaceholderColor3") end if object.IsA(object, "ScrollingFrame") then swap(object, "ScrollBarImageColor3") end if object.IsA(object, "ImageLabel") or object.IsA(object, "ImageButton") then swap(object, "ImageColor3") end elseif object.IsA(object, "UIStroke") then swap(object, "Color") end end for key, Value in Next do T[key] = Value end hex.Accent = "#" .. T.Accent.ToHex(T.Accent) hex.Dim = "#" .. T.Dim.ToHex(T.Dim) for _, pair in UI.duals do pcall(function() pair[1].Color = T[UI.classic and pair[2] or pair[3]] end) end for _, pair in __R.Accented do pcall(function() pair[1][pair[2]] = T.Accent end) end for _, draw in UI.check_draws do pcall(draw) end __R.draw_title() render() if selected then show_details(selected) end end UI.tab_buttons = { } do local function show_tab(Name) local previous = UI.current_tab if UI.key_capture_cancel then UI.key_capture_cancel() end UI.current_tab = Name UI.logs_view.Visible = Name == "logs" UI.settings_view.Visible = Name == "settings" UI.blocks_view.Visible = Name == "blocks" UI.misc_view.Visible = Name == "misc" if UI.anim_view then UI.anim_view.Visible = Name == "animations" end UI.theme_view.Visible = Name == "appearance" if previous and previous ~= Name then local view = (Name == "logs" and UI.logs_view) or (Name == "blocks" and UI.blocks_view) or (Name == "misc" and UI.misc_view) or (Name == "animations" and UI.anim_view) or (Name == "settings" and UI.settings_view) or UI.theme_view view.Position = UDim2.new(0, 0, 0, 14) UI.Smooth(view, {Position = UDim2.new(0, 0, 0, 0)}, 0.35) end if Name == "settings" or Name == "appearance" or Name == "blocks" or Name == "misc" or Name == "animations" then for _, draw in UI.check_draws do pcall(draw) end end if Name == "blocks" and UI.draw_lists then pcall(UI.draw_lists) end for tab_name, object in UI.tab_buttons do Tween(object, {TextColor3 = tab_name == Name and T.Accent or T.Dim, BackgroundTransparency = (tab_name == Name and not UI.classic) and 0 or 1}, 0.15) local tab_icon = object.FindFirstChild(object, "TabIcon") if tab_icon then tab_icon.ImageColor3 = tab_name == Name and T.Accent or T.Dim end end end ;(function() for index, Name in {"logs", "blocks", "misc", "animations", "settings", "appearance"} do local object = Text(tabs, {LayoutOrder = index, Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, Text = UI.classic and Name or (string.upper(string.sub(Name, 1, 1)) .. string.sub(Name, 2)), TextColor3 = T.Dim, BackgroundColor3 = T.Element, TextXAlignment = Enum.TextXAlignment.Center, FontFace = UI.bold_face}, "TextButton") UI.Round(object, 6) local tab_icon_image = kind_icons[({blocks = "block", animations = "anim", appearance = "appearance"})[Name] or Name] if tab_icon_image then New("ImageLabel", {Name = "TabIcon", Parent = object, BackgroundTransparency = 1, Position = UDim2.new(0, -15, 0.5, -6), Size = UDim2.new(0, 12, 0, 12), ScaleType = Enum.ScaleType.Fit, Image = tab_icon_image, ImageColor3 = T.Dim, Visible = not UI.classic}) end New("UIPadding", {Parent = object, PaddingLeft = UDim.new(0, UI.classic and 4 or (tab_icon_image and 26 or 12)), PaddingRight = UDim.new(0, UI.classic and 4 or 12)}) Connect(object.MouseEnter, function() if UI.current_tab ~= Name then Tween(object, {TextColor3 = T.Text, BackgroundTransparency = UI.classic and 1 or 0.5}) end end) Connect(object.MouseLeave, function() if UI.current_tab ~= Name then Tween(object, {TextColor3 = T.Dim, BackgroundTransparency = 1}) end end) Connect(object.MouseButton1Click, function() show_tab(Name) end) UI.tab_buttons[Name] = object end function UI.apply_look() local C = UI.classic UI.apply_font_vars() UI.apply_tags() local function pick(old, modern) if C then return old end return modern end for _, object in Gui.GetDescendants(Gui) do if object.IsA(object, "TextLabel") or object.IsA(object, "TextButton") or object.IsA(object, "TextBox") then if object.Name == "CodeText" then object.FontFace, object.TextSize = UI.code_font, UI.code_size else object.FontFace, object.TextSize = font_face, font_size end local outline = object.FindFirstChild(object, "TxtOutline") if pixel and not outline then New("UIStroke", {Parent = object, Name = "TxtOutline", Color = rgb(0, 0, 0), Transparency = 0.6, Thickness = 1, LineJoinMode = Enum.LineJoinMode.Miter}) elseif not pixel and outline then outline.Destroy(outline) end elseif object.IsA(object, "UICorner") then object.CornerRadius = UDim.new(0, C and 0 or (object.GetAttribute(object, "R") or 6)) elseif object.IsA(object, "UIStroke") and object.Name ~= "TxtOutline" then object.LineJoinMode = C and Enum.LineJoinMode.Miter or Enum.LineJoinMode.Round end if object.GetAttribute(object, "Bd") then object.BorderSizePixel = pick(2, 0) end end for _, object in UI.classic_only do object.Visible = C end UI.title_bar.Size = UDim2.new(1, 0, 0, pick(24, 34)) UI.title_text.TextSize = pick(font_size, 15) UI.title_text.FontFace = UI.bold_face tabs.Position = UDim2.new(0, pick(140, 120), 0, pick(4, 6)) tabs.Size = UDim2.new(0, 520, 0, pick(16, 22)) inner.Position = UDim2.new(0, pick(6, 8), 0, pick(24, 34)) inner.Size = UDim2.new(1, pick(-12, -16), 1, pick(-30, -42)) status.Position = UDim2.new(1, pick(-52, -66), 0, 0) UI.fit_status() UI.close_button.Size, UI.close_button.TextSize, UI.close_button.Text = UDim2.new(0, pick(18, 24), 0, pick(18, 24)), pick(font_size, 16), pick("x", "×") UI.minimize_button.Size, UI.minimize_button.TextSize, UI.minimize_button.Text = UDim2.new(0, pick(18, 24), 0, pick(18, 24)), pick(font_size, 16), pick("-", "–") UI.minimize_button.Position = UDim2.new(1, pick(-26, -34), 0.5, 0) if minimized then main.Size = UDim2.new(0, full_size.X.Offset, 0, pick(24, 34)) end for Name, object in UI.tab_buttons do object.Text = C and Name or (string.upper(string.sub(Name, 1, 1)) .. string.sub(Name, 2)) object.FontFace = UI.bold_face local padding = object.FindFirstChildOfClass(object, "UIPadding") if padding then local tab_icon = object.FindFirstChild(object, "TabIcon") padding.PaddingLeft, padding.PaddingRight = UDim.new(0, pick(4, tab_icon and 26 or 12)), UDim.new(0, pick(4, 12)) if tab_icon then tab_icon.Visible = not C end end end row_height = pick(18, 22) for _, row in pool do row.Size = UDim2.new(1, -6, 0, row_height) end for _, item in UI.check_rows do local row, box, fill, Name = item[1], item[2], item[3], item[4] row.Size = UDim2.new(1, 0, 0, pick(16, 18)) box.Size = UDim2.new(0, 14, 0, 14) fill.Position = UDim2.new(0, pick(2, 3), 0, pick(2, 3)) fill.Size = UDim2.new(1, pick(-4, -6), 1, pick(-4, -6)) Name.Position = UDim2.new(0, 22 + item[5], 0, 0) Name.Size = UDim2.new(1, -22 - item[5], 1, 0) end for _, title in UI.titles do title.Position = UDim2.new(0, pick(7, 10), 0, pick(5, 6)) title.Size = UDim2.new(1, pick(-14, -20), 0, pick(12, 14)) title.FontFace = UI.bold_face end show_tab(UI.current_tab or "logs") UI.apply_colors() for _, draw in UI.check_draws do pcall(draw) end for _, title in UI.titles do title.TextColor3 = C and T.Text or T.Accent end end show_tab("logs") do local last_actors = 0 local last_details = 0 Connect(run_service.Heartbeat, function() shared.LibBudget = (Settings.LibRate or 0) > 0 and Settings.LibRate or math.huge if UI.anim_until and os.clock() < UI.anim_until and #queue == 0 then render() end if #queue > 0 then local batch = queue queue = { } for _, Log in batch do local target = nil if Settings.Stack == "remote" then local key = Log.Method .. "|" .. Log.Kind .. "|" .. tostring(Log.Actor) local per = stacks[Log.Remote] target = per and per[key] if not target then per = per or { } per[key] = Log stacks[Log.Remote] = per end elseif Settings.Stack == "same args" then local top = logs[1] if top and top.Remote == Log.Remote and top.Method == Log.Method and top.Actor == Log.Actor then Log.signature = signature(Log) top.signature = top.signature or signature(top) if top.signature == Log.signature then target = top end end end if target then target.Calls += 1 target.Time = Log.Time Log.Args.Up = Log.Args.Up or target.Args.Up target.Args = Log.Args target.Count = Log.Count target.Script = Log.Script or target.Script target.Info = Log.Info or target.Info target.Spoofed = Log.Spoofed target.signature = Log.signature local history = target.History table.insert(history, {Args = Log.Args, Count = Log.Count, Script = Log.Script, Info = Log.Info, Time = Log.Time, number = target.Calls, Result = Log.Result, Signal = Log.Signal}) target.Result = Log.Result or target.Result target.Signal = Log.Signal or target.Signal while #history > math.max(1, Settings.HistoryLimit) do table.remove(history, 1) if target.ViewIndex then target.ViewIndex = math.max(1, target.ViewIndex - 1) end end if Settings.StackToTop and logs[1] ~= target then local position = table.find(logs, target) if position then table.remove(logs, position) end table.insert(logs, 1, target) end if target == selected then details_dirty = true end else if typeof(Log.Remote) == "Instance" and Log.Kind ~= "debuginfo" and not Log.Signal then UI.track_remote(Log.Remote) Log.Dup = __R.dup_tag(Log.Remote) end Log.History = {{Args = Log.Args, Count = Log.Count, Script = Log.Script, Info = Log.Info, Time = Log.Time, number = 1, Result = Log.Result, Signal = Log.Signal}} table.insert(logs, 1, Log) end end while #logs > Settings.MaxLogs do local removed = table.remove(logs) unstack(removed) if removed == selected then show_details(nil) end end rebuild() end if details_dirty and selected and os.clock() - last_details > 0.5 then last_details = os.clock() details_dirty = false show_details(selected, true) end if Settings.Actors and Settings.WatchActors and os.clock() - last_actors > 3 then last_actors = os.clock() task.spawn(inject_actors, false) end end) end Connect(user_input_service.InputBegan, function(input_object, processed) if user_input_service.GetFocusedTextBox(user_input_service) then return end if UI.key_capture then UI.key_capture(input_object) return end if binding_log then local Log = binding_log local code = input_object.KeyCode local is_loop = binding_loop binding_log = nil binding_loop = false if code == Enum.KeyCode.Escape or code == Enum.KeyCode.Unknown then set_status("bind cancelled") return end if code.Name == Settings.ToggleKey or code.Name == Settings.PauseKey then set_status(code.Name .. " is the toggle / pause key, pick another") return end local taken = binds[code] if taken then if taken.Loop then taken.Log.LoopKey = nil else taken.Log.BindKey = nil end end remove_bind(Log, is_loop) binds[code] = {Log = Log, Loop = is_loop or nil} if is_loop then Log.LoopKey = code.Name else Log.BindKey = code.Name end render() if selected == Log then show_details(Log, true) end set_status("bound " .. code.Name .. " to " .. display_name(Log)) return end local Bind = binds[input_object.KeyCode] if Bind and input_object.KeyCode.Name ~= Settings.ToggleKey and input_object.KeyCode.Name ~= Settings.PauseKey then if Bind.Loop then UI.set_loop(Bind.Log, not UI.loops[Bind.Log]) return end local row = Bind.Log local picked = row.ViewIndex row.ViewIndex = nil local latest = viewed(row) row.ViewIndex = picked replay(latest) return end if processed then return end if Settings.PauseKey ~= "None" then local ok_pause, pause_key = pcall(function() return Enum.KeyCode[Settings.PauseKey] end) if ok_pause and input_object.KeyCode == pause_key then paused = not paused UI.pause_button.Text = paused and "resume" or "pause" UI.pause_button.TextColor3 = paused and T.Accent or T.Text set_status(paused and "paused" or "logging") return end end local ok, key = pcall(function() return Enum.KeyCode[Settings.ToggleKey] end) if ok and input_object.KeyCode == key then main.Visible = not main.Visible close_menu() end end) UI.refresh_lib_block = function() local on = Settings.BlockTables or Settings.BlockBuffers if not on then for key in blocked do if type(key) == "string" and (string.sub(key, 1, 6) == "table." or string.sub(key, 1, 7) == "buffer.") then on = true break end end end shared.LibBlockAll = {table = Settings.BlockTables == true, buffer = Settings.BlockBuffers == true} shared.LibBlockOn = on == true end UI.disabled_readers = { } UI.is_executor_function = function(Function) local check = isexecutorclosure or checkclosure or is_executor_closure if check then local ok, result = pcall(check, Function) return ok and result == true end return false end UI.scan_log_readers = function() if not getconnections then set_status("no getconnections in this executor: only new MessageOut connections are seen") return end local ok, list = pcall(getconnections, UI.log_service.MessageOut) if not ok or type(list) ~= "table" then set_status("couldn't read the existing MessageOut connections") return end local seen, disabled = 0, 0 local raw = raw_debug_info or debug.info for _, Connection in list do local ok_function, Function = pcall(function() return Connection.Function end) if ok_function and type(Function) == "function" and not UI.own_callbacks[Function] then local ok_source, source = pcall(raw, Function, "s") if not (ok_source and type(source) == "string" and string.find(source, "CoreGui", 1, true)) then local from_executor = UI.is_executor_function(Function) seen += 1 if (Settings.LogReaders or Settings.Connections) and not (from_executor and not Settings.Executor) then pcall(shared.capture_connect, "Connect", UI.log_service.MessageOut, Function, true) end if Settings.BlockLogReaders and UI.block_applies(from_executor) and not UI.disabled_readers[Connection] then if pcall(function() Connection.Disable(Connection) end) then UI.disabled_readers[Connection] = true disabled += 1 end end end end end set_status("MessageOut: " .. seen .. " existing connection" .. (seen == 1 and "" or "s") .. (Settings.BlockLogReaders and (", " .. disabled .. " disabled") or "")) end UI.restore_log_readers = function() local count = 0 for Connection in UI.disabled_readers do pcall(function() Connection.Enable(Connection) end) UI.disabled_readers[Connection] = nil count += 1 end if count > 0 then set_status("re-enabled " .. count .. " MessageOut connection" .. (count == 1 and "" or "s")) end end UI.sync_connections = function() local on = Settings.Connections or Settings.LogReaders or Settings.BlockLogReaders shared.ConnectionsOn = on == true if on and not __R.install_connections() then set_status("couldn't hook Connect: " .. tostring(shared.ConnectError)) return false end return on == true end UI.install_output = function(Name) if shared.Installed["Out" .. Name] or not X.hook_function then return end end UI.set_output = function() shared.BlockOut = shared.BlockOut or { } if not X.hook_function and (Settings.BlockPrint or Settings.BlockWarn or Settings.BlockError) then set_status("can't block print / warn / error (needs hookfunction)") end end UI.set_instance_new = function() if not (Settings.InstanceNew or Settings.BlockInstanceNew or UI.crash_detect()) or shared.Installed.CreateInstance then return end if not X.hook_function then set_status("can't hook Instance.new (needs hookfunction)") return end shared.Installed.CreateInstance = pcall(function() local old old = X.hook_function(Instance.new, X.new_c_closure(function(...) if create_busy or not shared.capture_create then return old(...) end create_busy = true local ok, block = pcall(shared.capture_create, "Instance.new", ...) create_busy = false if ok and block == true then if UI.crash.Kill then UI.crash.Kill = false error("[remote spy] crash code stopped", 0) end local fake = shared.instance_fake if fake then return fake(old, (...)) end return old("Folder") end return old(...) end)) end) end shared.instance_fake = function(old, class) local Mode = Settings.InstanceNewReturn if Mode == "nil" then return nil elseif Mode == "true" then return true elseif Mode == "false" then return false end local target = Mode == "same class" and class or (Mode == "custom" and Settings.InstanceNewCustom) or Mode local ok, object = pcall(old, target) if ok and object then return object end return old("Folder") end UI.wait_map_cache = {Spec = nil, Map = { }} UI.wait_map_of = function() local spec = Settings.WaitMap or "" if UI.wait_map_cache.Spec ~= spec then local map = { } for piece in string.gmatch(spec, "[^,]+") do local from, to = string.match(piece, "^%s*([^=]-)%s*=%s*(.-)%s*$") local Value = tonumber(to) if from and Value then map[tonumber(from) or string.lower(from)] = Value end end UI.wait_map_cache = {Spec = spec, Map = map} end return UI.wait_map_cache.Map end shared.capture_wait = function(Name, ...) if not active then return nil end local mapped = (Settings.WaitMap or "") ~= "" if not (Settings.Waits or Settings.BlockWaits or mapped or next(blocked)) then return nil end local from_executor = X.check_caller() if from_executor and not Settings.Executor then return nil end if Settings.Waits and not paused and not ignored[Name] and not name_ignored(Name) then push(Name, Name, "wait", X.get_calling_script(), nil, select("#", ...), ...) end if (blocked[Name] == true or Settings.BlockWaits) and UI.block_applies(from_executor) then return "block" end if mapped and not from_executor then local map = UI.wait_map_of() local arg = ... local New if arg == nil then New = map.none else New = map[arg] or map.any end if New ~= nil and New ~= arg then return "set", New end end return nil end UI.set_wait = function() if not (Settings.Waits or Settings.BlockWaits or (Settings.WaitMap or "") ~= "") then return end if not X.hook_function then set_status("can't hook task.wait / wait (needs hookfunction)") return end for _, spec in {{"TaskWait", task and task.wait, "task.wait"}, {"GlobalWait", wait, "wait"}} do local key, Function, Name = spec[1], spec[2], spec[3] if type(Function) == "function" and not shared.Installed[key] then shared.Installed[key] = pcall(function() local old old = X.hook_function(Function, X.new_c_closure(function(...) local capture = shared.capture_wait if capture and not shared.WaitBusy then shared.WaitBusy = true local ok, Mode, New = pcall(capture, Name, ...) shared.WaitBusy = false if ok and Mode == "block" then return old() elseif ok and Mode == "set" then return old(New) end end return old(...) end)) end) end end end shared.capture_raknet = function(direction, packet) if not active or paused or replaying or shared.RakBusy then return end if (direction == "send" and not Settings.RakNet) or (direction == "receive" and not Settings.RakNetReceive) then return end shared.RakBusy = true pcall(function() local function get(Name) local ok, Value = pcall(function() return packet[Name] end) return ok and Value or nil end local Id = tonumber(get("PacketId")) or 0 local data = get("AsString") data = type(data) == "string" and data or "" local full = #data if full > 2048 then data = string.sub(data, 1, 2048) end local key = string.format("RakNet %s 0x%02X", direction, Id) if ignored[key] or name_ignored(key) then return end push(key, direction, "raknet", nil, false, 1, { PacketId = Id, Size = get("Size"), Priority = get("Priority"), Reliability = get("Reliability"), OrderingChannel = get("OrderingChannel"), Data = data, Truncated = full > 2048 or nil, }) end) shared.RakBusy = false end UI.set_raknet = function() if not (Settings.RakNet or Settings.RakNetReceive) then return end if type(raknet) ~= "table" or type(raknet.add_send_hook) ~= "function" then set_status("RakNet logging: this executor has no raknet library (Potassium)") return end local function install(key, adder, direction) if shared.Installed[key] then return end shared.Installed[key] = pcall(adder, function(packet) local capture = shared.capture_raknet if capture then pcall(capture, direction, packet) end end) end if Settings.RakNet then install("RakNetSend", raknet.add_send_hook, "send") end if Settings.RakNetReceive then if type(raknet.add_receive_hook) == "function" then install("RakNetReceive", raknet.add_receive_hook, "receive") else set_status("RakNet logging: no raknet.add_receive_hook in this executor") return end end set_status("RakNet hooks added (also enable RakNet hooks in the executor's UI settings)") end UI.raknet_values = function(info) local function pick(Value, default) Value = tonumber(Value) if Value and Value >= 0 then return Value, false end return default, true end local priority, default_a = pick(info.Priority, 1) local reliability, default_b = pick(info.Reliability, 0) local channel, default_c = pick(info.OrderingChannel, 0) return priority, reliability, channel, (default_a or default_b or default_c) end UI.raknet_code = function(Log) local info = Log.Args and Log.Args[1] if type(info) ~= "table" then return "-- no packet data" end local data = type(info.Data) == "string" and info.Data or "" local priority, reliability, channel, defaulted = UI.raknet_values(info) local lines = { "-- generated by Larp Spy", "-- RakNet " .. tostring(Log.Method) .. " packet", string.format("-- id: 0x%02X size: %s priority: %s reliability: %s ordering channel: %s", tonumber(info.PacketId) or 0, tostring(info.Size), tostring(info.Priority), tostring(info.Reliability), tostring(info.OrderingChannel)), } if info.Truncated then table.insert(lines, "-- data was cut to the first 2048 bytes, so this can't be sent as is") end table.insert(lines, "") table.insert(lines, "local data = \"\"") for start = 1, #data, 32 do local chunk = string.gsub(string.sub(data, start, start + 31), ".", function(char) return string.format("\\x%02X", string.byte(char)) end) table.insert(lines, " .. \"" .. chunk .. "\"") end table.insert(lines, "") if Log.Method == "send" and not info.Truncated then if defaulted then table.insert(lines, "-- the hook didn't give a valid priority / reliability / channel, so defaults are used") end table.insert(lines, string.format("raknet.send(data, %d, %d, %d)", priority, reliability, channel)) elseif Log.Method ~= "send" then table.insert(lines, "-- received from the server, so there is nothing to send") end return table.concat(lines, "\n") end UI.raknet_send = function(Log) local info = Log.Args and Log.Args[1] if type(info) ~= "table" or type(info.Data) ~= "string" then set_status("RakNet: no packet data to send") return end if Log.Method ~= "send" then set_status("RakNet: only sent packets can be sent again") return end if info.Truncated then set_status("RakNet: this packet was cut to 2048 bytes, not sending a partial packet") return end if type(raknet) ~= "table" or type(raknet.send) ~= "function" then set_status("RakNet: this executor has no raknet.send") return end local priority, reliability, channel = UI.raknet_values(info) replaying = true local ok, result = pcall(raknet.send, info.Data, priority, reliability, channel) replaying = false set_status(ok and string.format("sent RakNet packet 0x%02X (%d bytes)", tonumber(info.PacketId) or 0, #info.Data) or ("RakNet send failed: " .. tostring(result))) end UI.set_misc = function() local specs = { {"GetAttribute", Settings.GetAttributes or Settings.BlockGetAttributes, "Folder"}, {"SetAttribute", Settings.SetAttributes or Settings.BlockSetAttributes, "Folder"}, {"Play", Settings.Sounds or Settings.BlockSounds, "Sound"}, } for _, spec in specs do if spec[2] then methods[spec[1]] = true hook_direct("Misc" .. spec[1], probe(spec[3], spec[1]), spec[1]) end end end UI.set_packets = function() if not Settings.HookPackets then shared.PacketsOn = false return end shared.PacketsOn = true if shared.PacketsHooked then return end if not X.hook_function then set_status("couldn't hook the packets (needs hookfunction)") return end local ok, index = pcall(UI.auto_index) if not ok then return end shared.PacketsHooked = true local count = 0 for _, entry in index.List do for _, Method in {"send", "invoke"} do local target = type(entry.Packet) == "table" and UI.safe_get(entry.Packet, Method) if type(target) == "function" then local require_label = "require(" .. entry.Path .. ")" .. (entry.Via and ("." .. entry.Via) or "") .. UI.member(entry.Name) .. "." .. Method local filter_label = "find_packet(" .. string.format("%q", entry.Name) .. ", " .. string.format("%q", Method) .. ")." .. Method local done = pcall(function() local old old = X.hook_function(target, X.new_c_closure(function(...) local from_executor = X.check_caller() if shared.PacketsOn and not shared.PacketBusy and active and not paused and (not from_executor or Settings.Executor) then shared.PacketBusy = true pcall(function(...) local label = Settings.BufferCodeMode == "filtergc" and filter_label or require_label push(label, label, "lib", X.get_calling_script(), nil, select("#", ...), ...) end, ...) shared.PacketBusy = false end if shared.PacketsOn and active and (blocked[require_label] == true or blocked[filter_label] == true) and UI.block_applies(from_executor) then return end return old(...) end)) UI.packet_senders[require_label] = old UI.packet_senders[filter_label] = old end) if done then count += 1 end end end end if count == 0 then shared.PacketsHooked = false set_status("no packets found to hook (path of the packet modules: " .. tostring(Settings.PacketModules) .. ")") end end UI.set_lib = function() local installed = true UI.refresh_lib_block() if Settings.Tables or Settings.BlockTables then installed = UI.install_lib("table") and installed end if Settings.Buffers or Settings.BlockBuffers then installed = UI.install_lib("buffer") and installed end shared.LibOn = (Settings.Tables or Settings.Buffers or shared.LibBlockOn) and true or false if not installed then set_status("couldn't hook the table / buffer functions (needs hookfunction)") end end UI.log_allowed = function(type_name) local Mode = Settings.LogTypes if Mode == "errors only" then return type_name == "Error" elseif Mode == "warnings + errors" then return type_name == "Warning" or type_name == "Error" elseif Mode == "no info" then return type_name ~= "Info" end return true end UI.log_line = function(Message, message_type, stamp) local type_name = "Output" if typeof(message_type) == "EnumItem" then type_name = (string.gsub(message_type.Name, "^Message", "")) end if not UI.log_allowed(type_name) then return end Message = tostring(Message) if ignored[Message] or name_ignored(Message) then return end local before = #queue push(Message, type_name, "logservice", nil, false, 2, Message, type_name) if type(stamp) == "number" and #queue > before then local ok, Text = pcall(os.date, "%H:%M:%S", stamp) if ok then queue[#queue].Time = Text end end end UI.load_log_backlog = function() local ok, history = pcall(function() return UI.log_service.GetLogHistory(UI.log_service) end) if not ok or type(history) ~= "table" then set_status("couldn't read the existing output (LogService:GetLogHistory)") return end local loaded = 0 for index = math.max(1, #history - 499), #history do local entry = history[index] if type(entry) == "table" then UI.log_line(entry.message, entry.messageType, entry.timestamp) loaded += 1 end end set_status("loaded " .. loaded .. " lines of existing output") end do local log_busy = false local handler = function(Message, message_type) if log_busy or not active or paused or not Settings.LogService then return end log_busy = true pcall(UI.log_line, Message, message_type) log_busy = false end UI.own_callbacks[handler] = true Connect(UI.log_service.MessageOut, handler) end shared.LibBudget = (Settings.LibRate or 0) > 0 and Settings.LibRate or math.huge UI.set_lib() pcall(UI.set_packets) UI.set_output() UI.set_instance_new() UI.crash.sync() UI.set_misc() UI.set_wait() UI.set_raknet() if Settings.LogService and Settings.LogBacklog then task.spawn(UI.load_log_backlog) end destroy = function() active = false shared.LibOn = false shared.LibBlockOn = false shared.BlockOut = { } shared.capture_lib = function() end shared.capture_raknet = function() end pcall(UI.restore_log_readers) pcall(UI.crash.cleanup) for _, anim_track in UI.anim_tracks or { } do pcall(function() anim_track.stop(anim_track) end) end for part in UI.touch_blocked do UI.block_touch_part(part, false) end shared.ConnectionsOn = false shared.Capture = function() return false end shared.capture_http = function() return false end shared.notify = function() end if channel then pcall(function() channel.Fire(channel, "stop") end) local ok_is, is_bindable = pcall(function() return typeof(channel) == "Instance" and channel.IsA(channel, "BindableEvent") and channel.Parent ~= nil end) if ok_is and is_bindable then task.delay(1, function() pcall(function() channel.Destroy(channel) end) end) end end set_incoming(false) pcall(set_instant_prompts, false) for _, Connection in __R.connections do pcall(function() Connection.Disconnect(Connection) end) end Gui.Destroy(Gui) env.LarpSpy = nil end env.LarpSpy = { Destroy = destroy, Settings = Settings, Logs = function() return logs end, Block = set_blocked, Ignore = set_ignored, FindDebugInfo = function() UI.find_debug_info() end, SearchDebugInfo = function() UI.search_debug_info_source() end, } Connect(game.DescendantAdded, function(object) if Settings.TrackRenames and UI.remote_classes[class_of(object)] then UI.track_remote(object, true) end end) if Settings.TrackRenames then task.spawn(function() local ok, all = pcall(game.GetDescendants, game) if not ok then return end for index, object in all do if not active then return end if UI.remote_classes[class_of(object)] then UI.track_remote(object) end if index % 2000 == 0 then task.wait() end end end) end if Settings.Incoming then set_incoming(true) end shared.ConnectionsOn = Settings.Connections or Settings.LogReaders or Settings.BlockLogReaders if Settings.Http or Settings.BlockHttp then UI.install_http() end if Settings.BlockAllTouches then UI.set_block_all_touches(true) end if UI.sync_connections() and (Settings.LogReaders or Settings.BlockLogReaders) then task.spawn(UI.scan_log_readers) end if Settings.InstantPrompts then task.spawn(set_instant_prompts, true) end if Settings.Actors then task.spawn(inject_actors, false) end UI.adonis_url = "https://raw.githubusercontent.com/nfpw/LarpSpy/refs/heads/main/ab.lua" UI.load_adonis = function() if not loadstring then set_status("no loadstring in this executor") return end set_status("loading adonis bypass...") task.spawn(function() local source = http_get(UI.adonis_url) if not source then set_status("couldn't download the adonis bypass") return end local compiled, compile_error = loadstring(source) if not compiled then set_status("adonis bypass failed to compile: " .. tostring(compile_error)) return end local ok, run_error = pcall(compiled) if ok then env.__LarpAdonisLoaded = true set_status("adonis bypass loaded") else set_status("adonis bypass error: " .. tostring(run_error)) end end) end UI.start_all_hooks = function() local failed = { } local function try(Name, Function) local ok, result = pcall(Function) if not ok or result == false then table.insert(failed, Name) end end local keys = {"Tables", "Buffers", "InstanceNew", "Waits", "GetAttributes", "SetAttributes", "Sounds", "Connections", "Http", "Require"} local saved = { } for _, key in keys do saved[key] = Settings[key] Settings[key] = true end try("require", install_require) try("debug.info (game)", install_debug_info) try("http", UI.install_http) try("connections", __R.install_connections) try("table / buffer", UI.set_lib) try("Instance.new", UI.set_instance_new) try("task.wait", UI.set_wait) try("attributes / sound", UI.set_misc) for _, key in keys do Settings[key] = saved[key] end UI.set_lib() UI.sync_connections() return failed end local hook_failures = { } set_status((hook_status == "hooked" and "logging" or hook_status) .. (UI.adonis_status and (" | " .. UI.adonis_status) or "") .. (UI.hook_note and (" | " .. UI.hook_note) or "") .. (env.__LarpOthError and (" | oth.hook failed once: " .. string.sub(env.__LarpOthError, 1, 60)) or "") .. (#hook_failures > 0 and (" | hooks failed: " .. table.concat(hook_failures, ", ")) or " | all hooks ready")) end)() end end end end end end end end end end end end end end