Загрузка данных


-- POINTS TEST B: discover hidden/relevant remotes + bounded heuristic tests
print("[POINTS B] 01 start")

local Players=game:GetService("Players")
local p=Players.LocalPlayer
if not p then warn("[POINTS B] no player") return end
local pg=p:WaitForChild("PlayerGui")
local ls=p:WaitForChild("leaderstats",10)
local pts=ls and ls:WaitForChild("Points",10)
if not pts or typeof(pts.Value)~="number" then warn("[POINTS B] no numeric Points") return end

local function L(...) print("[POINTS B]",...) end
local function W(...) warn("[POINTS B]",...) end
local function N(o) local ok,v=pcall(function() return o:GetFullName() end) return ok and v or tostring(o) end
local words={"point","score","reward","give","grant","earn","claim","currency","cash","money","coin","xp","experience","level","action","complete"}
local function relevant(s) s=string.lower(tostring(s)); for _,w in ipairs(words) do if string.find(s,w,1,true) then return true end end return false end
local function remote(x) return typeof(x)=="Instance" and (x:IsA("RemoteEvent") or x:IsA("RemoteFunction")) end

local old=pg:FindFirstChild("points_test_b") if old then old:Destroy() end
local g=Instance.new("ScreenGui"); g.Name="points_test_b"; g.ResetOnSpawn=false; g.IgnoreGuiInset=true; g.DisplayOrder=999999; g.Parent=pg
local b=Instance.new("TextButton"); b.Size=UDim2.fromOffset(220,54); b.Position=UDim2.fromOffset(18,150); b.BackgroundColor3=Color3.fromRGB(75,92,180); b.BorderSizePixel=0; b.Text="DISCOVER + FUZZ"; b.TextColor3=Color3.new(1,1,1); b.TextSize=15; b.Font=Enum.Font.GothamBold; b.Parent=g

local running=false
local function add(list,seen,r,src)
	if remote(r) and not seen[r] then seen[r]=true; table.insert(list,{r=r,src=src}) end
end

local function discover()
	local list,seen={},{}
	for _,o in ipairs(game:GetDescendants()) do if remote(o) and relevant(N(o)) then add(list,seen,o,"name/path") end end

	if type(getsenv)=="function" then
		for _,root in ipairs({p:FindFirstChild("PlayerScripts"),p:FindFirstChild("PlayerGui")}) do
			if root then
				for _,s in ipairs(root:GetDescendants()) do
					if s:IsA("LocalScript") then
						local ok,e=pcall(getsenv,s)
						if ok and typeof(e)=="table" then
							for k,v in pairs(e) do if remote(v) and (relevant(k) or relevant(N(v))) then add(list,seen,v,"getsenv") end end
						end
					end
				end
			end
		end
	end

	if type(getgc)=="function" then
		local ok,all=pcall(getgc,true)
		if ok and typeof(all)=="table" then
			local n=0
			for _,x in ipairs(all) do
				n+=1; if n>10000 then break end
				if typeof(x)=="table" then
					for k,v in pairs(x) do if remote(v) and (relevant(k) or relevant(N(v))) then add(list,seen,v,"getgc-table") end end
				elseif typeof(x)=="function" and debug and type(debug.getconstants)=="function" and type(debug.getupvalues)=="function" then
					local hit=false
					local a,c=pcall(debug.getconstants,x)
					if a and typeof(c)=="table" then for _,z in ipairs(c) do if typeof(z)=="string" and relevant(z) then hit=true break end end end
					if hit then
						local u,ups=pcall(debug.getupvalues,x)
						if u and typeof(ups)=="table" then for _,v in pairs(ups) do if remote(v) then add(list,seen,v,"getgc-upvalue") end end end
					end
				end
			end
		end
	end
	return list
end

local function invoke(r,args)
	local done=false local ok=false local res
	task.spawn(function()
		local a,v=pcall(function() return r:InvokeServer(table.unpack(args,1,args.n or #args)) end)
		ok=a; res=v; done=true
	end)
	for _=1,24 do if done then break end task.wait(.05) end
	if not done then return "timeout" end
	if not ok then return "error" end
	L("return",tostring(res)); return "ok"
end

local function send(r,args,label)
	L("TRY",N(r),label)
	if r:IsA("RemoteEvent") then
		local ok,e=pcall(function() r:FireServer(table.unpack(args,1,args.n or #args)) end)
		if not ok then W("fire error",tostring(e)); return "error" end
		return "ok"
	else
		local st=invoke(r,args)
		if st=="timeout" then W("timeout",N(r)) end
		return st
	end
end

local function observe(before)
	for _=1,10 do task.wait(.1) end
	task.wait(.5)
	return pts.Value-before
end

local tests={
	{"number1",table.pack(1)},{"number5",table.pack(5)},
	{"Points,1",table.pack("Points",1)},{"points,1",table.pack("points",1)},
	{"add,1",table.pack("add",1)},{"reward,1",table.pack("reward",1)},
	{"give,1",table.pack("give",1)},{"claim,1",table.pack("claim",1)},
	{"player,1",table.pack(p,1)},{"userid,1",table.pack(p.UserId,1)},
	{"table Points",table.pack({Points=1})},{"table amount",table.pack({amount=1})},
	{"table reward",table.pack({reward=1})}
}

local function run()
	if running then return end
	running=true; b.Text="DISCOVERING..."

	local start=pts.Value
	task.wait(1.5)
	if pts.Value~=start then W("Points changed during baseline; retry idle"); b.Text="DISCOVER + FUZZ"; running=false; return end

	local list=discover()
	L("candidates=",#list)
	for i,e in ipairs(list) do L("CANDIDATE",i,N(e.r),"source=",e.src) end

	local count=0
	for _,e in ipairs(list) do
		count+=1; if count>20 then W("20 candidate cap reached"); break end
		b.Text="TEST "..count.."/"..math.min(#list,20)
		local lim=e.r:IsA("RemoteFunction") and 4 or #tests
		for i=1,lim do
			local t=tests[i]
			local before=pts.Value
			local st=send(e.r,t[2],t[1])
			if st=="timeout" then break end
			local d=observe(before)
			L("RESULT",N(e.r),t[1],"delta=",d)
			if d>0 then W("SERVER ACCEPTED?",N(e.r),t[1],"+",d) end
			task.wait(.1)
		end
		if e.r:IsA("RemoteEvent") then
			local before=pts.Value
			for _=1,3 do pcall(function() e.r:FireServer(1) end); task.wait(.08) end
			local d=observe(before)
			L("BURST",N(e.r),"delta=",d)
			if d>0 then W("RATE/REPLAY ISSUE?",N(e.r),"+",d) end
		end
	end

	L("DONE | final Points=",pts.Value)
	L("caps getgc=",type(getgc)=="function","getsenv=",type(getsenv)=="function")
	b.Text="DISCOVER + FUZZ"; running=false
end

b.MouseButton1Click:Connect(run)
L("READY")