python-obfuscation-framework 1.6.2__tar.gz → 1.7.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.
Files changed (179) hide show
  1. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/MANIFEST.in +1 -0
  2. {python_obfuscation_framework-1.6.2/python_obfuscation_framework.egg-info → python_obfuscation_framework-1.7.0}/PKG-INFO +52 -59
  3. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/README.md +50 -58
  4. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/cli.py +9 -0
  5. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/cli_v2.py +9 -0
  6. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/main.py +3 -3
  7. python_obfuscation_framework-1.7.0/pof/obfuscator/junk/add_comments.py +58 -0
  8. python_obfuscation_framework-1.7.0/pof/utils/format.py +35 -0
  9. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/generator/__init__.py +8 -7
  10. python_obfuscation_framework-1.7.0/pof/utils/generator/comments.py +41 -0
  11. python_obfuscation_framework-1.7.0/pof/utils/generator/comments.txt +108598 -0
  12. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pyproject.toml +5 -4
  13. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0/python_obfuscation_framework.egg-info}/PKG-INFO +52 -59
  14. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/python_obfuscation_framework.egg-info/SOURCES.txt +3 -0
  15. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/python_obfuscation_framework.egg-info/requires.txt +1 -0
  16. python_obfuscation_framework-1.6.2/pof/obfuscator/junk/add_comments.py +0 -118
  17. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/LICENSE +0 -0
  18. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/__init__.py +0 -0
  19. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/__main__.py +0 -0
  20. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/errors.py +0 -0
  21. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/__init__.py +0 -0
  22. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/argv.py +0 -0
  23. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/base.py +0 -0
  24. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/cpu/__init__.py +0 -0
  25. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/cpu/cpu_count.py +0 -0
  26. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/fs/__init__.py +0 -0
  27. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/fs/directory_exist.py +0 -0
  28. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/fs/directory_list_exist.py +0 -0
  29. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/fs/directory_list_missing.py +0 -0
  30. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/fs/directory_missing.py +0 -0
  31. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/fs/exec_method.py +0 -0
  32. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/fs/executable_path.py +0 -0
  33. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/fs/file_exist.py +0 -0
  34. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/fs/file_list_exist.py +0 -0
  35. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/fs/file_list_missing.py +0 -0
  36. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/fs/file_missing.py +0 -0
  37. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/fs/tmp.py +0 -0
  38. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/hardware/__init__.py +0 -0
  39. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/hardware/ram_count.py +0 -0
  40. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/hooks/__init__.py +0 -0
  41. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/hooks/debugger.py +0 -0
  42. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/hooks/tracemalloc.py +0 -0
  43. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/human/__init__.py +0 -0
  44. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/human/p.py +0 -0
  45. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/human/prompt.py +0 -0
  46. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/integrity.py +0 -0
  47. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/multi.py +0 -0
  48. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/os/__init__.py +0 -0
  49. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/os/domain.py +0 -0
  50. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/os/hostname.py +0 -0
  51. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/os/uid.py +0 -0
  52. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/os/username.py +0 -0
  53. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/processes/__init__.py +0 -0
  54. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/processes/proc_count.py +0 -0
  55. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/time/__init__.py +0 -0
  56. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/time/expire.py +0 -0
  57. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/time/uptime.py +0 -0
  58. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/time/utc.py +0 -0
  59. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/evasion/utils.py +0 -0
  60. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/__init__.py +0 -0
  61. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/builtins.py +0 -0
  62. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/cipher/__init__.py +0 -0
  63. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/cipher/deep_encryption.py +0 -0
  64. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/cipher/rc4.py +0 -0
  65. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/cipher/shift.py +0 -0
  66. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/cipher/xor.py +0 -0
  67. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/compression/__init__.py +0 -0
  68. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/compression/bz2.py +0 -0
  69. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/compression/gzip.py +0 -0
  70. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/compression/lzma.py +0 -0
  71. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/compression/zlib.py +0 -0
  72. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/constants.py +0 -0
  73. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/definitions.py +0 -0
  74. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/encoding/__init__.py +0 -0
  75. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/encoding/a85.py +0 -0
  76. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/encoding/b16.py +0 -0
  77. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/encoding/b32.py +0 -0
  78. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/encoding/b32hex.py +0 -0
  79. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/encoding/b64.py +0 -0
  80. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/encoding/b85.py +0 -0
  81. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/encoding/binascii.py +0 -0
  82. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/encoding/snt.py +0 -0
  83. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/esoteric/__init__.py +0 -0
  84. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/esoteric/call.py +0 -0
  85. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/esoteric/doc.py +0 -0
  86. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/esoteric/globals.py +0 -0
  87. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/esoteric/imports.py +0 -0
  88. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/extract_variables.py +0 -0
  89. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/junk/__init__.py +0 -0
  90. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/junk/add_newlines.py +0 -0
  91. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/names.py +0 -0
  92. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/names_rope.py +0 -0
  93. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/numbers.py +0 -0
  94. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/other/__init__.py +0 -0
  95. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/other/tokens.py +0 -0
  96. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/remove/__init__.py +0 -0
  97. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/remove/comments.py +0 -0
  98. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/remove/exceptions.py +0 -0
  99. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/remove/indents.py +0 -0
  100. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/remove/loggings.py +0 -0
  101. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/remove/loggings_old.py +0 -0
  102. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/remove/newline.py +0 -0
  103. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/remove/print.py +0 -0
  104. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/restructure.py +0 -0
  105. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/stegano/__init__.py +0 -0
  106. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/stegano/docstrings.py +0 -0
  107. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/stegano/ipv6encoding.py +0 -0
  108. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/stegano/macencoding.py +0 -0
  109. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/stegano/uuidencoding.py +0 -0
  110. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/obfuscator/strings.py +0 -0
  111. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/stager/__init__.py +0 -0
  112. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/stager/cipher/__init__.py +0 -0
  113. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/stager/cipher/rc4.py +0 -0
  114. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/stager/download.py +0 -0
  115. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/stager/image.py +0 -0
  116. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/stager/lots/__init__.py +0 -0
  117. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/stager/lots/cl1pnet.py +0 -0
  118. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/stager/lots/pastebin.py +0 -0
  119. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/stager/lots/pasters.py +0 -0
  120. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/stager/quine.py +0 -0
  121. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/__init__.py +0 -0
  122. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/cipher/__init__.py +0 -0
  123. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/cipher/rc4.py +0 -0
  124. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/cipher/shift.py +0 -0
  125. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/compression/__init__.py +0 -0
  126. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/compression/bz2.py +0 -0
  127. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/compression/gzip.py +0 -0
  128. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/compression/lzma.py +0 -0
  129. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/compression/zlib.py +0 -0
  130. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/encoding/__init__.py +0 -0
  131. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/encoding/a85.py +0 -0
  132. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/encoding/b16.py +0 -0
  133. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/encoding/b3.py +0 -0
  134. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/encoding/b32.py +0 -0
  135. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/encoding/b32hex.py +0 -0
  136. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/encoding/b64.py +0 -0
  137. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/encoding/b85.py +0 -0
  138. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/encoding/binascii.py +0 -0
  139. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/encoding/snt.py +0 -0
  140. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/entropy.py +0 -0
  141. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/extract_names.py +0 -0
  142. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/generator/advanced.py +0 -0
  143. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/generator/base.py +0 -0
  144. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/generator/basic.py +0 -0
  145. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/generator/names.txt +0 -0
  146. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/generator/unicode.py +0 -0
  147. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/se/__init__.py +0 -0
  148. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/se/homoglyphs.py +0 -0
  149. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/se/homoglyphs.txt +0 -0
  150. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/stegano/__init__.py +0 -0
  151. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/stegano/ipv6encoding.py +0 -0
  152. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/stegano/macencoding.py +0 -0
  153. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/stegano/uuidencoding.py +0 -0
  154. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/pof/utils/tokens.py +0 -0
  155. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/python_obfuscation_framework.egg-info/dependency_links.txt +0 -0
  156. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/python_obfuscation_framework.egg-info/entry_points.txt +0 -0
  157. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/python_obfuscation_framework.egg-info/top_level.txt +0 -0
  158. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/setup.cfg +0 -0
  159. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/__init__.py +0 -0
  160. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/obfuscator/__init__.py +0 -0
  161. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/obfuscator/test_a85.py +0 -0
  162. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/obfuscator/test_b16.py +0 -0
  163. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/obfuscator/test_b32.py +0 -0
  164. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/obfuscator/test_b32hex.py +0 -0
  165. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/obfuscator/test_b64.py +0 -0
  166. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/obfuscator/test_b85.py +0 -0
  167. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/obfuscator/test_comments.py +0 -0
  168. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/obfuscator/test_docstrings.py +0 -0
  169. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/obfuscator/test_exceptions.py +0 -0
  170. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/obfuscator/test_names/code/out.py +0 -0
  171. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/obfuscator/test_names/code/source.py +0 -0
  172. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/obfuscator/test_names/test_names.py +0 -0
  173. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/obfuscator/test_print.py +0 -0
  174. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/obfuscator/test_xor.py +0 -0
  175. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/pyproject.toml +0 -0
  176. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/utils/__init__.py +0 -0
  177. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/utils/se/__init__.py +0 -0
  178. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/utils/se/test_homoglyphs.py +0 -0
  179. {python_obfuscation_framework-1.6.2 → python_obfuscation_framework-1.7.0}/tests/utils/test_generator.py +0 -0
@@ -1,5 +1,6 @@
1
1
  recursive-include pof *.py
2
2
  include pof/utils/generator/names.txt
3
+ include pof/utils/generator/comments.txt
3
4
  include pof/utils/se/homoglyphs.txt
4
5
 
5
6
  recursive-include tests *
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-obfuscation-framework
3
- Version: 1.6.2
3
+ Version: 1.7.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>
@@ -29,6 +29,7 @@ Description-Content-Type: text/markdown
29
29
  License-File: LICENSE
30
30
  Requires-Dist: rope>=1.0.0
31
31
  Requires-Dist: Pillow>=10.0.0
32
+ Requires-Dist: black>=24.10.0
32
33
  Provides-Extra: dev
33
34
  Requires-Dist: ruff==0.8.0; extra == "dev"
34
35
  Requires-Dist: black==24.10.0; extra == "dev"
@@ -46,26 +47,21 @@ Dynamic: license-file
46
47
 
47
48
  [![python-obfuscation-framework-pypi](https://img.shields.io/pypi/v/python-obfuscation-framework.svg)](https://pypi.org/project/python-obfuscation-framework)
48
49
 
49
- Python Obfuscation Framework.
50
+ Python Obfuscation Framework, a complete Python offensive security toolkit to generate staged obfuscated payloads.
50
51
 
51
- Combine and chain obfuscation methods on a single Python source file.
52
+ pof will allow you to:
52
53
 
53
- Install:
54
+ - **Create staged payloads**, store stages inside images, on trusted sites, encrypt, compress, or encode them, and much more.
55
+ - **Slow down static analysis** of the payload or the stage.
56
+ - **Evade sandbox** by checking host information like MAC addresses, CPU count, memory count, uptime, and much more.
57
+ - **Add guardrails** to ensure the payload only execute on the desired target host by verifying for username, hostname, domainame and much more.
58
+ - **Prevent dynamic analysis** by detecting debugging or tracing via malloc.
59
+ - **Enable automation** to produce numerous variant of the same payload.
54
60
 
55
- ```bash
56
- pip install python-obfuscation-framework
57
- ```
58
-
59
- Source:
61
+ Example obfuscation:
60
62
 
61
63
  ```python
62
- print('Hello, world')
63
- ```
64
-
65
- Run:
66
-
67
- ```bash
68
- pof in.py -o out.py
64
+ print("Hello, world")
69
65
  ```
70
66
 
71
67
  Output:
@@ -78,31 +74,11 @@ globals()["".join([chr(ord(i)-3)for i in'bbvqlwolxebb'[::-1]])].__dict__[_5269('
78
74
 
79
75
  More examples and usage can be found in `examples/` or in the section bellow.
80
76
 
81
- ## Goals
82
-
83
- The goals of this project are to create a toolkit to obfuscate Python source code, mainly to create payload for offensive security.
84
-
85
- pof will allow you to:
86
-
87
- - create **payloads**: store the code inside images, have multiple stages, use LOTL techniques
88
- - create **stager**: easily create multi stages payloads
89
- - do **evasion**: AV, EDR, DPI, sandbox and other analysis techniques
90
- - slow **analysis**: slow down human analysis of the payload
91
- - enable **automation**: automate the whole process, to produce numerous variant of the payload
92
- - be **cross-platform**: works on Linux, Windows, and macOS
93
- - have **fun**: because it's always fun to see what's possible to do with Python
94
-
95
- This project also tries to combine all other Python obfuscation tools available, because most of them only provide a single method, and it's pretty basic. So you should be able to do everything that those other tools do, but without having to use multiple.
96
-
97
- Python is not exactly the best language to create payloads with, especially for Windows if the interpreter is not already installed. This project was made for learning, and discovering new ways of bypassing security, it's a great way to test obfuscations techniques.
98
-
99
- This project could also give you ideas to implement in other languages, such as powershell where it would make sens to obfuscate the source code. Or in C, C#, C++, Go or Rust where it would make sens to stage payloads, compress them, encrypt them and obfuscate strings.
100
-
101
- You could also use most of the stagers to stage payload that are not built in Python.
102
-
103
77
  ## Install
104
78
 
105
- There are 4 installation options, with PIP, a virtualenv, a Docker container, or with Nix.
79
+ There are multiple installation options, with PIP, a virtualenv, a container, or with Nix.
80
+
81
+ There is also the option to run the web server, see [server/README.md](./server/README.md).
106
82
 
107
83
  ### 1. PIP
108
84
 
@@ -640,6 +616,22 @@ The `out2.py` and `out3.py` files are identical, they both contain the source co
640
616
  > [!NOTE]
641
617
  > By default pof uses a custom `Untokenizer` that removes useless spaces (`NoSpaceUntokenizer` defined in `./pof/utils/tokens.py`), so first generation (in the example `out.py`) will not have spaces present in the subsquent outputs.
642
618
 
619
+ ### Format
620
+
621
+ You can choose to automatically format the output code using black.
622
+
623
+ From the CLI add the `--format` flag.
624
+
625
+ From lib:
626
+
627
+ ```py
628
+ from pof.utils.format import black_format
629
+
630
+ obf = ExampleObfuscator().obfuscate(...)
631
+ out = black_format(obf)
632
+ print(out)
633
+ ```
634
+
643
635
  ### Generators
644
636
 
645
637
  Generators are used to generate new names, they can be used to classes, variables, functions, constants or any other.
@@ -838,7 +830,7 @@ class ExampleObfuscator(BaseObfuscator):
838
830
  print(ExampleObfuscator().obfuscate(open("source.py", "r").read()))
839
831
  ```
840
832
 
841
- In this example we can see that first we remove comments, logging, print statements, and change the content of exceptions, and then we start to obfuscate constants, names, globals, builtins, strings, then strings and numbers multiple times, and we finally convert the tokens back to code.
833
+ In this example we can see that first we remove comments, logging, print statements, and change the content of exceptions. And then we start to obfuscate constants, names, globals, builtins, strings. Then strings and numbers multiple times, and we finally convert the tokens back to code.
842
834
 
843
835
  By chaining multiple obfuscations techniques we can create very complex and custom output.
844
836
 
@@ -856,19 +848,19 @@ yara --no-warnings yara/python.yar file.py
856
848
 
857
849
  ## Development
858
850
 
859
- Project:
851
+ Project directory structure:
860
852
 
861
- - `pof`: contains all the pof source code
862
- - `pof/obfuscator`: contains obfuscators
863
- - `pof/stager`: contains satgers
864
- - `pof/evasion`: contains evasions
865
- - `pof/utils`: all shared code between stager, obfuscator and evasion
866
- - `wip`: work in progress code that will eventually make its way inside the main code base
867
- - `tests`: unit tests for pof
868
- - `scripts`: some useful scripts to develop or use pof
869
- - `yara`: some yara rules to detect pof obfuscated code
853
+ - `pof`: contains all the pof source code.
854
+ - `pof/obfuscator`: contains obfuscators.
855
+ - `pof/stager`: contains satgers.
856
+ - `pof/evasion`: contains evasions.
857
+ - `pof/utils`: all shared code between stager, obfuscator and evasion.
858
+ - `wip`: work in progress code that will eventually make its way inside the main code base.
859
+ - `tests`: unit tests for pof.
860
+ - `scripts`: some useful scripts to develop or use pof.
861
+ - `yara`: some yara rules to detect pof obfuscated code.
870
862
 
871
- Setup:
863
+ Setup dev environment:
872
864
 
873
865
  ```bash
874
866
  python3 -m venv venv
@@ -876,13 +868,13 @@ python3 -m venv venv
876
868
  # activate it (or equivalent for your shell)
877
869
  source ./venv/bin/activate
878
870
 
879
- # install dep
871
+ # install dependencies
880
872
  pip install -e .
881
- pip install -e .[dev]
882
- pip install -e .[test]
873
+ pip install -e ".[dev]"
874
+ pip install -e ".[test]"
883
875
  ```
884
876
 
885
- Run pof:
877
+ Run pof CLI:
886
878
 
887
879
  ```bash
888
880
  ./pof.py --help
@@ -910,7 +902,8 @@ ruff check .
910
902
  Test build package:
911
903
 
912
904
  ```bash
913
- pip install -e .[build]
905
+ # install dependencies
906
+ pip install -e ".[build]"
914
907
 
915
908
  check-manifest --ignore "tests/**"
916
909
  python3 -m build
@@ -923,9 +916,9 @@ No effort is made to support Python 2, most obfuscator, stagers, and evasion sho
923
916
 
924
917
  ## TODO
925
918
 
926
- - Fix `NamesObfuscator`
927
- - Add option to prepend a shebang, and add ability to customize it
928
- - Fix multi line strings
919
+ - Fix `NamesObfuscator`.
920
+ - Add option to prepend a shebang, and add ability to customize it.
921
+ - Fix multi line strings.
929
922
 
930
923
  ## License
931
924
 
@@ -2,26 +2,21 @@
2
2
 
3
3
  [![python-obfuscation-framework-pypi](https://img.shields.io/pypi/v/python-obfuscation-framework.svg)](https://pypi.org/project/python-obfuscation-framework)
4
4
 
5
- Python Obfuscation Framework.
5
+ Python Obfuscation Framework, a complete Python offensive security toolkit to generate staged obfuscated payloads.
6
6
 
7
- Combine and chain obfuscation methods on a single Python source file.
7
+ pof will allow you to:
8
8
 
9
- Install:
9
+ - **Create staged payloads**, store stages inside images, on trusted sites, encrypt, compress, or encode them, and much more.
10
+ - **Slow down static analysis** of the payload or the stage.
11
+ - **Evade sandbox** by checking host information like MAC addresses, CPU count, memory count, uptime, and much more.
12
+ - **Add guardrails** to ensure the payload only execute on the desired target host by verifying for username, hostname, domainame and much more.
13
+ - **Prevent dynamic analysis** by detecting debugging or tracing via malloc.
14
+ - **Enable automation** to produce numerous variant of the same payload.
10
15
 
11
- ```bash
12
- pip install python-obfuscation-framework
13
- ```
14
-
15
- Source:
16
+ Example obfuscation:
16
17
 
17
18
  ```python
18
- print('Hello, world')
19
- ```
20
-
21
- Run:
22
-
23
- ```bash
24
- pof in.py -o out.py
19
+ print("Hello, world")
25
20
  ```
26
21
 
27
22
  Output:
@@ -34,31 +29,11 @@ globals()["".join([chr(ord(i)-3)for i in'bbvqlwolxebb'[::-1]])].__dict__[_5269('
34
29
 
35
30
  More examples and usage can be found in `examples/` or in the section bellow.
36
31
 
37
- ## Goals
38
-
39
- The goals of this project are to create a toolkit to obfuscate Python source code, mainly to create payload for offensive security.
40
-
41
- pof will allow you to:
42
-
43
- - create **payloads**: store the code inside images, have multiple stages, use LOTL techniques
44
- - create **stager**: easily create multi stages payloads
45
- - do **evasion**: AV, EDR, DPI, sandbox and other analysis techniques
46
- - slow **analysis**: slow down human analysis of the payload
47
- - enable **automation**: automate the whole process, to produce numerous variant of the payload
48
- - be **cross-platform**: works on Linux, Windows, and macOS
49
- - have **fun**: because it's always fun to see what's possible to do with Python
50
-
51
- This project also tries to combine all other Python obfuscation tools available, because most of them only provide a single method, and it's pretty basic. So you should be able to do everything that those other tools do, but without having to use multiple.
52
-
53
- Python is not exactly the best language to create payloads with, especially for Windows if the interpreter is not already installed. This project was made for learning, and discovering new ways of bypassing security, it's a great way to test obfuscations techniques.
54
-
55
- This project could also give you ideas to implement in other languages, such as powershell where it would make sens to obfuscate the source code. Or in C, C#, C++, Go or Rust where it would make sens to stage payloads, compress them, encrypt them and obfuscate strings.
56
-
57
- You could also use most of the stagers to stage payload that are not built in Python.
58
-
59
32
  ## Install
60
33
 
61
- There are 4 installation options, with PIP, a virtualenv, a Docker container, or with Nix.
34
+ There are multiple installation options, with PIP, a virtualenv, a container, or with Nix.
35
+
36
+ There is also the option to run the web server, see [server/README.md](./server/README.md).
62
37
 
63
38
  ### 1. PIP
64
39
 
@@ -596,6 +571,22 @@ The `out2.py` and `out3.py` files are identical, they both contain the source co
596
571
  > [!NOTE]
597
572
  > By default pof uses a custom `Untokenizer` that removes useless spaces (`NoSpaceUntokenizer` defined in `./pof/utils/tokens.py`), so first generation (in the example `out.py`) will not have spaces present in the subsquent outputs.
598
573
 
574
+ ### Format
575
+
576
+ You can choose to automatically format the output code using black.
577
+
578
+ From the CLI add the `--format` flag.
579
+
580
+ From lib:
581
+
582
+ ```py
583
+ from pof.utils.format import black_format
584
+
585
+ obf = ExampleObfuscator().obfuscate(...)
586
+ out = black_format(obf)
587
+ print(out)
588
+ ```
589
+
599
590
  ### Generators
600
591
 
601
592
  Generators are used to generate new names, they can be used to classes, variables, functions, constants or any other.
@@ -794,7 +785,7 @@ class ExampleObfuscator(BaseObfuscator):
794
785
  print(ExampleObfuscator().obfuscate(open("source.py", "r").read()))
795
786
  ```
796
787
 
797
- In this example we can see that first we remove comments, logging, print statements, and change the content of exceptions, and then we start to obfuscate constants, names, globals, builtins, strings, then strings and numbers multiple times, and we finally convert the tokens back to code.
788
+ In this example we can see that first we remove comments, logging, print statements, and change the content of exceptions. And then we start to obfuscate constants, names, globals, builtins, strings. Then strings and numbers multiple times, and we finally convert the tokens back to code.
798
789
 
799
790
  By chaining multiple obfuscations techniques we can create very complex and custom output.
800
791
 
@@ -812,19 +803,19 @@ yara --no-warnings yara/python.yar file.py
812
803
 
813
804
  ## Development
814
805
 
815
- Project:
806
+ Project directory structure:
816
807
 
817
- - `pof`: contains all the pof source code
818
- - `pof/obfuscator`: contains obfuscators
819
- - `pof/stager`: contains satgers
820
- - `pof/evasion`: contains evasions
821
- - `pof/utils`: all shared code between stager, obfuscator and evasion
822
- - `wip`: work in progress code that will eventually make its way inside the main code base
823
- - `tests`: unit tests for pof
824
- - `scripts`: some useful scripts to develop or use pof
825
- - `yara`: some yara rules to detect pof obfuscated code
808
+ - `pof`: contains all the pof source code.
809
+ - `pof/obfuscator`: contains obfuscators.
810
+ - `pof/stager`: contains satgers.
811
+ - `pof/evasion`: contains evasions.
812
+ - `pof/utils`: all shared code between stager, obfuscator and evasion.
813
+ - `wip`: work in progress code that will eventually make its way inside the main code base.
814
+ - `tests`: unit tests for pof.
815
+ - `scripts`: some useful scripts to develop or use pof.
816
+ - `yara`: some yara rules to detect pof obfuscated code.
826
817
 
827
- Setup:
818
+ Setup dev environment:
828
819
 
829
820
  ```bash
830
821
  python3 -m venv venv
@@ -832,13 +823,13 @@ python3 -m venv venv
832
823
  # activate it (or equivalent for your shell)
833
824
  source ./venv/bin/activate
834
825
 
835
- # install dep
826
+ # install dependencies
836
827
  pip install -e .
837
- pip install -e .[dev]
838
- pip install -e .[test]
828
+ pip install -e ".[dev]"
829
+ pip install -e ".[test]"
839
830
  ```
840
831
 
841
- Run pof:
832
+ Run pof CLI:
842
833
 
843
834
  ```bash
844
835
  ./pof.py --help
@@ -866,7 +857,8 @@ ruff check .
866
857
  Test build package:
867
858
 
868
859
  ```bash
869
- pip install -e .[build]
860
+ # install dependencies
861
+ pip install -e ".[build]"
870
862
 
871
863
  check-manifest --ignore "tests/**"
872
864
  python3 -m build
@@ -879,9 +871,9 @@ No effort is made to support Python 2, most obfuscator, stagers, and evasion sho
879
871
 
880
872
  ## TODO
881
873
 
882
- - Fix `NamesObfuscator`
883
- - Add option to prepend a shebang, and add ability to customize it
884
- - Fix multi line strings
874
+ - Fix `NamesObfuscator`.
875
+ - Add option to prepend a shebang, and add ability to customize it.
876
+ - Fix multi line strings.
885
877
 
886
878
  ## License
887
879
 
@@ -27,6 +27,7 @@ from pof.obfuscator import * # noqa: F403
27
27
  from pof.obfuscator import __all__ as all_obfuscator
28
28
  from pof.stager import * # noqa: F403
29
29
  from pof.stager import __all__ as all_stager
30
+ from pof.utils.format import black_format
30
31
 
31
32
  handler = logging.StreamHandler()
32
33
  formatter = logging.Formatter("%(levelname)s %(message)s\x1b[39m")
@@ -137,6 +138,9 @@ def _handle(args) -> int:
137
138
 
138
139
  end = time.time()
139
140
 
141
+ if args.format:
142
+ out = black_format(out)
143
+
140
144
  time_diff = round(end - start, 4)
141
145
  logging.info(f"took: {time_diff}s")
142
146
  args.output.write(out)
@@ -175,6 +179,11 @@ def _cli() -> int:
175
179
  help="obfuscation function",
176
180
  default="obfuscate",
177
181
  )
182
+ parser.add_argument(
183
+ "--format",
184
+ action="store_true",
185
+ help="format output with black",
186
+ )
178
187
  parser.add_argument(
179
188
  "--logging",
180
189
  help="logging level, DEBUG, INFO, ERROR, CRITICAL",
@@ -26,6 +26,7 @@ from pof.errors import PofError
26
26
  from pof.evasion import * # noqa: F403
27
27
  from pof.obfuscator import * # noqa: F403
28
28
  from pof.stager import * # noqa: F403
29
+ from pof.utils.format import black_format
29
30
 
30
31
  handler = logging.StreamHandler()
31
32
  formatter = logging.Formatter("%(levelname)s %(message)s\x1b[39m")
@@ -344,6 +345,9 @@ def _handle(args) -> int:
344
345
 
345
346
  end = time.time()
346
347
 
348
+ if args.format_black:
349
+ out = black_format(out)
350
+
347
351
  time_diff = round(end - start, 4)
348
352
  logging.info("took: %ds", time_diff)
349
353
  args.output.write(out)
@@ -468,6 +472,11 @@ def _cli() -> int:
468
472
  parser.add_argument("--eva-uptime", action="store_true")
469
473
  parser.add_argument("--eva-utc", action="store_true")
470
474
 
475
+ # format
476
+ parser.add_argument(
477
+ "--format-black", action="store_true", help="format output with black"
478
+ )
479
+
471
480
  # control
472
481
  parser.add_argument(
473
482
  "--obf-count",
@@ -19,7 +19,7 @@
19
19
  import io
20
20
  import logging
21
21
  import random
22
- from tokenize import generate_tokens
22
+ from tokenize import COMMENT, NEWLINE, generate_tokens
23
23
 
24
24
  from pof.evasion import (
25
25
  CPUCountEvasion,
@@ -65,6 +65,8 @@ from pof.utils.tokens import untokenize
65
65
  class BaseObfuscator:
66
66
  @staticmethod
67
67
  def _get_tokens(source: str):
68
+ # TODO (deoktr): this is not safe, the \r could be inside a string, probably
69
+ # should get tokens first, and update all the instances of newline
68
70
  if "\r" in source:
69
71
  source = source.replace("\r\n", "\n").replace("\r", "\n")
70
72
  if not source.endswith("\n"):
@@ -319,8 +321,6 @@ class Obfuscator(BaseObfuscator):
319
321
  tokens = IndentsObfuscator().obfuscate_tokens(tokens)
320
322
  tokens = NewlineObfuscator().obfuscate_tokens(tokens)
321
323
 
322
- from tokenize import COMMENT, NEWLINE
323
-
324
324
  tokens = [(COMMENT, "# I love circles <3"), (NEWLINE, "\n"), *tokens]
325
325
 
326
326
  return self._untokenize(tokens)
@@ -0,0 +1,58 @@
1
+ # POF, a free and open source Python obfuscation framework.
2
+ # Copyright (C) 2022 - 2025 POF Team
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
16
+
17
+ # TODO (deoktr): calculate frequency based on the number of lines to distribute
18
+ # the comment evenly across the code
19
+ import random
20
+ from tokenize import COMMENT, DEDENT, INDENT, NEWLINE
21
+
22
+ from pof.utils.generator import CommentGenerator
23
+
24
+
25
+ class AddCommentsObfuscator:
26
+ """Add comments to the code."""
27
+
28
+ def __init__(
29
+ self,
30
+ frequency=0.03,
31
+ generator=None,
32
+ ) -> None:
33
+ self.frequency = frequency
34
+
35
+ if generator is None:
36
+ generator = CommentGenerator.realistic_generator()
37
+
38
+ self.generator = generator
39
+
40
+ def get_comment(self):
41
+ return next(self.generator)
42
+
43
+ def obfuscate_tokens(self, tokens):
44
+ result = [] # obfuscated tokens
45
+ for toknum, tokval, *_ in tokens:
46
+ new_tokens = [(toknum, tokval)]
47
+
48
+ if (
49
+ toknum in [NEWLINE, INDENT, DEDENT]
50
+ and (random.randint(0, 100) / 100) <= self.frequency
51
+ ):
52
+ c = self.get_comment()
53
+ if c is not None:
54
+ new_tokens.extend([(COMMENT, c), (NEWLINE, "\n")])
55
+
56
+ if new_tokens:
57
+ result.extend(new_tokens)
58
+ return result
@@ -0,0 +1,35 @@
1
+ # POF, a free and open source Python obfuscation framework.
2
+ # Copyright (C) 2022 - 2025 POF Team
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
16
+
17
+
18
+ import logging
19
+
20
+ try:
21
+ import black
22
+
23
+ BLACK_INSTALLED = True
24
+ except ImportError:
25
+ BLACK_INSTALLED = False
26
+
27
+ from pof.errors import PofError
28
+
29
+
30
+ def black_format(src: str) -> str:
31
+ """Format raw source code using black."""
32
+ if not BLACK_INSTALLED:
33
+ logging.error("'black' is not installed, cannot format using it")
34
+ return src
35
+ return black.format_str(src, mode=black.FileMode())
@@ -17,17 +17,18 @@
17
17
  """Random names generators.
18
18
 
19
19
  https://docs.python.org/3/reference/lexical_analysis.html#identifiers.
20
-
21
- this is invisible unicode ? in VIM the second unicdoe doesn't appear !
22
-
23
-
24
- ݻ
25
-
26
20
  """
27
21
 
28
22
  from .advanced import AdvancedGenerator
29
23
  from .base import BaseGenerator
30
24
  from .basic import BasicGenerator
25
+ from .comments import CommentGenerator
31
26
  from .unicode import UnicodeGenerator
32
27
 
33
- __all__ = ["AdvancedGenerator", "BaseGenerator", "BasicGenerator", "UnicodeGenerator"]
28
+ __all__ = [
29
+ "AdvancedGenerator",
30
+ "BaseGenerator",
31
+ "BasicGenerator",
32
+ "CommentGenerator",
33
+ "UnicodeGenerator",
34
+ ]
@@ -0,0 +1,41 @@
1
+ # POF, a free and open source Python obfuscation framework.
2
+ # Copyright (C) 2022 - 2025 POF Team
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
16
+
17
+ """Random comments generators."""
18
+
19
+ import random
20
+ from pathlib import Path
21
+
22
+ from .base import BaseGenerator
23
+
24
+
25
+ class CommentGenerator(BaseGenerator):
26
+ @classmethod
27
+ def realistic_generator(cls):
28
+ """Random comment that can be variables."""
29
+ # the comments.txt file was generated from the source of all Python 3.13
30
+ # standard librairies, and the script used to generate it is present in
31
+ # scripts/extract_comments.py
32
+ file = Path(__file__).parent / "comments.txt"
33
+ with file.open() as file:
34
+ comment_list = [line.rstrip() for line in file]
35
+ previous = []
36
+ while True:
37
+ comment = random.choice(comment_list)
38
+ if not comment.startswith("#"):
39
+ continue
40
+ previous.append(comment)
41
+ yield comment