Prometheus
Prometheus copied to clipboard
[BUG] Unresolved Upvalue in LibDeflate.lua
Describe the bug I was testing against https://github.com/SafeteeWoW/LibDeflate/blob/main/LibDeflate.lua and it failed.
To Reproduce .\prometheus.exe --out .\LibDeflate_Obfuscated.lua --preset Medium .\LibDeflate.lua
PROMETHEUS: Applying Obfuscation Pipeline to .\LibDeflate.lua ... PROMETHEUS: Parsing ... PROMETHEUS: Parsing Done in 0.21 seconds PROMETHEUS: Applying Step "Encrypt Strings" ... PROMETHEUS: Step "Encrypt Strings" Done in 0.02 seconds PROMETHEUS: Applying Step "Anti Tamper" ... PROMETHEUS: Step "Anti Tamper" Done in 0.01 seconds PROMETHEUS: Applying Step "Vmify" ... PROMETHEUS: Unresolved Upvalue, this error should not occur!
Try to remove anti tamper sir.
Anti tamper isnt the issue here. The VM is unable to handle certain repeat until
s since it doesn't correctly handle how locals work in them. Any local defined during the repeat
's body can be referenced in the until
even if it wasn't defined before the repeat
Take the following code:
local i = 0
repeat
local x = 5
i = i + 1
until x == 5 or i >= 3
if i >= 3 or x ~= nil then
error("Incorrectly handled repeat until")
else
print("Repeat went just fine")
end
The x
in the repeat
can be called in the until
block, even though it never previously existed. The VM seems to not support this case, and throws an error about upvalues if you attempt to VMify this code.
Interestingly enough, minifying seems to handle just fine with this situation, so there's clearly some part of this code which can already handle this