Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Parenthesis-enclosed expressions aren't truncated to 1 value #154

Open
9382 opened this issue Nov 15, 2023 · 3 comments
Open

[BUG] Parenthesis-enclosed expressions aren't truncated to 1 value #154

9382 opened this issue Nov 15, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@9382
Copy link

9382 commented Nov 15, 2023

Describe the bug
The obfuscator doesn't support truncating the output of a function or ... using parenthesis (())

Expected behavior
The amount of values to be truncated (or raised with a nil in the case of no output) to 1 argument - See lua 5.1 documentation §2.5

To Reproduce
Here's a function which displays this behaviour - the output will be different between the obfuscated script and the original code

local function x()
	return 3, 4, 5
end
print("Expecting '3, 4, 5' and then just '3'")
print(x())
print((x()))
@9382 9382 added the bug Something isn't working label Nov 15, 2023
@Zaenalos
Copy link

Zaenalos commented Nov 16, 2023

I tried to replicate the bug and the obfuscated script produces the same output. I think you should change your preset.

@9382
Copy link
Author

9382 commented Nov 16, 2023

I just attempted it on purely the "Minify" preset (so no obfuscation at all) and it produced the following code:

local function p()return 3,4,5 end
print("\069\120\112\101\099\116\101\100 \'\051\044 \052\044 \053\' \097\110\100 \116\104\101\110 \106\117\115\116 \'\051\'")
print(p())
print(p())

(I manually added the newlines)
As you can see, the last line has had the extra parenthesis stripped, which means the truncation no longer takes place, and both prints now become identical (they should not be identical). Are you sure you can't replicate this bug?

@levno-710
Copy link
Member

levno-710 commented Dec 14, 2023

I will look into this this weekend.
I didn't consider this case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants