Capybara_ele

Untitled

Mar 31st, 2026
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.25 KB | None | 0 0
  1. --[[
  2. Script Execution Spy
  3. Captures any Lua code that gets executed after this spy runs
  4. Works with Luarmor and other encrypted scripts
  5. ]]
  6.  
  7. -- Create a folder to store captured scripts
  8. local spyFolder = "ScriptSpy_" .. os.time()
  9. makefolder(spyFolder)
  10.  
  11. -- Store original functions
  12. local old_loadstring = loadstring
  13. local old_load = load
  14. local old_Instance_new = Instance.new
  15.  
  16. -- Counter for captured scripts
  17. local scriptCounter = 0
  18.  
  19. -- Function to capture and save code
  20. local function captureCode(code, source)
  21. if not code or type(code) ~= "string" then return end
  22.  
  23. -- Only capture significant code (skip empty or very short)
  24. if #code > 200 then
  25. scriptCounter = scriptCounter + 1
  26. local filename = string.format("%s/script_%03d_%s.lua", spyFolder, scriptCounter, source or "unknown")
  27.  
  28. -- Add header with timestamp and source
  29. local header = string.format("--[[ Captured Script #%d\n-- Source: %s\n-- Time: %s\n-- Size: %d bytes\n--]]\n\n",
  30. scriptCounter, source or "unknown", os.date("%Y-%m-%d %H:%M:%S"), #code)
  31.  
  32. local fullCode = header .. code
  33.  
  34. -- Try to save to file
  35. local success, err = pcall(function()
  36. writefile(filename, fullCode)
  37. end)
  38.  
  39. if success then
  40. print(string.format("[SPY] Captured script #%d (%d bytes) saved to: %s", scriptCounter, #code, filename))
  41. else
  42. -- If writefile fails, try to print to console
  43. print(string.format("[SPY] Captured script #%d (%d bytes) - cannot save file", scriptCounter, #code))
  44. print("===== START CODE =====")
  45. print(string.sub(code, 1, 2000)) -- Print first 2000 chars
  46. print("===== END CODE =====")
  47. end
  48.  
  49. -- Try to copy to clipboard if supported
  50. pcall(setclipboard, fullCode)
  51. end
  52. end
  53.  
  54. -- Hook loadstring
  55. loadstring = function(code, chunkname)
  56. captureCode(code, "loadstring_" .. (chunkname or "unknown"))
  57. return old_loadstring(code, chunkname)
  58. end
  59.  
  60. -- Hook load
  61. load = function(code, chunkname, mode, env)
  62. captureCode(code, "load_" .. (chunkname or "unknown"))
  63. return old_load(code, chunkname, mode, env)
  64. end
  65.  
  66. -- Hook LocalScript creation
  67. Instance.new = function(className, parent)
  68. local instance = old_Instance_new(className, parent)
  69.  
  70. if className == "LocalScript" or className == "ModuleScript" then
  71. -- Watch for scripts being created
  72. local oldSource = instance.Source
  73. local scriptName = instance.Name
  74.  
  75. instance:GetPropertyChangedSignal("Source"):Connect(function()
  76. local newSource = instance.Source
  77. if newSource and newSource ~= oldSource and #newSource > 100 then
  78. captureCode(newSource, string.format("Instance_%s_%s", className, scriptName))
  79. oldSource = newSource
  80. end
  81. end)
  82. end
  83.  
  84. return instance
  85. end
  86.  
  87. -- Also hook RemoteFunction/Event triggers that might send code
  88. local old_FireServer = nil
  89. for _, service in pairs(game:GetDescendants()) do
  90. if service:IsA("RemoteFunction") or service:IsA("RemoteEvent") then
  91. if not old_FireServer then
  92. old_FireServer = service.FireServer
  93. service.FireServer = function(self, ...)
  94. local args = {...}
  95. for i, arg in pairs(args) do
  96. if type(arg) == "string" and #arg > 200 then
  97. captureCode(arg, string.format("Remote_%s_arg%d", self.Name, i))
  98. end
  99. end
  100. return old_FireServer(self, ...)
  101. end
  102. end
  103. end
  104. end
  105.  
  106. print("[SPY] Script spy activated! Running the target script...")
  107. print("[SPY] Captured scripts will be saved to folder: " .. spyFolder)
  108. print("")
  109.  
  110. -- Now run the target script
  111. loadstring(game:HttpGet("https://api.luarmor.net/files/v4/loaders/644bc1fd548dfde30e203fc6ba3734c8.lua"))()
  112.  
  113. -- Keep spy active to catch any late-loading scripts
  114. task.spawn(function()
  115. while task.wait(1) do
  116. print("[SPY] Active - captured " .. scriptCounter .. " scripts so far")
  117. end
  118. end)
  119.  
  120. print("[SPY] Target script executed. Check console for captures.")
Advertisement
Add Comment
Please, Sign In to add comment