Topaz is a decompiler for LuaU bytecode built off of the codebase of Medal.
Usage: topaz.exe <COMMAND>
Commands:
decompile Decompile a single bytecode file, either raw or base64 encoded
serve Start a simple web server to handle decompiling
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print versionWall-clock budget is 180 seconds by default. Override with --time-budget SECS or TOPAZ_TIME_BUDGET_SECS. If the budget expires the CLI still writes whatever it has, stamps the file with TOPAZ_INCOMPLETE, converts leftover goto/::label:: to comments (Luau has no goto), and exits non-zero. TOPAZ_DEBUG_CYCLES=1 prints per-pass timings; =2 is the verbose per-round goto log.
When using topaz serve, you can use the decompiler directly inside of your executor.
These scripts assume you are self-hosting the decompiler.
If you are using some sort of API, make sure to replace http://localhost:3000 or http://10.0.2.2:3000 with the correct API base.
getgenv().decompile = function(scriptInstance)
local url = "http://localhost:3000/luau/decompile"
local rawBytecode = getscriptbytecode(scriptInstance)
local payload = {
Url = url,
Method = "POST",
Headers = { ["Content-Type"] = "application/octet-stream" },
Body = rawBytecode
}
local httpRequest = request or http_request or (syn and syn.request)
local success, response = pcall(function() return httpRequest(payload) end)
return response.Body
end
getgenv().syn = getgenv().syn or {}
getgenv().syn.decompile = getgenv().decompile
getgenv().Fluxus = getgenv().Fluxus or {}
getgenv().Fluxus.decompile = getgenv().decompile
getgenv().Hydra = getgenv().Hydra or {}
getgenv().Hydra.decompile = getgenv().decompile
loadstring(game:HttpGet("https://github.com/Tesker-103/DexRecontinued/releases/latest/download/out.lua"))()
print("Environments patched. Now execute Dex and try opening a script.")Note
Note
- If you have a proxy enabled in WiFi settings, add
10.0.2.2to the exceptions or disable the proxy - If you are using a VPN, allow LAN connections
Run the web-server on your actual machine.
If you are using an emulator, localhost will not work since that will refer to the emulator's device.
Instead, we must use 10.0.2.2 instead.
To test if everything is working, on your actual machine [http://localhost:3000/] should load fine, and on the emulator's browser, [http://10.0.2.2:3000/] should load. If your emulator is giving you HTTP connection fail errors, then you can try ngrok instead.
getgenv().decompile = function(scriptInstance)
local url = "http://10.0.2.2:3000/luau/decompile"
local rawBytecode = getscriptbytecode(scriptInstance)
local payload = {
Url = url,
Method = "POST",
Headers = { ["Content-Type"] = "application/octet-stream" },
Body = rawBytecode
}
local httpRequest = request or http_request or (syn and syn.request)
local success, response = pcall(function() return httpRequest(payload) end)
return response.Body
end
getgenv().syn = getgenv().syn or {}
getgenv().syn.decompile = getgenv().decompile
getgenv().Fluxus = getgenv().Fluxus or {}
getgenv().Fluxus.decompile = getgenv().decompile
getgenv().Hydra = getgenv().Hydra or {}
getgenv().Hydra.decompile = getgenv().decompile
loadstring(game:HttpGet("https://github.com/Tesker-103/DexRecontinued/releases/latest/download/out.lua"))()
print("Environments patched. Now execute Dex and try opening a script.")The original license for medal is retained, but the license for this fork has been changed to stop people from profiting from open source work for free.
All credits to the medal project goes to in honor and memory of
- Jujhar Singh (KowalskiFX)
- Mathias Pedersen (Customality)
Keep the Singh and Pedersen family in your guys' prayers, we love you both.