prometheus-lua / Prometheus

Lua Obfuscator written in pure Lua
https://levno-710.gitbook.io/prometheus/
GNU Affero General Public License v3.0
220 stars 65 forks source link

Pipe Issues #142

Open D3sTeptu opened 1 year ago

D3sTeptu commented 1 year ago
  1. When you use Strong preset on any script, it will ALWAYS throw error:

Example of code:

local a = b

if not a then print("BBB") end
  1. When I use WatermarkCheck step in presets.lua it automatically converts the watermark into a Bytecode. Also, the watermark check in the code is visible for everyone, for example:
("\084\104\105\115 \083\099\114\105\112\116 \105\115 \080\097\114\116 \111\102 \116\104\101 \080\114\111\109\101\116\104\101\117\115 \079\098\102\117\115\099\097\116\111\114 \098\121 \076\101\118\110\111\095\055\049\048"):gsub("\046\043",function(s)_xnuv64=s end)if _xnuv64~="\084\104\105\115 \083\099\114\105\112\116 \105\115 \080\097\114\116 \111\102 \116\104\101 \080\114\111\109\101\116\104\101\117\115 \079\098\102\117\115\099\097\116\111\114 \098\121 \076\101\118\110\111\095\055\049\048"then return end
  1. If there is an error in the code while running, the console output does not give Informations about the error. This is not an issue but it should be by default enabled to detect what causing the errors and fix it. Example:

Original Code:

local b = 4
if a > 2 then 
     print("There should print the Line 2 error") 
end

Error:

 ./a.obfuscated.lua:1: attempt to compare number with nil
stack traceback:
        ./a.obfuscated.lua:1: in function <./a.obfuscated.lua:1>
        (...tail calls...)
        [C]: in ?
Zaenalos commented 1 year ago

2 and 3 is intended.

levno-710 commented 1 year ago

@D3sTeptu Could you provide more information on what platform you are using. I am unabled to reproduce 1. If you are using LuaU, try adding the --LuaU flag on the cli.

As for 3. This is due to prometheus stripping all debug information, including line information. I would suggest just testing the script before obfuscating and only obfuscating when being sure no unexpected errors are thrown.

D3sTeptu commented 1 year ago

I am using Lua 5.3 (FiveM). On 3. It's important on FiveM or Roblox because sometimes it throw unexpected errors, and Prometheus should not print the obfucated code, and instead print the line of original code and the error (EX: attempted to compare with nil value).

levno-710 commented 1 year ago

@D3sTeptu @NougatBitz has tried debugging this issue. He found that this has to do, with the different environment Syntax of 5.3 compared to 5.1. Can you try adding the following line in front of the obfuscated code that you get:

_ENV._ENV = _ENV

Please let me know if this fixes your issue. When I have time, I will make it so, that this code is automatically added somewhere.

D3sTeptu commented 1 year ago

I've tried to add the code above the obfuscated one and still is not compatible with Lua 5.3. I know the issue: In Lua 5.1 it's different the for _, _, val in code:gmatch("createString%((.-),(.-),(.-),(.-),(.-)%)") do. The pattern for , , val in code:gmatch is missing the required parameters and proper syntax for the gmatch function in Lua 5.1/LuaU.

And I also experienced errors when I tried to use this: table.insert(myTable, 4). I think that I fixed it with this: myTable[#myTable+1] = 4