python-obfuscation-framework 1.9.4__tar.gz → 1.10.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_obfuscation_framework-1.9.4/python_obfuscation_framework.egg-info → python_obfuscation_framework-1.10.0}/PKG-INFO +35 -30
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/README.md +34 -29
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/cli_v2.py +0 -6
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/main.py +6 -59
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/__init__.py +0 -6
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/junk/dead_code.py +37 -11
- python_obfuscation_framework-1.10.0/pof/obfuscator/names.py +401 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pyproject.toml +1 -1
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0/python_obfuscation_framework.egg-info}/PKG-INFO +35 -30
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/python_obfuscation_framework.egg-info/SOURCES.txt +1 -3
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/tests/obfuscator/conftest.py +14 -31
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/tests/obfuscator/fixtures/complex.py +31 -0
- python_obfuscation_framework-1.10.0/tests/obfuscator/fixtures/getattr.py +10 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/tests/obfuscator/test_edge_cases.py +0 -6
- python_obfuscation_framework-1.9.4/pof/obfuscator/definitions.py +0 -356
- python_obfuscation_framework-1.9.4/pof/obfuscator/names.py +0 -490
- python_obfuscation_framework-1.9.4/pof/obfuscator/names_rope.py +0 -397
- python_obfuscation_framework-1.9.4/pof/obfuscator/variables.py +0 -116
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/LICENSE +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/MANIFEST.in +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/__main__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/cli.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/errors.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/argv.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/base.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/cpu/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/cpu/cpu_count.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/fs/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/fs/directory_exist.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/fs/directory_list_exist.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/fs/directory_list_missing.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/fs/directory_missing.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/fs/exec_method.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/fs/executable_path.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/fs/file_exist.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/fs/file_list_exist.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/fs/file_list_missing.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/fs/file_missing.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/fs/tmp.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/hardware/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/hardware/ram_count.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/hooks/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/hooks/debugger.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/hooks/tracemalloc.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/human/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/human/p.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/human/prompt.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/integrity.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/multi.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/os/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/os/domain.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/os/hostname.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/os/uid.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/os/username.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/processes/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/processes/proc_count.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/time/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/time/expire.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/time/uptime.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/time/utc.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/evasion/utils.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/logger.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/boolean.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/builtins.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/cipher/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/cipher/deep_encryption.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/cipher/rc4.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/cipher/shift.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/cipher/xor.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/compression/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/compression/bz2.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/compression/gzip.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/compression/lzma.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/compression/zlib.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/constants.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/controlflow/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/controlflow/control_flow_flatten.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/encoding/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/encoding/a85.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/encoding/b16.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/encoding/b32.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/encoding/b32hex.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/encoding/b64.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/encoding/b85.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/encoding/binascii.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/encoding/snt.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/encoding/whitespace.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/esoteric/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/esoteric/call.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/esoteric/doc.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/esoteric/globals.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/esoteric/imports.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/extract_variables.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/junk/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/junk/add_comments.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/junk/add_newlines.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/numbers.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/other/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/other/tokens.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/remove/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/remove/comments.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/remove/exceptions.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/remove/indents.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/remove/loggings.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/remove/loggings_old.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/remove/newline.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/remove/print.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/restructure.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/stegano/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/stegano/docstrings.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/stegano/ipv6encoding.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/stegano/macencoding.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/stegano/uuidencoding.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/obfuscator/strings.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/stager/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/stager/cipher/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/stager/cipher/rc4.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/stager/download.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/stager/image.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/stager/lots/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/stager/lots/cl1pnet.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/stager/lots/pastebin.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/stager/lots/pasters.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/stager/quine.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/cipher/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/cipher/rc4.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/cipher/shift.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/compression/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/compression/bz2.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/compression/gzip.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/compression/lzma.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/compression/zlib.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/encoding/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/encoding/a85.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/encoding/b16.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/encoding/b3.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/encoding/b32.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/encoding/b32hex.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/encoding/b64.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/encoding/b85.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/encoding/binascii.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/encoding/snt.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/encoding/whitespace.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/entropy.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/extract_names.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/format.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/generator/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/generator/advanced.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/generator/base.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/generator/basic.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/generator/comments.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/generator/comments.txt +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/generator/names.txt +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/generator/unicode.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/se/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/se/homoglyphs.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/se/homoglyphs.txt +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/stegano/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/stegano/ipv6encoding.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/stegano/macencoding.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/stegano/uuidencoding.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/pof/utils/tokens.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/python_obfuscation_framework.egg-info/dependency_links.txt +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/python_obfuscation_framework.egg-info/entry_points.txt +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/python_obfuscation_framework.egg-info/requires.txt +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/python_obfuscation_framework.egg-info/top_level.txt +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/setup.cfg +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/tests/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/tests/obfuscator/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/tests/obfuscator/fixtures/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/tests/obfuscator/fixtures/moderate.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/tests/obfuscator/fixtures/multiline_strings.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/tests/obfuscator/fixtures/simple.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/tests/obfuscator/test_integration.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/tests/obfuscator/utils.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/tests/pyproject.toml +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/tests/utils/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/tests/utils/se/__init__.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/tests/utils/se/test_homoglyphs.py +0 -0
- {python_obfuscation_framework-1.9.4 → python_obfuscation_framework-1.10.0}/tests/utils/test_generator.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-obfuscation-framework
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.10.0
|
|
4
4
|
Summary: Python Obfuscation Framework
|
|
5
5
|
Author-email: deoktr <35725720+deoktr@users.noreply.github.com>
|
|
6
6
|
Maintainer-email: deoktr <35725720+deoktr@users.noreply.github.com>
|
|
@@ -320,53 +320,44 @@ echo "print('Hello, world')" | pof -f obfuscator -k UUIDObfuscator | python
|
|
|
320
320
|
|
|
321
321
|
### Obfuscator
|
|
322
322
|
|
|
323
|
-
`
|
|
323
|
+
`NamesObfuscator` obfuscator is renaming variables, classes, and functions.
|
|
324
324
|
|
|
325
325
|
Source in `examples/source.py`.
|
|
326
326
|
|
|
327
327
|
```python
|
|
328
328
|
import os
|
|
329
329
|
|
|
330
|
-
def
|
|
330
|
+
def BJM4FaQJf1():
|
|
331
331
|
"""Get Linux release info from /etc/os-release."""
|
|
332
|
-
|
|
333
|
-
if not os.path.exists(
|
|
332
|
+
h77 = '/etc/os-release'
|
|
333
|
+
if not os.path.exists(h77):
|
|
334
334
|
print('OS release file not found. This might not be a Linux system.')
|
|
335
335
|
return None
|
|
336
|
-
|
|
336
|
+
jkFr = {}
|
|
337
337
|
try:
|
|
338
|
-
with open(
|
|
339
|
-
for
|
|
340
|
-
if not
|
|
338
|
+
with open(h77, 'r') as LfQ:
|
|
339
|
+
for GIVt40c7RR in LfQ:
|
|
340
|
+
if not GIVt40c7RR or '=' not in GIVt40c7RR:
|
|
341
341
|
continue
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
342
|
+
KPO5j, RQvTXmL = GIVt40c7RR.strip().split('=', 1)
|
|
343
|
+
RQvTXmL = RQvTXmL.strip('"\'\n')
|
|
344
|
+
jkFr[KPO5j] = RQvTXmL
|
|
345
345
|
print('\nLinux Release Information:')
|
|
346
|
-
print(f"Distribution: {
|
|
347
|
-
print(f"Version: {
|
|
348
|
-
print(f"Version ID: {
|
|
349
|
-
print(f"Pretty Name: {
|
|
350
|
-
return
|
|
351
|
-
except Exception as
|
|
352
|
-
print(f'Error reading release file: {
|
|
346
|
+
print(f"Distribution: {jkFr.get('NAME', 'Unknown')}")
|
|
347
|
+
print(f"Version: {jkFr.get('VERSION', 'Unknown')}")
|
|
348
|
+
print(f"Version ID: {jkFr.get('VERSION_ID', 'Unknown')}")
|
|
349
|
+
print(f"Pretty Name: {jkFr.get('PRETTY_NAME', 'Unknown')}")
|
|
350
|
+
return jkFr
|
|
351
|
+
except Exception as LzYLqi_:
|
|
352
|
+
print(f'Error reading release file: {LzYLqi_}')
|
|
353
353
|
return None
|
|
354
354
|
if __name__ == '__main__':
|
|
355
355
|
if os.name == 'posix' and os.path.exists('/etc/os-release'):
|
|
356
|
-
|
|
356
|
+
yv4HAqmn = BJM4FaQJf1()
|
|
357
357
|
else:
|
|
358
358
|
print('This script is designed for Linux systems.')
|
|
359
359
|
```
|
|
360
360
|
|
|
361
|
-
`DefinitionsObfuscator` obfuscate function names.
|
|
362
|
-
|
|
363
|
-
> [!WARNING]
|
|
364
|
-
> `NamesObfuscator` obfuscator is renaming variables, classes, functions, and
|
|
365
|
-
> imports. Right now this obfuscator can fail under very specific circumstances,
|
|
366
|
-
> see `pof/obfuscator/names.py`. There is an alternative implementation at
|
|
367
|
-
> `NamesRopeObfuscator` that uses `rope`, it's a work in progress and currently
|
|
368
|
-
> does not obfuscate variables declared inside functions.
|
|
369
|
-
|
|
370
361
|
Other very basic obfuscation functions are done by specific obfuscators like:
|
|
371
362
|
|
|
372
363
|
- Removing comments with `CommentsObfuscator`.
|
|
@@ -873,6 +864,21 @@ def greet(name):
|
|
|
873
864
|
> [!NOTE]
|
|
874
865
|
> Functions containing `yield`, `async`, or `try/except` are skipped and left unchanged.
|
|
875
866
|
|
|
867
|
+
#### DeadCodeObfuscator
|
|
868
|
+
|
|
869
|
+
Insert dead (unreachable/unused) code blocks into the source.
|
|
870
|
+
|
|
871
|
+
Source: `print('Hello, world')`
|
|
872
|
+
|
|
873
|
+
```python
|
|
874
|
+
while False:
|
|
875
|
+
Etb4inx6B1=[21,7,46,2]
|
|
876
|
+
agw_QLOu=283-42
|
|
877
|
+
FwQ2='msg'
|
|
878
|
+
|
|
879
|
+
print('Hello, world')
|
|
880
|
+
```
|
|
881
|
+
|
|
876
882
|
### Stager
|
|
877
883
|
|
|
878
884
|
#### DownloadStager
|
|
@@ -1366,7 +1372,6 @@ Other Python obfuscation projects:
|
|
|
1366
1372
|
|
|
1367
1373
|
## TODO
|
|
1368
1374
|
|
|
1369
|
-
- Add dead code, opaque predicates.
|
|
1370
1375
|
- Fix `NamesObfuscator`.
|
|
1371
1376
|
- Add option to prepend a shebang, and add ability to customize it.
|
|
1372
1377
|
|
|
@@ -275,53 +275,44 @@ echo "print('Hello, world')" | pof -f obfuscator -k UUIDObfuscator | python
|
|
|
275
275
|
|
|
276
276
|
### Obfuscator
|
|
277
277
|
|
|
278
|
-
`
|
|
278
|
+
`NamesObfuscator` obfuscator is renaming variables, classes, and functions.
|
|
279
279
|
|
|
280
280
|
Source in `examples/source.py`.
|
|
281
281
|
|
|
282
282
|
```python
|
|
283
283
|
import os
|
|
284
284
|
|
|
285
|
-
def
|
|
285
|
+
def BJM4FaQJf1():
|
|
286
286
|
"""Get Linux release info from /etc/os-release."""
|
|
287
|
-
|
|
288
|
-
if not os.path.exists(
|
|
287
|
+
h77 = '/etc/os-release'
|
|
288
|
+
if not os.path.exists(h77):
|
|
289
289
|
print('OS release file not found. This might not be a Linux system.')
|
|
290
290
|
return None
|
|
291
|
-
|
|
291
|
+
jkFr = {}
|
|
292
292
|
try:
|
|
293
|
-
with open(
|
|
294
|
-
for
|
|
295
|
-
if not
|
|
293
|
+
with open(h77, 'r') as LfQ:
|
|
294
|
+
for GIVt40c7RR in LfQ:
|
|
295
|
+
if not GIVt40c7RR or '=' not in GIVt40c7RR:
|
|
296
296
|
continue
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
297
|
+
KPO5j, RQvTXmL = GIVt40c7RR.strip().split('=', 1)
|
|
298
|
+
RQvTXmL = RQvTXmL.strip('"\'\n')
|
|
299
|
+
jkFr[KPO5j] = RQvTXmL
|
|
300
300
|
print('\nLinux Release Information:')
|
|
301
|
-
print(f"Distribution: {
|
|
302
|
-
print(f"Version: {
|
|
303
|
-
print(f"Version ID: {
|
|
304
|
-
print(f"Pretty Name: {
|
|
305
|
-
return
|
|
306
|
-
except Exception as
|
|
307
|
-
print(f'Error reading release file: {
|
|
301
|
+
print(f"Distribution: {jkFr.get('NAME', 'Unknown')}")
|
|
302
|
+
print(f"Version: {jkFr.get('VERSION', 'Unknown')}")
|
|
303
|
+
print(f"Version ID: {jkFr.get('VERSION_ID', 'Unknown')}")
|
|
304
|
+
print(f"Pretty Name: {jkFr.get('PRETTY_NAME', 'Unknown')}")
|
|
305
|
+
return jkFr
|
|
306
|
+
except Exception as LzYLqi_:
|
|
307
|
+
print(f'Error reading release file: {LzYLqi_}')
|
|
308
308
|
return None
|
|
309
309
|
if __name__ == '__main__':
|
|
310
310
|
if os.name == 'posix' and os.path.exists('/etc/os-release'):
|
|
311
|
-
|
|
311
|
+
yv4HAqmn = BJM4FaQJf1()
|
|
312
312
|
else:
|
|
313
313
|
print('This script is designed for Linux systems.')
|
|
314
314
|
```
|
|
315
315
|
|
|
316
|
-
`DefinitionsObfuscator` obfuscate function names.
|
|
317
|
-
|
|
318
|
-
> [!WARNING]
|
|
319
|
-
> `NamesObfuscator` obfuscator is renaming variables, classes, functions, and
|
|
320
|
-
> imports. Right now this obfuscator can fail under very specific circumstances,
|
|
321
|
-
> see `pof/obfuscator/names.py`. There is an alternative implementation at
|
|
322
|
-
> `NamesRopeObfuscator` that uses `rope`, it's a work in progress and currently
|
|
323
|
-
> does not obfuscate variables declared inside functions.
|
|
324
|
-
|
|
325
316
|
Other very basic obfuscation functions are done by specific obfuscators like:
|
|
326
317
|
|
|
327
318
|
- Removing comments with `CommentsObfuscator`.
|
|
@@ -828,6 +819,21 @@ def greet(name):
|
|
|
828
819
|
> [!NOTE]
|
|
829
820
|
> Functions containing `yield`, `async`, or `try/except` are skipped and left unchanged.
|
|
830
821
|
|
|
822
|
+
#### DeadCodeObfuscator
|
|
823
|
+
|
|
824
|
+
Insert dead (unreachable/unused) code blocks into the source.
|
|
825
|
+
|
|
826
|
+
Source: `print('Hello, world')`
|
|
827
|
+
|
|
828
|
+
```python
|
|
829
|
+
while False:
|
|
830
|
+
Etb4inx6B1=[21,7,46,2]
|
|
831
|
+
agw_QLOu=283-42
|
|
832
|
+
FwQ2='msg'
|
|
833
|
+
|
|
834
|
+
print('Hello, world')
|
|
835
|
+
```
|
|
836
|
+
|
|
831
837
|
### Stager
|
|
832
838
|
|
|
833
839
|
#### DownloadStager
|
|
@@ -1321,7 +1327,6 @@ Other Python obfuscation projects:
|
|
|
1321
1327
|
|
|
1322
1328
|
## TODO
|
|
1323
1329
|
|
|
1324
|
-
- Add dead code, opaque predicates.
|
|
1325
1330
|
- Fix `NamesObfuscator`.
|
|
1326
1331
|
- Add option to prepend a shebang, and add ability to customize it.
|
|
1327
1332
|
|
|
@@ -92,9 +92,6 @@ def add_obfuscation(tokens, args):
|
|
|
92
92
|
if args.obf_constants:
|
|
93
93
|
logger.debug("obfuscating constants")
|
|
94
94
|
tokens = ConstantsObfuscator().obfuscate_tokens(tokens)
|
|
95
|
-
if args.obf_definitions:
|
|
96
|
-
logger.debug("obfuscating definitions")
|
|
97
|
-
tokens = DefinitionsObfuscator().obfuscate_tokens(tokens)
|
|
98
95
|
if args.obf_a85:
|
|
99
96
|
logger.debug("obfuscating a85")
|
|
100
97
|
tokens = ASCII85Obfuscator().obfuscate_tokens(tokens)
|
|
@@ -146,9 +143,6 @@ def add_obfuscation(tokens, args):
|
|
|
146
143
|
if args.obf_names:
|
|
147
144
|
logger.debug("obfuscating names")
|
|
148
145
|
tokens = NamesObfuscator().obfuscate_tokens(tokens)
|
|
149
|
-
if args.obf_names_rope:
|
|
150
|
-
logger.debug("obfuscating names_rope")
|
|
151
|
-
tokens = NamesRopeObfuscator().obfuscate_tokens(tokens)
|
|
152
146
|
if args.obf_numbers:
|
|
153
147
|
logger.debug("obfuscating numbers")
|
|
154
148
|
tokens = NumberObfuscator().obfuscate_tokens(tokens)
|
|
@@ -45,7 +45,6 @@ from pof.obfuscator import (
|
|
|
45
45
|
BuiltinsObfuscator,
|
|
46
46
|
CommentsObfuscator,
|
|
47
47
|
ConstantsObfuscator,
|
|
48
|
-
DefinitionsObfuscator,
|
|
49
48
|
DocstringObfuscator,
|
|
50
49
|
ExceptionObfuscator,
|
|
51
50
|
GlobalsObfuscator,
|
|
@@ -56,7 +55,6 @@ from pof.obfuscator import (
|
|
|
56
55
|
NumberObfuscator,
|
|
57
56
|
PrintObfuscator,
|
|
58
57
|
StringsObfuscator,
|
|
59
|
-
VariablesObfuscator,
|
|
60
58
|
XORObfuscator,
|
|
61
59
|
)
|
|
62
60
|
from pof.stager import ImageStager, RC4Stager
|
|
@@ -123,8 +121,6 @@ class Obfuscator(BaseObfuscator):
|
|
|
123
121
|
generator=ex_generator,
|
|
124
122
|
).obfuscate_tokens(tokens)
|
|
125
123
|
|
|
126
|
-
tokens = DefinitionsObfuscator().obfuscate_tokens(tokens)
|
|
127
|
-
|
|
128
124
|
# configure generator
|
|
129
125
|
# generator = alphabet_generator()
|
|
130
126
|
gen_dict = {
|
|
@@ -145,42 +141,7 @@ class Obfuscator(BaseObfuscator):
|
|
|
145
141
|
obf_builtins_rate=0.3,
|
|
146
142
|
).obfuscate_tokens(tokens)
|
|
147
143
|
|
|
148
|
-
|
|
149
|
-
# for detailed explanation just consider the following:
|
|
150
|
-
# ```
|
|
151
|
-
# import module
|
|
152
|
-
# class Bar:
|
|
153
|
-
# def __init__(self):
|
|
154
|
-
# self.foo = getattr(config, "FOO", True)
|
|
155
|
-
# module.imported.function(self.foo)
|
|
156
|
-
# ```
|
|
157
|
-
# in this case the first instance of `foo` will successfully be
|
|
158
|
-
# obfuscated (as it should) but then with the getattr it's marked has
|
|
159
|
-
# "imported" because it's the result of a builtin function, but notice
|
|
160
|
-
# that it's not a "simple" variable but rather it's a class attribute
|
|
161
|
-
# and has a 'self' behind it, so if the variable is marked has imported
|
|
162
|
-
# and a `.` is placed behind it, it won't be changed, this is the case
|
|
163
|
-
# in the function call, which is itself imported, and thus set the
|
|
164
|
-
# imported attribute for itself and all the parameters given to it
|
|
165
|
-
# this is because we don't keep track of the level of the imported
|
|
166
|
-
#
|
|
167
|
-
# FIXME (deoktr): breaks !
|
|
168
|
-
# Another problem is related to result of function, this is, ofc very
|
|
169
|
-
# hard to deal with, but if a function returns an object, such has for
|
|
170
|
-
# example an object of an imported class, which attribute are not
|
|
171
|
-
# obfuscatable, then it breaks.
|
|
172
|
-
# ```
|
|
173
|
-
# import foo
|
|
174
|
-
# def a():
|
|
175
|
-
# return foo.bar()
|
|
176
|
-
# x = a()
|
|
177
|
-
# x.baz()
|
|
178
|
-
# ```
|
|
179
|
-
# In this context, `baz` would be obfuscated, but it shouldn't because
|
|
180
|
-
# the function is part of the `foo` imported module
|
|
181
|
-
# tokens = NamesObfuscator(generator=generator).obfuscate_tokens(tokens)
|
|
182
|
-
# TODO (deoktr): use alternative variable obfuscator using the AST
|
|
183
|
-
# tokens = VariablesObfuscator().obfuscate_tokens(tokens)
|
|
144
|
+
tokens = NamesObfuscator(generator=generator).obfuscate_tokens(tokens)
|
|
184
145
|
|
|
185
146
|
tokens = GlobalsObfuscator().obfuscate_tokens(tokens)
|
|
186
147
|
tokens = BuiltinsObfuscator().obfuscate_tokens(tokens)
|
|
@@ -241,9 +202,7 @@ class Obfuscator(BaseObfuscator):
|
|
|
241
202
|
tokens = self._get_tokens(source)
|
|
242
203
|
tokens = CommentsObfuscator().obfuscate_tokens(tokens)
|
|
243
204
|
generator = BasicGenerator.alphabet_generator()
|
|
244
|
-
|
|
245
|
-
tokens = VariablesObfuscator(generator=generator).obfuscate_tokens(tokens)
|
|
246
|
-
tokens = DefinitionsObfuscator(generator=generator).obfuscate_tokens(tokens)
|
|
205
|
+
tokens = NamesObfuscator(generator=generator).obfuscate_tokens(tokens)
|
|
247
206
|
tokens = IndentsObfuscator().obfuscate_tokens(tokens)
|
|
248
207
|
tokens = NewlineObfuscator().obfuscate_tokens(tokens)
|
|
249
208
|
return self._untokenize(tokens)
|
|
@@ -309,18 +268,7 @@ class Obfuscator(BaseObfuscator):
|
|
|
309
268
|
tokens = CommentsObfuscator().obfuscate_tokens(tokens)
|
|
310
269
|
tokens = ExceptionObfuscator(generator=generator).obfuscate_tokens(tokens)
|
|
311
270
|
tokens = LoggingObfuscator(generator=generator).obfuscate_tokens(tokens)
|
|
312
|
-
|
|
313
|
-
# tokens = ConstantsObfuscator(
|
|
314
|
-
# generator=generator,
|
|
315
|
-
# obf_number_rate=1,
|
|
316
|
-
# # FIXME (deoktr): breaks if obf_string_rate=1 with NamesObfuscator
|
|
317
|
-
# obf_string_rate=0,
|
|
318
|
-
# # FIXME (deoktr): breaks if obf_builtins_rate=1 with NamesObfuscator
|
|
319
|
-
# obf_builtins_rate=0,
|
|
320
|
-
# ).obfuscate_tokens(tokens)
|
|
321
|
-
# tokens = NamesObfuscator(generator=generator).obfuscate_tokens(tokens)
|
|
322
|
-
tokens = VariablesObfuscator(generator=generator).obfuscate_tokens(tokens)
|
|
323
|
-
tokens = DefinitionsObfuscator(generator=generator).obfuscate_tokens(tokens)
|
|
271
|
+
tokens = NamesObfuscator(generator=generator).obfuscate_tokens(tokens)
|
|
324
272
|
tokens = ConstantsObfuscator(
|
|
325
273
|
generator=generator,
|
|
326
274
|
obf_number_rate=1,
|
|
@@ -384,10 +332,9 @@ class Obfuscator(BaseObfuscator):
|
|
|
384
332
|
# tokens = ConstantsObfuscator(generator=generator).obfuscate_tokens(tokens)
|
|
385
333
|
|
|
386
334
|
tokens = CommentsObfuscator().obfuscate_tokens(tokens)
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
# ).obfuscate_tokens(tokens)
|
|
335
|
+
tokens = NamesObfuscator(
|
|
336
|
+
generator=AdvancedGenerator.fixed_length_generator(),
|
|
337
|
+
).obfuscate_tokens(tokens)
|
|
391
338
|
tokens = BooleanObfuscator().obfuscate_tokens(tokens)
|
|
392
339
|
tokens = IndentsObfuscator().obfuscate_tokens(tokens)
|
|
393
340
|
tokens = NewlineObfuscator().obfuscate_tokens(tokens)
|
|
@@ -26,7 +26,6 @@ from .compression.lzma import LzmaObfuscator
|
|
|
26
26
|
from .compression.zlib import ZlibObfuscator
|
|
27
27
|
from .constants import ConstantsObfuscator
|
|
28
28
|
from .controlflow.control_flow_flatten import ControlFlowFlattenObfuscator
|
|
29
|
-
from .definitions import DefinitionsObfuscator
|
|
30
29
|
from .encoding.a85 import ASCII85Obfuscator
|
|
31
30
|
from .encoding.b16 import Base16Obfuscator
|
|
32
31
|
from .encoding.b32 import Base32Obfuscator
|
|
@@ -45,7 +44,6 @@ from .junk.add_comments import AddCommentsObfuscator
|
|
|
45
44
|
from .junk.add_newlines import AddNewlinesObfuscator
|
|
46
45
|
from .junk.dead_code import DeadCodeObfuscator
|
|
47
46
|
from .names import NamesObfuscator
|
|
48
|
-
from .names_rope import NamesRopeObfuscator
|
|
49
47
|
from .numbers import NumberObfuscator
|
|
50
48
|
from .other.tokens import TokensObfuscator
|
|
51
49
|
from .remove.comments import CommentsObfuscator
|
|
@@ -59,7 +57,6 @@ from .stegano.ipv6encoding import IPv6Obfuscator
|
|
|
59
57
|
from .stegano.macencoding import MACObfuscator
|
|
60
58
|
from .stegano.uuidencoding import UUIDObfuscator
|
|
61
59
|
from .strings import StringsObfuscator
|
|
62
|
-
from .variables import VariablesObfuscator
|
|
63
60
|
|
|
64
61
|
__all__ = [
|
|
65
62
|
"ASCII85Obfuscator",
|
|
@@ -81,7 +78,6 @@ __all__ = [
|
|
|
81
78
|
"ControlFlowFlattenObfuscator",
|
|
82
79
|
"DeadCodeObfuscator",
|
|
83
80
|
"DeepEncryptionObfuscator",
|
|
84
|
-
"DefinitionsObfuscator",
|
|
85
81
|
"DocstringObfuscator",
|
|
86
82
|
"ExceptionObfuscator",
|
|
87
83
|
"ExtractVariablesObfuscator",
|
|
@@ -95,7 +91,6 @@ __all__ = [
|
|
|
95
91
|
"LzmaObfuscator",
|
|
96
92
|
"MACObfuscator",
|
|
97
93
|
"NamesObfuscator",
|
|
98
|
-
"NamesRopeObfuscator",
|
|
99
94
|
"NewlineObfuscator",
|
|
100
95
|
"NumberObfuscator",
|
|
101
96
|
"PrintObfuscator",
|
|
@@ -105,7 +100,6 @@ __all__ = [
|
|
|
105
100
|
"StringsObfuscator",
|
|
106
101
|
"TokensObfuscator",
|
|
107
102
|
"UUIDObfuscator",
|
|
108
|
-
"VariablesObfuscator",
|
|
109
103
|
"WhitespaceObfuscator",
|
|
110
104
|
"XORObfuscator",
|
|
111
105
|
"ZlibObfuscator",
|
|
@@ -147,17 +147,37 @@ class DeadCodeObfuscator:
|
|
|
147
147
|
tokens.append((DEDENT, ""))
|
|
148
148
|
return tokens
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
@staticmethod
|
|
151
|
+
def _get_false_cond():
|
|
151
152
|
false_conds = [
|
|
152
153
|
[(NAME, "False")],
|
|
153
154
|
[(NUMBER, "0")],
|
|
154
155
|
[(STRING, '""')],
|
|
155
156
|
[(NAME, "None")],
|
|
157
|
+
[
|
|
158
|
+
(NUMBER, str(random.randint(1, 50))),
|
|
159
|
+
(OP, ">"),
|
|
160
|
+
(NUMBER, str(random.randint(51, 100))),
|
|
161
|
+
],
|
|
162
|
+
[
|
|
163
|
+
(NUMBER, str(random.randint(1, 50))),
|
|
164
|
+
(OP, "=="),
|
|
165
|
+
(NUMBER, str(random.randint(51, 100))),
|
|
166
|
+
],
|
|
167
|
+
[(NAME, "not"), (NAME, "True")],
|
|
168
|
+
[(NAME, "True"), (NAME, "and"), (NAME, "False")],
|
|
169
|
+
[(NUMBER, "0"), (OP, "*"), (NUMBER, str(random.randint(1, 999)))],
|
|
170
|
+
[(NAME, "len"), (OP, "("), (STRING, '""'), (OP, ")")],
|
|
171
|
+
[(NAME, "bool"), (OP, "("), (NUMBER, "0"), (OP, ")")],
|
|
172
|
+
[(OP, "("), (OP, ")"), (NAME, "and"), (NAME, "True")],
|
|
156
173
|
]
|
|
174
|
+
return random.choice(false_conds)
|
|
175
|
+
|
|
176
|
+
def _generate_dead_if_tokens(self, indent_level: int):
|
|
157
177
|
inner_indent = " " * (indent_level + 1)
|
|
158
178
|
|
|
159
179
|
tokens = [(NAME, "if")]
|
|
160
|
-
tokens.extend(
|
|
180
|
+
tokens.extend(self._get_false_cond())
|
|
161
181
|
tokens.extend(
|
|
162
182
|
[
|
|
163
183
|
(OP, ":"),
|
|
@@ -171,7 +191,7 @@ class DeadCodeObfuscator:
|
|
|
171
191
|
num_elif = random.randint(0, max(0, self.max_branches - 1))
|
|
172
192
|
for _ in range(num_elif):
|
|
173
193
|
tokens.append((NAME, "elif"))
|
|
174
|
-
tokens.extend(
|
|
194
|
+
tokens.extend(self._get_false_cond())
|
|
175
195
|
tokens.extend(
|
|
176
196
|
[
|
|
177
197
|
(OP, ":"),
|
|
@@ -191,6 +211,10 @@ class DeadCodeObfuscator:
|
|
|
191
211
|
empty_choices = [
|
|
192
212
|
[(OP, "["), (OP, "]")],
|
|
193
213
|
[(NAME, "range"), (OP, "("), (NUMBER, "0"), (OP, ")")],
|
|
214
|
+
[(OP, "("), (OP, ")")],
|
|
215
|
+
[(OP, "{"), (OP, "}")],
|
|
216
|
+
[(STRING, '""')],
|
|
217
|
+
[(NAME, "set"), (OP, "("), (OP, ")")],
|
|
194
218
|
]
|
|
195
219
|
|
|
196
220
|
tokens = [
|
|
@@ -212,13 +236,15 @@ class DeadCodeObfuscator:
|
|
|
212
236
|
|
|
213
237
|
def _generate_dead_while_tokens(self, indent_level: int):
|
|
214
238
|
inner_indent = " " * (indent_level + 1)
|
|
215
|
-
tokens = [
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
239
|
+
tokens = [(NAME, "while")]
|
|
240
|
+
tokens.extend(self._get_false_cond())
|
|
241
|
+
tokens.extend(
|
|
242
|
+
[
|
|
243
|
+
(OP, ":"),
|
|
244
|
+
(NEWLINE, "\n"),
|
|
245
|
+
(INDENT, inner_indent),
|
|
246
|
+
],
|
|
247
|
+
)
|
|
222
248
|
tokens.extend(self._body_tokens())
|
|
223
249
|
tokens.append((DEDENT, ""))
|
|
224
250
|
return tokens
|
|
@@ -301,7 +327,7 @@ class DeadCodeObfuscator:
|
|
|
301
327
|
|
|
302
328
|
if toknum == OP and tokval == "@":
|
|
303
329
|
in_decorator = True
|
|
304
|
-
if in_decorator and toknum ==
|
|
330
|
+
if in_decorator and toknum == NAME and tokval in ("def", "class"):
|
|
305
331
|
in_decorator = False
|
|
306
332
|
|
|
307
333
|
result.append((toknum, tokval))
|