Closed VeNoMouS closed 4 years ago
This should not be problem because the restrict mode isn't violated by the obfuscated scripts normally. Once restrict mode is violated, it may result in segmentation fault.
idealy what id love to see also happen is on restricted modules... __all__
, __getattr__
etc to be blocked, as doing it manually is tedious
ideally would love to see that automatically embedded , not just blocking on function execution
or my preference of choice... the module blocked completely from being loaded in the first place if restricted mode 4 etc... that way if you have ie config.py with variable data, you won't get any leakage ....
since you still load a restricted module... then just module.__dict__
to see the vars and values
It's complex to protect module attribute, I'll first check the source of CPython.
Found solution, please upgrade to v6.3.7. From this version the plain script couldn't visit any module attribute if this module is obfuscated with restrict mode 2, 3 or 4
omg ❤️ that is awesome, will upgrade and do my own tests, thanks @jondy
I ended up having to put my own __dir__
, __all__
, __dict__
etc and some other techniques i dont want to discuss openly ;P just stop that kinda stuff, so will be good not have to that myself ❤️
i'll let you know if i find any issues
Initial testing looks really good @jondy
Hi @jondy,
I know your pretty busy resolving the issues that came about with 6.3.0, I was just wondering if i could get some clear proper examples of how to use the restrict modes..
What im trying to do
if i have a dir
I want
__init__.py
to be import-able with restrict 1, but how do i then also have packer.py restrict 3 so it cant be imported outside of the__init__.py
?You doc doesn't cover proper examples things like this, it just doesn't make it clear enough , sorry