import sys
import random
import logging
yellow = '\033[93m'
lgreen = '\033[92m'
clear = '\033[0m'
bold = '\033[01m'
cyan = '\033[96m'
red = "\033[91m"
logging.basicConfig(level=logging.INFO)
__banner__ = yellow+"""
\t
+-------------------------------------------------------------------+
│ │
│ █ █ █ █▄█ ▀█▀ ▀█▀ █▀▀ █▀█ █▄▄ █▀▀ █ █ █▀▀ █▀▀ ▄▀▄ ▀█▀ █▀▀ │
│ ▀▄▀▄▀ █ █ ▄█▄ █ ██▄ █▄█ █▄█ █▀ █▄█ ▄██ █▄▄ █▀█ █ ██▄ │
│ │
│ 𝗔𝘂𝘁𝗵𝗼𝗿 : 𝘄𝗵𝗶𝘁𝗲 𝗲𝗮𝗴𝗹𝗲 𝗧𝗲𝗹𝗲𝗴𝗿𝗮𝗺 : 𝗵𝘁𝘁𝗽𝘀://𝘁.𝗺𝗲/𝗞𝗮_𝗞𝘀𝗛𝗶_𝗛𝗮𝗧𝗮𝗞𝗲
│ │
+-------------------------------------------------------------------+
\n"""+clear
def main(files, string):
s = open(files).read()
z = []
for i in s:
z.append(ord(i))
pea = []
for i in z:
pea.append(string.replace("'", "").replace('"', '')*i)
file = """
# coding=utf-8
# obfuscated with white obfuscate : https://github.com/WH1T3-E4GL3/white-obfuscate
d={};exec("".join([chr(len(i)) for i in d]))
""".format(pea)
open(files.replace(".py", "encypt.py"), "w").write(file)
logging.info(" saved as "+files.replace(".py", "encrypt.py"))
try:
print(__banner__)
logging.info(" obfuscating "+sys.argv[1]+"....")
main(sys.argv[1], sys.argv[2])
except:
print("""+-------------------------------------------------------------------+
""")
print(red+"""[ERROR!]
"""+clear, end=' ')
print("""
Usage : python white-obsf.py <filename> 'string'
Example : python white-obfs.py pythoncode.py '#'
This will modify your full python script with '+' symbol.
""")
print("""+-------------------------------------------------------------------+""
lol