From ef2ac40f2be14c2e6b8d9f79dde82bb660ffd484 Mon Sep 17 00:00:00 2001 From: phoriah <95628489+phoriah@users.noreply.github.com> Date: Sun, 11 Aug 2024 19:42:41 +0200 Subject: [PATCH] Revert "Fix Built-in Decompiler Timeout" This reverts commit dd44825bd6b889c356e27e41479f6f265f4c58e0. --- saveinstance.luau | 49 ++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/saveinstance.luau b/saveinstance.luau index b173c48..93f01b6 100644 --- a/saveinstance.luau +++ b/saveinstance.luau @@ -222,7 +222,7 @@ do -- * Load Region of Déjà Vu end end -local custom_decompiler +local custom_decompiler, load_decompiler -- TODO Temporary if getscriptbytecode then -- Credits @w-a-e @@ -234,12 +234,13 @@ if getscriptbytecode then game:HttpGet("https://raw.githubusercontent.com/w-a-e/Advanced-Decompiler-V3/main/init.lua", true) end) then - local CONSTANTS = [[ + load_decompiler = function(decompTimeout) + local CONSTANTS = [[ local ENABLED_REMARKS = { NATIVE_REMARK = true, INLINE_REMARK = true } - local DECOMPILER_TIMEOUT = 3600 + local DECOMPILER_TIMEOUT = ]] .. decompTimeout .. [[ local READER_FLOAT_PRECISION = 7 -- up to 99 local SHOW_INSTRUCTION_LINES = false @@ -249,28 +250,29 @@ if getscriptbytecode then local LIST_USED_GLOBALS = true local RETURN_ELAPSED_TIME = false ]] - local _ENV = (getgenv or getrenv or getfenv)() - local old = _ENV.decompile + local _ENV = (getgenv or getrenv or getfenv)() + local old = _ENV.decompile - local f = loadstring( - string.gsub( + local f = loadstring( string.gsub( - decompiler_source, - "return %(x %% 2^32%) // %(2^disp%)", - "return math.floor((x %% 2^32) / (2^disp))", - 1 - ), -- TODO Temporary fix for macsploit (// operator) - ";;CONSTANTS HERE;;", - CONSTANTS - ), - "Advanced-Decompiler-V3" - ) - if not f then - return + string.gsub( + decompiler_source, + "return %(x %% 2^32%) // %(2^disp%)", + "return math.floor((x %% 2^32) / (2^disp))", + 1 + ), -- TODO Temporary fix for macsploit (// operator) + ";;CONSTANTS HERE;;", + CONSTANTS + ), + "Advanced-Decompiler-V3" + ) + if not f then + return + end + f() + custom_decompiler = _ENV.decompile + _ENV.decompile = old end - f() - custom_decompiler = _ENV.decompile - _ENV.decompile = old end end @@ -1910,6 +1912,9 @@ local function synsaveinstance(CustomOptions, CustomOptions2) end do + if load_decompiler then + load_decompiler(Timeout) + end local Decompiler = OPTIONS.decomptype == "custom" and custom_decompiler or global_container.decompile or custom_decompiler