-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathkonstant.lua
More file actions
50 lines (37 loc) · 1.17 KB
/
konstant.lua
File metadata and controls
50 lines (37 loc) · 1.17 KB
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
-- by lovrewe
assert(getscriptbytecode, "Exploit not supported.")
local API = "http://api.plusgiant5.com"
local last_call = 0
local request = (syn and syn.request) or (http and http.request) or http_request or (fluxus and fluxus.request) or request
local function call(konstantType, scriptPath)
local success, bytecode = pcall(getscriptbytecode, scriptPath)
if (not success) then
return `-- Failed to get script bytecode, error:\n\n--[[\n{bytecode}\n--]]`
end
local time_elapsed = os.clock() - last_call
if time_elapsed <= .5 then
task.wait(.5 - time_elapsed)
end
local httpResult = request({
Url = API .. konstantType,
Body = bytecode,
Method = "POST",
Headers = {
["Content-Type"] = "text/plain"
}
})
last_call = os.clock()
if (httpResult.StatusCode ~= 200) then
return `-- Error occurred while requesting Konstant API, error:\n\n--[[\n{httpResult.Body}\n--]]`
else
return httpResult.Body
end
end
local function decompile(scriptPath)
return call("/konstant/decompile", scriptPath)
end
local function disassemble(scriptPath)
return call("/konstant/disassemble", scriptPath)
end
getgenv().decompile = decompile
getgenv().disassemble = disassemble