citizenfx / fivem

The source code for the Cfx.re modification frameworks, such as FiveM, RedM and LibertyM, as well as FXServer.
https://cfx.re/
3.41k stars 2k forks source link

Asset Escrow breaks the debug library #1309

Open rdelian opened 2 years ago

rdelian commented 2 years ago

Info

As the title says, Asset Escrow brakes the debug library, I personally use it to automate a few tasks

Repro

--file path is : ./repro_escrowdebug/server.lua
function Loko()
    local call_data = debug.getinfo(2,'S')

    print(json.encode(call_data))
end
Loko()

Output

Expected

{
    "source": "@@repro_escrowdebug/server.lua",
    "short_src": "@repro_escrowdebug/server.lua",
    "linedefined": 0, "lastlinedefined": 0, "what": "main"
}

Encrypted

{
    "source": "=?",
    "short_src": "?", 
    "linedefined": 0, "lastlinedefined": 0, "what": "main"
}
blattersturm commented 2 years ago

Intended and already reported, leaving in debug info would also make for easier use of deobfuscation tools.

External debug info/mapping is considered but would require custom Lua patchwork.

rdelian commented 2 years ago

leaving in debug info would also make for easier use of deobfuscation tools.

Totally understood, will not use escrow_ignore on the affected files then

already reported

I tried to look on Forum and Discord but couldn't find anything

It would be cool to have a place to discuss such things, get info on where to post an issue or if it was already reported but not publically etc

jaksam1074 commented 2 years ago

Hi

About this @rdelian

I tried to look on Forum and Discord but couldn't find anything

I also noticed this issue some time ago, this was the FiveM post I've wrote https://forum.cfx.re/t/output-errors-method-using-escrow-system/4796470

About this @blattersturm

Intended and already reported, leaving in debug info would also make for easier use of deobfuscation tools.

External debug info/mapping is considered but would require custom Lua patchwork.

Is there anything that you would suggest to debug scripts that are using the asset escrow? I'm having difficulties on providing support for a script of mine which has over 14.000 lines, about an error I cannot replicate on mine server where the script is not using asset escrow. Is adding print everywhere the only solution or do you have a better suggestion?

Thank you for your time 😁

BugCode1 commented 5 months ago

Is there any plan for this issue?