-
Notifications
You must be signed in to change notification settings - Fork 0
/
BreakingPointRemoteSpy.luau
170 lines (159 loc) · 6.09 KB
/
BreakingPointRemoteSpy.luau
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
-- Breaking Point Remote spy
local getgenv = getgenv or function() return _G end -- We never know
local rconsoleprint = rconsoleprint or print
if getgenv().bp_remotespy_connection then getgenv().bp_remotespy_connection:Disconnect() end
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local function export(tabl, forcedictlayout, beautify, tabs)
SPACES_PER_TAB = 2
if typeof(tabl) ~= "table" then return error("Argument 1 should be of type 'table'.") end
local function formatstring(str, stringchar)
local stringchar = stringchar or "\""
local function isnormalcharacter(char)
local charbyte = string.byte(char)
if (charbyte >= 32 and charbyte <= 126) or charbyte == 10 then
return true
else
return false
end
end
local function formatfunc(char)
if isnormalcharacter(char) then
if char == stringchar then
return table.concat({"\\", stringchar})
else
if char == "\n" then
return "\\n"
elseif char == "\\" then
return "\\\\"
else
return char
end
end
else
return table.concat({"\\", tostring(string.byte(char))})
end
end
return (str:gsub(".", formatfunc) or str)
end
local IsArray = true
local completeIsArray = false
local isEmpty = true
if not forcedictlayout then
local previous = 0
for i,_ in tabl do
isEmpty = false
if typeof(i) ~= "number" or i-previous ~= 1 then
IsArray = false
completeIsArray = true
else
previous = i
end
if completeIsArray then
break
end
end
else
IsArray = false
for _,_ in tabl do
isEmpty = false
break
end
end
if isEmpty then return "{}" end
if not IsArray and beautify == nil then beautify = true end
tabs = tabs or 1
local tab = string.rep(" ", tabs*SPACES_PER_TAB)
local out = {"{"}
local shouldbeautify = (tabs == 1 or not IsArray) and beautify
local isDict = forcedictlayout or not IsArray
for i,v in tabl do
if shouldbeautify then
table.insert(out, "\n")
table.insert(out, tab)
end
if isDict then
table.insert(out, "[")
if typeof(i) == "string" then
if formatstring(i) == i and string.find("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", string.sub(i, 0,1)) and not forcedictlayout then
table.remove(out, #out)
else
table.insert(out, "\"")
end
table.insert(out, formatstring(i))
if formatstring(i) ~= i or not string.find("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", string.sub(i, 0,1)) or forcedictlayout then
table.insert(out, "\"]")
end
elseif typeof(i) == "number" then
table.insert(out, tostring(i))
table.insert(out, "]")
else
table.insert(out, "\"")
table.insert(out, formatstring(tostring(i)))
table.insert(out, " (Type: ")
table.insert(out, formatstring(typeof(i)))
table.insert(out, ")\"]")
end
table.insert(out, " = ")
end
if typeof(v) == "string" then
table.insert(out, "\"")
table.insert(out, formatstring(v))
table.insert(out, "\"")
elseif typeof(v) == "number" then
if tostring(v) == "inf" then
table.insert(out, "math.huge")
elseif tostring(v) == "-inf" then
table.insert(out, "-math.huge")
elseif tostring(v) == "nan" then
table.insert(out, "0/0")
else
table.insert(out, tostring(v))
end
elseif typeof(v) == "table" then
if tostring(v) == tostring(tabl) then
table.insert(out, "\"")
table.insert(out, formatstring(tostring(v)))
table.insert(out, " (*** cycle table reference detected ***)\"")
else
table.insert(out, export(v, forcedictlayout, beautify, tabs + 1))
end
elseif typeof(v) == "boolean" then
table.insert(out, tostring(v))
elseif typeof(v) == "function" then
table.insert(out, "\"")
table.insert(out, formatstring(tostring(v)))
table.insert(out, " (Function name: ")
table.insert(out, formatstring(debug.info(v, "n")))
table.insert(out, ")\"")
else
table.insert(out, "\"")
table.insert(out, formatstring(tostring(v)))
table.insert(out, " (Type: ")
table.insert(out, formatstring(typeof(v)))
table.insert(out, ")\"]")
end
table.insert(out, ",")
if not shouldbeautify then
table.insert(out, " ")
end
end
table.remove(out, #out)
if not shouldbeautify then
table.remove(out, #out)
end
if shouldbeautify then
table.insert(out, "\n")
table.insert(out, string.rep(" ", (tabs-1)*SPACES_PER_TAB))
end
table.insert(out, "}")
return table.concat(out)
end
local ServerCodes = loadstring(game:HttpGet("https://raw.githubusercontent.com/LateAlways/BreakingPointAPI/refs/heads/main/BreakingPointServerCodes.luau"))()
getgenv().bp_remotespy_connection = ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(PacketType, ...)
if tonumber(PacketType) then
PacketType = ServerCodes[tonumber(PacketType)]
end
local args = {...}
rconsoleprint(table.concat({"New Packet:", "\nType: ", PacketType, "\nArguments: ", export(args, true, true)}))
end)
rconsoleprint("Breaking Point Remote Spy")