· 4 years ago · Apr 09, 2021, 01:02 PM
1--[[
2 ________ ________ ___ ___
3|\ __ \|\ ____\|\ \|\ \
4\ \ \|\ \ \ \___|\ \ \\\ \
5 \ \ ____\ \_____ \ \ \\\ \
6 \ \ \___|\|____|\ \ \ \\\ \
7 \ \__\ ____\_\ \ \_______\
8 \|__| |\_________\|_______|
9 \|_________|
10
11 Perth genuinely likes dudes
12]]
13if not game then
14 warn("This script was meant to be ran in a ROBLOX LuaU environment.")
15 return
16end
17local Request = request or http_request or (syn and syn.request)
18local ClipBoard = setclipboard or toclipboard or set_clipboard or (Clipboard and Clipboard.set)
19if not (Request and ClipBoard) then
20 warn("Unsupported exploit.")
21 return
22end
23local HTTP = game:GetService("HttpService")
24local Endpoint = "http://api.psu.dev"
25local CheckEP = function(Point)
26 if Point == "obfuscate" then
27 return Request({
28 ["Url"] = Endpoint.."/"..Point,
29 ["Method"] = "GET"
30 }).StatusCode == 200
31 elseif Point == "key" then
32 return Request({
33 ["Url"] = Endpoint.."/"..Point,
34 ["Method"] = "GET"
35 }).StatusCode == 400
36 end
37end
38local Module = {}
39local Methods = {
40 ["Check_Key"] = function(self, Key)
41 if self ~= Module then
42 warn("Expcected ':' not '.' calling member function Check_Key")
43 return
44 end
45 local Response = Request({
46 ["Url"] = Endpoint.."/key",
47 ["Headers"] = {
48 ["key"] = Key
49 },
50 ["Method"] = "GET"
51 })
52 if Response.StatusCode ~= 200 then
53 warn("Key \""..Key.."\" is not a valid API Key.")
54 return
55 end
56 local Success, JSON = pcall(function()
57 return HTTP:JSONDecode(Response.Body)
58 end)
59 if not Success then
60 warn("There was an error parsing the request.")
61 return
62 end
63 if (JSON.status and JSON.status ~= "passed") or not JSON.status or (JSON.error and JSON.error > 0) or (JSON.disabled and JSON.disabled > 0) then
64 warn("Key \""..Key.."\" is not a valid API Key.")
65 return
66 end
67 warn("Key \""..Key.."\" is a valid API Key.")
68 return true
69 end,
70 ["Get_Info"] = function(self, Key, Display)
71 if self ~= Module then
72 warn("Expcected ':' not '.' calling member function Get_Info")
73 return
74 end
75 local Response = Request({
76 ["Url"] = Endpoint.."/key",
77 ["Headers"] = {
78 ["key"] = Key
79 },
80 ["Method"] = "GET"
81 })
82 if Response.StatusCode ~= 200 then
83 warn("Key \""..Key.."\" is not a valid API Key.")
84 return
85 end
86 local Success, JSON = pcall(function()
87 return HTTP:JSONDecode(Response.Body)
88 end)
89 if not Success then
90 warn("There was an error parsing the request.")
91 return
92 end
93 if (JSON.status and JSON.status ~= "passed") or not JSON.status or (JSON.error and JSON.error > 0) then
94 warn("Key \""..Key.."\" is not a valid API Key.")
95 return
96 end
97 if Display and JSON.data then
98 for i, v in next, JSON.data do
99 print(i..": "..v)
100 end
101 return
102 end
103 return JSON.data ~= nil and JSON.data or {"Could not get the data table."}
104 end
105}
106local WriteObfuscated = function(Data)
107 local RandomString = function(Length)
108 math.randomseed(os.time())
109 local Result, Amount, Characters = "", tonumber(Length), "abcdefghijklmnopqrstuvwxyz1234567890"
110 for i = 1, Amount do
111 local Index, Upper = math.random(1, #Characters), math.random(1, 2)
112 Result = Result..(Upper == 1 and Characters:sub(Index, Index):upper() or Characters:sub(Index, Index))
113 end
114 return Result
115 end
116 local Name
117 repeat
118 Name = "Obfuscated ("..RandomString(10)..").lua"
119 wait()
120 until not pcall(readfile, Name)
121 writefile(Name, Data)
122 return Name
123end
124setmetatable(Module, {
125 __index = function(self, Index)
126 return Methods[Index]
127 end,
128 __newindex = function(self, Key, Value)
129 warn("Invalid assignment of \""..tostring(Value).."\" to \""..tostring(Key).."\"")
130 return
131 end,
132 __call = function()
133 warn("PSU-API Wrapper. Written in LUA by Tohru. Inspired by Perth.")
134 return
135 end,
136 __metatable = "The metatable is locked."
137})
138local Obfuscate = function(self, Key, Options)
139 if typeof(self) ~= "string" then
140 warn("Expected 'string' not '"..typeof(self).."' calling member function Obfuscate")
141 return
142 end
143 local Data = Module:Get_Info(Key)
144 if not Data then
145 return
146 end
147 if Data.reqsleft and Data.reqsleft < 0 then
148 warn("You have exceeded your daily API obfuscations.")
149 return
150 end
151 local Default = {
152 ["DisableSuperOperators"] = false,
153 ["MaximumSecurityEnabled"] = true,
154 ["ControlFlowObfuscation"] = false,
155 ["ConstantEncryption"] = false,
156 ["EncryptAllStrings"] = false,
157 ["DisableAllMacros"] = false,
158 ["EnhancedOutput"] = false,
159 ["EnhancedConstantEncryption"] = false,
160 ["CompressedOutput"] = false,
161 ["PremiumFormat"] = true,
162 ["ByteCodeMode"] = "Default"
163 }
164 if Options and typeof(Options) == "table" then
165 for i, v in next, Options do
166 if Default[i] then
167 Default[i] = v
168 end
169 end
170 end
171 local RequestData = {
172 ["script"] = self,
173 ["key"] = Key,
174 ["options"] = Default
175 }
176 local Response = Request({
177 ["Url"] = Endpoint.."/obfuscate",
178 ["Method"] = "POST",
179 ["Headers"] = {
180 ["Content-Type"] = "application/json"
181 },
182 ["Body"] = HTTP:JSONEncode(RequestData)
183 })
184 local Success, JSON = pcall(function()
185 return HTTP:JSONDecode(Response.Body)
186 end)
187 if not Success then
188 warn("There was an error parsing your request.")
189 return
190 end
191 if Response.StatusCode == 400 then
192 warn("Bad Request. Reason: \""..(JSON.reason == nil and JSON.message == nil and Response.Body) or JSON.reason == nil and JSON.message or JSON.reason.."\"")
193 return
194 elseif Response.StatusCode ~= 200 then
195 warn("There was an error processing your request.")
196 return
197 end
198 if JSON.status and JSON.status ~= "passed" then
199 warn("Error Code: "..JSON.error.." \""..JSON.reason.."\"")
200 return
201 end
202 warn("Your script was obfuscated successfully.\nLook for \""..WriteObfuscated(JSON.data).."\" in your workspace folder for your obfuscated script.\nYou have "..Data.reqsleft.." out of "..Data.allowed.." requests left for today.")
203end
204local OldString = string
205if setreadonly then
206 setreadonly(OldString, false)
207elseif make_writeable then
208 make_writeable(OldString)
209end
210OldString["Obfuscate"] = Obfuscate
211getgenv().string = setmetatable({}, {
212 __index = function(self, Index)
213 return OldString[Index]
214 end,
215 __newindex = function(self, Key, Value)
216 OldString[Key] = Value
217 return Value
218 end
219})
220warn("PSU-API Wrapper loaded.")
221return Module