pyminifier icon indicating copy to clipboard operation
pyminifier copied to clipboard

Function parameters not fully obfuscated?

Open MewX opened this issue 8 years ago • 3 comments

Hi, I'm using version 2.1.

Part of my codes look like this:

payload = '{"device":"xxx","id":"' + uuid + '","org":"yyy"}'
r = requests.post("https://xxx", data=payload, headers=headers, verify=False)

After many attempts, the codes after pyminifier -O always look like this:

c='{"device":"xxx","id":"'+q+'","org":"yyy"}'
r=a("https://xxx",data=payload,headers=headers,verify=P)

As you can see the variable payload and headers were not obfuscated, and that introduced the following error:

NameError: name 'payload' is not defined

Thanks!

MewX avatar Jan 14 '18 00:01 MewX

I'm having the exact same issue but finding very little online in terms of solutions. @MewX - did you ever find a solution? This is rendering pyminifier useless, which is a shame as it's great otherwise.

DGHC avatar Oct 11 '18 08:10 DGHC

@Jowls1 Nah, I probably was stupid, but I rewrote my codes in GoLang and that solved my problem. :unamused:

MewX avatar Oct 11 '18 21:10 MewX

Somewhat late, but I've found a workaround this same issue for pyminifer 2.1.

There is an erroneous check for equal sign outside parentheses before replacing the variable, which fails whenever a keyword argument is used inside a function call.

In module pyminifier.obfuscate.py I replaced line 416 elif right_of_equal and not inside_parens: by elif right_of_equal:

This correctly replaces all variable names used as keyword arguments. Note that it might cause unforeseen errors related to other edge cases !

bdaugrois avatar Mar 05 '19 17:03 bdaugrois