--[[
Report any bugs, issues and detections to me if you don't mind
(NoTwistedHere#6703)
V3 SaveInstance isn't the best so I had to make some adjustments in order for
this to work with v3 :) (doesn't work though)
]]
local getname = function(Object) if Object:IsA("Script") and getscriptname then
return getscriptname(Object) end return [Link] end
local gethash = function(Object) local Success, Response = pcall(function() return
getscripthash(Object) end) if Success and type(Response) == "string" then return
Response end return; end
local Threading =
loadstring(game:HttpGet("[Link]
Roblox/" .. (Branch or "main") .. "/[Link]"))()
local CoreGui, CorePackages, Players, RunService, RunService =
game:GetService("CoreGui"), game:GetService("CorePackages"),
game:GetService("Players"), game:GetService("RunService"),
game:GetService("RunService")
local Result = "<roblox xmlns:xmime=\"[Link]
xmlns:xsi=\"[Link]
xsi:noNamespaceSchemaLocation=\"[Link] version=\"4\">"
local Decompiled, Scripts = 0, {}
local DecompiledScripts = {}
local IgnoreEmpty = IgnoreEmpty or true
local Threads = Threads or 10
local Instances = {
"LocalScript";
"ModuleScript";
"RemoteEvent";
"RemoteFunction";
}
local Services = {
"StarterPlayerScripts";
"StarterCharacterScripts";
}
local SpecialCharacters = {
["<"] = "<";
[">"] = ">";
["&"] = "&";
["\""] = """;
["'"] = "'";
}
local Timeout = Timeout or 60 --// Decompiler timeout (in seconds)
if not RunService:IsRunning() then --// So you can dump scripts in games that do a
bit of funny business (I'm mainly trying to patch the things I come up with)
local function IsNetworkOwner(Object)
if Object:IsA("BasePart") and isnetworkowner(Object) then
return true
elseif not [Link] then
return false
end
return IsNetworkOwner([Link])
end
[Link]:Connect(function(Obj)
if Obj:IsA("LocalScript") then
--if not Obj:IsDescendantOf(workspace) then --// when will I be able to
spoof network replication :(
[Link] = true --// Not my fault if a game dev is actually
smart (or maybe it is)
--end
end
end)
repeat
[Link](0.5) --// There's no rush
until RunService:IsRunning()
end
local LocalPlayer = [Link]
local InstancesCreated, InstancesTotal = 0, #game:GetDescendants()
local Place = game:GetService("MarketplaceService"):GetProductInfo([Link])
local GameName = tostring(Place and [Link] or "Unknown Game"):gsub("[^%w%s]",
"")
local MainDirectory, SubDirectory, FileName, FileType, Final = "Game Dumps/", ("%d-
%s/"):format([Link], GameName), ("Scripts for %s [%s-%s]"):format(GameName,
[Link], [Link]), ".rbxlx", ""
if not isfolder(MainDirectory) then
makefolder(MainDirectory)
end
if not isfolder(MainDirectory..SubDirectory) then
makefolder(MainDirectory..SubDirectory)
end
if isfile(MainDirectory..SubDirectory..FileName..FileType) then
local Name, Count = "", 0
repeat
Count += 1
Name = FileName..(" (%d)"):format(Count)
until not isfile(MainDirectory..SubDirectory..Name..FileType)
FileName = Name
end
Final = MainDirectory..SubDirectory..FileName..FileType
local function GiveColour(Current, Max)
return (Current < Max * 0.25 and "@@RED@@") or (Current < Max * 0.5 and
"@@YELLOW@@") or (Current < Max * 0.75 and "@@CYAN@@") or "@@GREEN@@"
end
local function GetLoading()
local SpinnerCount = 0
return function()
local Chars = { "|", "/", "—", "\\" }
SpinnerCount += 1
if SpinnerCount > #Chars then
SpinnerCount = 1
end
return " "..Chars[SpinnerCount]
end
end
local function ProgressBar(Header, Current, Max, Thread)
local Size, PreviousCur, PreviousMax, Complete = 80, Current, Max, Current ==
Max
local Loading = GetLoading()
local LoadingChar = Loading()
local function Update(Current, Max, Extra_After)
local Progress, Percentage = [Link](Size * Current / Max),
[Link](100 * Current / Max)
if Complete then
return;
end
PreviousCur = Current
PreviousMax = Max
rconsoleprint(GiveColour(Current, Max))
rconsoleprint(("\13%s%s %s%s"):format(("#"):rep(Progress), ("."):rep(Size -
Progress), Percentage.."%", Percentage == 100 and "!\n" or Extra_After or
LoadingChar))
rconsoleprint("@@WHITE@@")
if Percentage == 100 then
Complete = true
end
end
rconsoleprint(Header.."\n")
[Link](function()
while not Complete and (not Thread and true or [Link](Thread) ~=
"dead") do
LoadingChar = Loading()
Update(PreviousCur, PreviousMax, LoadingChar)
[Link](0.25)
end
end)
return function(...)
[Link](Update, ...)
end
end
local function CheckObject(Object)
for _, v in next, Instances do
if Object:FindFirstChildWhichIsA(v, true) or Object:IsA(v) then
return true
end
end
return false
end
local function FindService(Service)
local Success, Response = pcall([Link], game, Service)
return Success and Response
end
local function FindScripts(Table)
for i, v in next, Table do
if typeof(v) == "Instance" and (v:IsA("LocalScript") or
v:IsA("ModuleScript")) or (not IgnoreEmpty or IgnoreEmpty and not gethash(v)) then
return true
end
end
return false
end
local function GetClassName(Object)
local ClassName = [Link]
if (Object:IsA("LocalScript") or Object:IsA("ModuleScript")) and not
gethash(Object) and IgnoreEmpty then
if not FindScripts(Object:GetDescendants()) then
return;
end
end
if [Link](Instances, ClassName) or [Link](Services, ClassName) or
FindService(ClassName) then
return ClassName
end
return "Folder"
end
local function SteralizeString(String)
return String:gsub("['\"<>&]", SpecialCharacters)
end
local function MakeInstance(Object, PGB)
local ClassName = GetClassName(Object)
if not ClassName then
return ""
end
local IntResult = ("<Item class=\"%s\" referent=\"RBX%s\"><Properties><string
name=\"Name\">%s</string>"):format(ClassName, Object:GetDebugId(0),
SteralizeString(getname(Object)))
if (ClassName == "LocalScript" or ClassName == "ModuleScript") then
local Hash = gethash(Object)
local Source = Hash and (DecompiledScripts[Hash] or "--// Failed to
decompile") or "--// Script has no bytecode"
if ClassName == "LocalScript" then
IntResult ..= ("<bool
name=\"Disabled\">%s</bool>"):format(tostring([Link] or not Hash))
end
IntResult ..= ([==[<ProtectedString
name="Source"><![CDATA[%s]]></ProtectedString>]==]):format(("--// Hash: %s\n
%s"):format(Hash or "nil", Source))
end
IntResult ..= "</Properties>"
for _, v in next, Object:GetChildren() do
if v ~= nil and v ~= game and CheckObject(v) then --// Give me stength
IntResult ..= MakeInstance(v, PGB)
end
end
IntResult ..= "</Item>"
InstancesCreated += 1
PGB(InstancesCreated, InstancesTotal)
return IntResult
end
local function Save()
Result ..= "</roblox>"
writefile(Final, Result)
end
local function GetScripts(Table, C)
local PGB = ProgressBar(("Collecting Scripts [%s]"):format(C), 0, 1,
[Link]())
for i, v in next, Table do
if (not v:IsA("LocalScript") and not v:IsA("ModuleScript")) or
(v:IsDescendantOf(CoreGui) or v:IsDescendantOf(CorePackages)) or
[Link](Scripts, v) then
continue;
end
PGB(i, #Table)
[Link](Scripts, v)
end
PGB(1, 1)
end
local function Decompile(...)
--if Timeout == 0 then
return decompile(...)
--end
--[[local Thread, Completed = [Link](), false
local DecompThread = [Link](function(...)
local Source = decompile(...)
Completed = true
if [Link](Thread) ~= "suspended" then
repeat
[Link](0.2) --// There's no rush
until [Link](Thread) == "suspended"
end
return [Link](Thread, Source)
end, ...)
[Link](Timeout, function()
if Completed then
return;
end
[Link](DecompThread)
return [Link](Thread)
end)
return [Link]()]]
end
local function FindNextScript()
for i, v in next, Scripts do
Scripts[i] = nil
return v
end
end
local function DecompileScripts()
local ThreadingGroup = [Link]("Group", true)
local Ended = false
local PGB = ProgressBar(("\nDecompiling Scripts [%s]"):format(#Scripts), 0,
#Scripts, [Link]())
while true do
if Ended then
break;
elseif [Link] == Threads then
[Link]:Wait("fg", Threads)
end
ThreadingGroup:Add(function()
local Script = FindNextScript()
if not Script then
Ended = true
[Link]:Fire()
return;
end
local Hash = gethash(Script)
if Hash and not DecompiledScripts[Hash] then
DecompiledScripts[Hash] = "--// Decompiling..."
DecompiledScripts[Hash] = Decompile(Script) or "--// Failed to
decompile"
end
Decompiled += 1
PGB(Decompiled, #Scripts)
end)
end
[Link]:Wait()
end
RunService:Set3dRenderingEnabled(false)
rconsoleclear()
rconsolename("Script Dumper")
GetScripts(getscripts(), "Running")
GetScripts(getnilinstances(), "Nil")
GetScripts(game:GetDescendants(), "Game")
DecompileScripts()
local InstanceCreatedPGB = ProgressBar("\nCreating XML", InstancesCreated,
InstancesTotal, [Link]())
for i, v in next, game:GetChildren() do
if v == CoreGui or v == CorePackages then
continue;
end
Result ..= MakeInstance(v, InstanceCreatedPGB)
end
Result..= MakeInstance({
ClassName = "Folder";
Name = "Nil Instances";
Parent = game;
GetChildren = function()
return getnilinstances()
end;
GetDebugId = function()
return [Link]("Folder"):GetDebugId(0)
end;
FindFirstChildWhichIsA = function()
return true
end;
IsA = function(_, IsA)
return IsA == "Folder"
end
}, InstanceCreatedPGB)
InstanceCreatedPGB(1, 1)
Save()
rconsoleprint("\nFinished")
RunService:Set3dRenderingEnabled(true)