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EAd}?^B1auaNJKZb
z0w=EWLH?NE``QTCMpKZmSdg$~Rwaaw6Xb7a7S}~}Ca+h1WoE=YhVqvNQL1>|V@q@g
zHFBSh9vS-R)P4)ol6Vxh81D6e^XO}bq;i(Ja(2dP)>U-z$B9F5hmNSu$Lp0h-wqL_
z*17j&_@5%5I`;MbiaB13GXYRjBz0X_0T5=-)Pa{P3pSd#L7
z)RcGL4$(?=CPY^SuB`XajP8I7FRtX(%fkPA!c2~}$H+Y!E;uu`^GwX~w7#o>!*k9Z
zu6nWc*k|@5V|>M_+%*g4cP$iopnojZQ*GgA2l6FVRo_QTX;C4!Om9uDeOU2mst>s(Bt;)v
zIj7Iy)%W%V#MC}By(Pb{3a)pWZ=wZoqyN5I6|9gVW-)p|kY@qk{}lQ5+hrYvB@wm%
ikN;B68q+3Pr^K@*t8bPE4%;Au9X?=TlE2UC%Krhc(}xoP
literal 0
HcmV?d00001
diff --git a/README.md b/README.md
index 20920cd..1f16393 100644
--- a/README.md
+++ b/README.md
@@ -49,12 +49,13 @@ De4py are an Advanced python deobfuscator with a beautiful UI and a set of Advan
## Screenshots
-
-
-
-
-
-
+
+
+
+
+
+
+
## Contributions
diff --git a/TUI/cli.py b/TUI/cli.py
new file mode 100644
index 0000000..8eaa100
--- /dev/null
+++ b/TUI/cli.py
@@ -0,0 +1,352 @@
+import colorama, msvcrt, platform, signal
+from tkinter import Tk, filedialog
+from deobfuscators.detector import detect_obfuscator
+from analyzer import (
+ detect_packer,
+ unpack_file,
+ get_file_hashs,
+ sus_strings_lookup,
+ all_strings_lookup,
+)
+from config import config
+from util import *
+import socket
+
+def signal_handler(sig, frame):
+ tui.clear_console()
+ banner()
+ print(f"{colorama.Fore.CYAN}Exiting....{colorama.Style.RESET_ALL}")
+ rpc.KILL_THREAD = True
+ sys.exit(0)
+
+
+signal.signal(signal.SIGINT, signal_handler)
+sys.excepthook = custom_error
+tui.clear_console()
+change_log = None
+platform_info = None
+file_path = None
+
+
+def home_tab():
+ tui.linux_prompt()
+ choice = input()
+ commands = {
+ "help": "Displays a list of available commands.",
+ "deobfuscator": "Executes the deobfuscator tool.",
+ "pyshell": "Opens the Python shell.",
+ "analyzer": "Runs the code analyzer tool.",
+ "about": "Displays information about the program.",
+ "changelog": "Displays the change log with details of each version and the corresponding updates.",
+ "neofetch": "Displays your PC info + the tool info",
+ "clear": "Clear the console.",
+ "exit": "Exits the program.",
+ }
+ if choice == "help":
+ print(f"\n{Fore.CYAN}=== Available Commands ==={Style.RESET_ALL}")
+ for cmd, desc in commands.items():
+ print(f"{Fore.YELLOW}{cmd}{Style.RESET_ALL} - {desc}")
+ print(f"{Fore.CYAN}=========================={Style.RESET_ALL}\n")
+ elif choice == "deobfuscator":
+ deobfuscator_tab()
+ elif choice == "pyshell":
+ print(f"\n{Fore.CYAN}=== coming soon ==={Style.RESET_ALL}\n")
+ elif choice == "analyzer":
+ analyzer_tab()
+ elif choice == "about":
+ print(
+ f"\n{Fore.CYAN}This tool created by 0xmrpepe, advdebug\nwebsite: https://de4py.000.pe\ngithub: https://github.com/Fadi002/de4py{Style.RESET_ALL}\n"
+ )
+ elif choice == "neofetch":
+ neofetch()
+ elif choice == "changelog":
+ changelog_display()
+ elif choice == "clear":
+ tui.clear_console()
+ banner()
+ elif choice == "exit":
+ tui.clear_console()
+ banner()
+ print(f"{colorama.Fore.CYAN}Exiting....{colorama.Style.RESET_ALL}")
+ sys.exit(0)
+ else:
+ print(f"{Fore.RED}Unknown command{Style.RESET_ALL}")
+
+
+def deobfuscator_tab():
+ global file_path
+ file_path = None
+ tui.clear_console()
+ banner()
+ commands = {
+ "set_file": "Select a file to deobfuscate.",
+ "start": "Executes the deobfuscator.",
+ "back": "Back to the home page.",
+ "clear": "Clear the console.",
+ "exit": "Exits the program.",
+ }
+ while 1:
+ tui.linux_prompt("deobfuscator")
+ choice = input()
+ if choice == "help":
+ print(f"\n{Fore.CYAN}=== Available Commands ==={Style.RESET_ALL}")
+ for cmd, desc in commands.items():
+ print(f"{Fore.YELLOW}{cmd}{Style.RESET_ALL} - {desc}")
+ print(f"{Fore.CYAN}=========================={Style.RESET_ALL}\n")
+ elif choice == "set_file":
+ file_path = file_explorer()
+ if file_path:
+ print(f"{Fore.CYAN}Selected file path: {file_path}{Style.RESET_ALL}\n")
+
+ else:
+ print(f"{Fore.YELLOW}No file selected.{Style.RESET_ALL}\n")
+ elif choice == "start":
+ if file_path:
+ print(
+ f"{Fore.CYAN}Starting the Deobfuscation process...{Style.RESET_ALL}"
+ )
+ print(f"{Fore.CYAN}Deobfuscation result:{Style.RESET_ALL}\n")
+ print(detect_obfuscator(file_path))
+ print("\n")
+ else:
+ print(f"{Fore.YELLOW}No file selected.{Style.RESET_ALL}\n")
+ elif choice == "back":
+ tui.clear_console()
+ banner()
+ break
+ elif choice == "clear":
+ tui.clear_console()
+ banner()
+ elif choice == "exit":
+ tui.clear_console()
+ banner()
+ print(f"{colorama.Fore.CYAN}Exiting....{colorama.Style.RESET_ALL}")
+ sys.exit(0)
+ else:
+ print(f"{Fore.RED}Unknown command{Style.RESET_ALL}")
+
+
+def analyzer_tab():
+ global file_path
+ file_path = None
+ tui.clear_console()
+ banner()
+ commands = {
+ "set_file": "Select a file to analyze.",
+ "exe_packer_detector": "Detect the exe packer (ex. py2exe).",
+ "exe_unpacker": "Unpack the exe if its supported",
+ "sus_strings_lookup": "Search for the sus strings like ips links.",
+ "all_strings": "Search for all readable strings in the file.",
+ "get_file_hashs": "Gives you the MD5, SHA1 and SHA256 of the file.",
+ "clear": "Clear the console.",
+ "exit": "Exits the program.",
+ }
+ while 1:
+ tui.linux_prompt("analyzer")
+ choice = input()
+ if choice == "help":
+ print(f"\n{Fore.CYAN}=== Available Commands ==={Style.RESET_ALL}")
+ for cmd, desc in commands.items():
+ print(f"{Fore.YELLOW}{cmd}{Style.RESET_ALL} - {desc}")
+ print(f"{Fore.CYAN}=========================={Style.RESET_ALL}\n")
+ elif choice == "set_file":
+ file_path = file_explorer()
+ if file_path:
+ print(f"{Fore.CYAN}Selected file path: {file_path}{Style.RESET_ALL}\n")
+
+ else:
+ print(f"{Fore.YELLOW}No file selected.{Style.RESET_ALL}\n")
+ elif choice == "exe_packer_detector":
+ if file_path:
+ print(f"{Fore.CYAN}Starting the detecting process...{Style.RESET_ALL}")
+ print(f"{Fore.CYAN}packer detector result:{Style.RESET_ALL}\n")
+ print(detect_packer(file_path))
+ print("\n")
+ else:
+ print(f"{Fore.YELLOW}No file selected.{Style.RESET_ALL}\n")
+ elif choice == "exe_unpacker":
+ if file_path:
+ print(f"{Fore.CYAN}Starting the unpacking process...{Style.RESET_ALL}")
+ print(f"{Fore.CYAN}unpacker result:{Style.RESET_ALL}\n")
+ print(unpack_file(file_path))
+ print("\n")
+ else:
+ print(f"{Fore.YELLOW}No file selected.{Style.RESET_ALL}\n")
+ elif choice == "sus_strings_lookup":
+ if file_path:
+ print(
+ f"{Fore.CYAN}Starting the sus strings lookup process...{Style.RESET_ALL}"
+ )
+ print(f"{Fore.CYAN}search result:{Style.RESET_ALL}\n")
+ print(sus_strings_lookup(file_path))
+ print("\n")
+ else:
+ print(f"{Fore.YELLOW}No file selected.{Style.RESET_ALL}\n")
+ elif choice == "all_strings":
+ if file_path:
+ print(
+ f"{Fore.CYAN}Starting the all strings lookup process...{Style.RESET_ALL}"
+ )
+ print(f"{Fore.CYAN}search result:{Style.RESET_ALL}\n")
+ print(all_strings_lookup(file_path))
+ print("\n")
+ else:
+ print(f"{Fore.YELLOW}No file selected.{Style.RESET_ALL}\n")
+ elif choice == "get_file_hashs":
+ if file_path:
+ print(
+ f"{Fore.CYAN}Starting to get the file hashs process...{Style.RESET_ALL}"
+ )
+ print(f"{Fore.CYAN}hashs result:{Style.RESET_ALL}\n")
+ print(get_file_hashs(file_path))
+ else:
+ print(f"{Fore.YELLOW}No file selected.{Style.RESET_ALL}\n")
+ elif choice == "back":
+ tui.clear_console()
+ banner()
+ break
+ elif choice == "clear":
+ tui.clear_console()
+ banner()
+ elif choice == "exit":
+ tui.clear_console()
+ banner()
+ print(f"{colorama.Fore.CYAN}Exiting....{colorama.Style.RESET_ALL}")
+ sys.exit(0)
+ else:
+ print(f"{Fore.RED}Unknown command{Style.RESET_ALL}")
+
+
+def file_explorer() -> str:
+ root = Tk()
+ root.withdraw()
+ root.wm_attributes("-topmost", 1)
+ file_path = filedialog.askopenfilename(
+ filetypes=[
+ ("Python Files", "*.py"),
+ ("Python compiled Files", "*.pyc"),
+ ("exe Files", "*.exe"),
+ ("All Files", "*.*"),
+ ]
+ )
+ return file_path
+
+
+def get_info() -> str:
+ pv = platform.python_version()
+ arch = platform.architecture()[0]
+ system_info = platform.uname()
+ oss = system_info.system + " " + system_info.release
+ return {"pv": pv, "arch": arch, "os": oss}
+
+
+def fetch_info():
+ global change_log
+ global platform_info
+ if not platform.architecture()[0].startswith("64"):
+ tui.fade_type(
+ f"{colorama.Fore.YELLOW}your pc arch is not x64 bit please note this tool was tested on windows x64 bit{colorama.Style.RESET_ALL}\n"
+ )
+ change_log = requests.get(config.__CHANGELOG_URL__).json()
+ platform_info = get_info()
+
+
+def changelog_display():
+ print("\n")
+ for version_data in change_log:
+ version_element = (
+ f"{Fore.CYAN}Version {version_data['version']}{Style.RESET_ALL}\n"
+ )
+ changes_list = ""
+ for change in version_data["changes"]:
+ changes_list += f" • {change}\n"
+ version_element += changes_list
+ print(version_element)
+ print("\n")
+
+
+def cupdate() -> None:
+ if update.check_update():
+ tui.fade_type(
+ f"{colorama.Fore.CYAN}You are using the latest version{colorama.Style.RESET_ALL}\n"
+ )
+ else:
+ tui.fade_type(
+ f"{colorama.Fore.YELLOW}There's a new version. Are you sure you want to use this version?{colorama.Style.RESET_ALL}\n"
+ )
+ tui.fade_type("Answer [y/n]\n")
+ if not input(">>> ").lower() == "y":
+ tui.fade_type(
+ f"{colorama.Fore.YELLOW}Download it from here : https://github.com/Fadi002/de4py{colorama.Style.RESET_ALL}\n"
+ )
+ tui.fade_type(
+ f"{colorama.Fore.YELLOW}Press any key to exit...{colorama.Style.RESET_ALL}\n"
+ )
+ while True:
+ if msvcrt.kbhit():
+ key = msvcrt.getch()
+ tui.fade_type(
+ f"{colorama.Fore.YELLOW}Exiting...{colorama.Style.RESET_ALL}"
+ )
+ sys.exit(0)
+
+
+def banner():
+ tui.draw_line()
+ print(
+ tui.water(
+ tui.align('''
+ 888 d8888
+ 888 d8P888
+ 888 d8P 888
+ .d88888 .d88b. d8P 888 88888b. 888 888
+d88" 888 d8P Y8b d88 888 888 "88b 888 888
+888 888 88888888 8888888888 888 888 888 888
+Y88b 888 Y8b. 888 888 d88P Y88b 888
+ "Y88888 "Y8888 888 88888P" "Y88888
+ 888 888
+ 888 Y8b d88P
+ 888 "Y88P"'''
+ )
+ )
+ )
+ tui.draw_line()
+
+
+def neofetch():
+ print("\n")
+ info = f""" {Fore.GREEN}de4py@{Fore.CYAN}{os.getenv('Username')}{Style.RESET_ALL}
+ {Fore.CYAN}-----------------------------------------------{Style.RESET_ALL}
+ {Fore.CYAN}OS: {platform.system()}{Style.RESET_ALL}
+ {Fore.CYAN}Version: {platform.version()}{Style.RESET_ALL}
+ {Fore.CYAN}Kernel: {platform.uname().release}{Style.RESET_ALL}
+ {Fore.CYAN}Machine: {platform.machine()}{Style.RESET_ALL}
+ {Fore.CYAN}Processor: {platform.processor()}{Style.RESET_ALL}
+ {Fore.CYAN}Hostname: {socket.gethostname()}{Style.RESET_ALL}
+ {Fore.CYAN}User: {os.getenv('Username')}{Style.RESET_ALL}
+ {Fore.CYAN}Tool: de4py@{config.__VERSION__}{Style.RESET_ALL}"""
+ print(tui.Add.Add(tui.windows_logo, info, 4))
+
+
+def start():
+ banner()
+ tui.loading_animation("Checking for updates")
+ tui.clear_line()
+ cupdate()
+ tui.loading_animation("Fetching info")
+ fetch_info()
+ tui.clear_line()
+ fade_type(f"{colorama.Fore.CYAN}Starting de4py{colorama.Style.RESET_ALL}\n")
+ time.sleep(1)
+ tui.clear_console()
+ banner()
+ fade_type(
+ f"{colorama.Fore.CYAN}Welcome to de4py type {colorama.Style.RESET_ALL}help {colorama.Fore.CYAN}to get the commands that you can use\n"
+ )
+ if config.__RPC__:
+ rpc.start_RPC()
+ while 1:
+ home_tab()
+
+if __name__ == "__main__":
+ start()
\ No newline at end of file
diff --git a/config/config.py b/config/config.py
index 0c498a4..85c09e2 100644
--- a/config/config.py
+++ b/config/config.py
@@ -1,3 +1,4 @@
-__VERSION__ = 'V1.0.5'
+__VERSION__ = 'V1.0.6'
__CHANGELOG_URL__ = 'https://raw.githubusercontent.com/Fadi002/de4py/main/INFO/changelog.json'
-__VERSION_URL__ = 'https://raw.githubusercontent.com/Fadi002/de4py/main/INFO/version'
\ No newline at end of file
+__VERSION_URL__ = 'https://raw.githubusercontent.com/Fadi002/de4py/main/INFO/version'
+__RPC__ = True
\ No newline at end of file
diff --git a/main.py b/main.py
index 1f0e83f..ec1b8eb 100644
--- a/main.py
+++ b/main.py
@@ -3,15 +3,22 @@
| De4py project : https://github.com/Fadi002/de4py |
*********************************************************************
'''
-import os, msvcrt, eel, logging, requests, sys, platform, threading, psutil
+import os, msvcrt, eel, logging, requests, sys, platform, threading, psutil, colorama, signal
+from config import config
+from util import tui, update, gen_path, rpc
+if len(sys.argv) > 1 and sys.argv[1] == "--cli":
+ from TUI import cli
+ cli.start()
from deobfuscators.detector import detect_obfuscator
from tkinter import Tk, filedialog
from dlls import shell
-from util import tui, update, gen_path
-from config import config
from analyzer import detect_packer, unpack_file, get_file_hashs, sus_strings_lookup, all_strings_lookup
import time
-
+def signal_handler(sig, frame):
+ print(f"{colorama.Fore.CYAN}Exiting....{colorama.Style.RESET_ALL}")
+ rpc.KILL_THREAD = True
+ sys.exit(0)
+signal.signal(signal.SIGINT, signal_handler)
HANDLE = None
HANDLE_analyzer = None
STOP_THREADS = False
@@ -23,7 +30,7 @@
eel.init('gui')
-def cupdate():
+def cupdate() -> None:
if update.check_update():
logging.info("You are using the latest version")
else:
@@ -36,11 +43,12 @@ def cupdate():
if msvcrt.kbhit():
key = msvcrt.getch()
logging.warning("Exiting...")
- exit(0)
+ rpc.KILL_THREAD = True
+ sys.exit(0)
@eel.expose
-def protector_detector(file_path):
+def protector_detector(file_path) -> str:
try:
result=detect_obfuscator(file_path)
return result
@@ -49,7 +57,7 @@ def protector_detector(file_path):
@eel.expose
-def file_explorer():
+def file_explorer() -> str:
root = Tk()
root.withdraw()
root.wm_attributes('-topmost', 1)
@@ -58,7 +66,7 @@ def file_explorer():
@eel.expose
-def inject_shell(pid):
+def inject_shell(pid) -> str:
global HANDLE
l = shell.inject_shell(pid)
if l[1]:
@@ -70,13 +78,13 @@ def inject_shell(pid):
@eel.expose
-def changelog():
+def changelog() -> str:
response = requests.get(config.__CHANGELOG_URL__)
return response.text
@eel.expose
-def processchecker(pid):
+def processchecker(pid) -> str:
global HANDLE
global HANDLE_analyzer
while True:
@@ -93,13 +101,13 @@ def processchecker(pid):
@eel.expose
-def dumpstring():
+def dumpstring() -> str:
path, filename = gen_path(__file__)
write_to_pipe("DumpStrings||"+path)
return "saved as "+ filename
@eel.expose
-def openanalyzerhandle():
+def openanalyzerhandle() -> str:
global HANDLE_analyzer
write_to_pipe("GetAnalyzerHandle")
HANDLE_analyzer = os.open('\\\\.\\pipe\\de4py_analyzer', os.O_RDWR)
@@ -107,20 +115,20 @@ def openanalyzerhandle():
return "Executed | click the button again to open the menu"
@eel.expose
-def getfunctions():
+def getfunctions() -> str:
path, filename = gen_path(__file__)
write_to_pipe("GetFunctions||"+path)
return "saved as "+ filename
@eel.expose
-def execpython(path):
+def execpython(path) -> str:
write_to_pipe("ExecPY||"+path)
return "Executed"
@eel.expose
-def showconsole(pid):
+def showconsole(pid) -> str:
if shell.show_console(pid):
return "DONE"
else:
@@ -128,7 +136,7 @@ def showconsole(pid):
@eel.expose
-def get_info():
+def get_info() -> str:
pv = platform.python_version()
arch = platform.architecture()[0]
if not arch.startswith('64'):
@@ -138,7 +146,7 @@ def get_info():
return {"pv":pv,"arch":arch,"os":oss}
@eel.expose
-def write_to_pipe(message):
+def write_to_pipe(message) -> str:
global HANDLE
os.write(HANDLE, message.encode())
response = read_from_pipe()
@@ -147,19 +155,19 @@ def write_to_pipe(message):
else:
return False
-def write_to_pipe_detailed(message):
+def write_to_pipe_detailed(message) -> str:
global HANDLE
os.write(HANDLE, message.encode())
response = read_from_pipe()
return response
-def read_from_pipe():
+def read_from_pipe() -> str:
global HANDLE
message = os.read(HANDLE, 1024).decode()
return message
@eel.expose
-def monitorfileshook(var):
+def monitorfileshook(var) -> str:
if var:
write_to_pipe("MonitorFiles")
return "Monitor files hook has been installed"
@@ -168,7 +176,7 @@ def monitorfileshook(var):
return "Monitor files hook has been uninstalled"
@eel.expose
-def monitorprocesseshook(var):
+def monitorprocesseshook(var) -> str:
if var:
write_to_pipe("MonitorProcesses")
return "Monitor processes hook has been installed"
@@ -177,7 +185,7 @@ def monitorprocesseshook(var):
return "Monitor processes hook has been uninstalled"
@eel.expose
-def monitorconnectionshook(var):
+def monitorconnectionshook(var) -> str:
if var:
write_to_pipe("MonitorConnections")
return "Monitor connections hook has been installed"
@@ -185,7 +193,7 @@ def monitorconnectionshook(var):
write_to_pipe("UnMonitorConnections")
return "Monitor connections hook has been uninstalled"
-def dealwithfilesocket():
+def dealwithfilesocket() -> str:
if not os.path.exists(os.getcwd() + "\\SocketDump.txt"):
open(os.getcwd() + "\\SocketDump.txt", 'w').close()
@@ -194,7 +202,7 @@ def dealwithfilessl():
open(os.getcwd() + "\\OpenSSLDump.txt", 'w').close()
@eel.expose
-def dumpsocketcontent(var):
+def dumpsocketcontent(var) -> str:
if var:
dealwithfilesocket()
response = write_to_pipe("DumpConnections||" + os.getcwd() + "\\SocketDump.txt")
@@ -204,7 +212,7 @@ def dumpsocketcontent(var):
return "stopped dumping socket content."
@eel.expose
-def dumpopensslcontent(var):
+def dumpopensslcontent(var) -> str:
if var:
dealwithfilessl()
return write_to_pipe_detailed("DumpOpenSSL||" + os.getcwd() + "\\OpenSSLDump.txt")
@@ -224,15 +232,18 @@ def update_hooks_output():
except Exception as e:
logging.error(f"Error occurred while reading from HANDLE_analyzer: {str(e)}")
-def main():
+def main() -> None:
# eel.start('index.html',size=(1024, 589),port=3456)
eel.start('index.html',size=(1024, 589),port=5456)
-
+ rpc.KILL_THREAD = True
if __name__ == '__main__':
try:
cupdate()
- except:
+ except Exception as e:
+ print(e)
logging.error("Failed to check the update")
+ if config.__RPC__:
+ rpc.start_RPC()
main()
diff --git a/requirements.txt b/requirements.txt
index 261dc4c..53ae797 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -5,4 +5,5 @@ pyinstaller
py2exe
pycryptodome
colorama
-xdis
\ No newline at end of file
+xdis
+pypresence
\ No newline at end of file
diff --git a/util/__init__.py b/util/__init__.py
index 16c23d9..ba6e81c 100644
--- a/util/__init__.py
+++ b/util/__init__.py
@@ -1,3 +1,4 @@
from .tui import *
from .update import *
from .pathgen import *
+from .rpc import *
\ No newline at end of file
diff --git a/util/rpc.py b/util/rpc.py
new file mode 100644
index 0000000..ef78a60
--- /dev/null
+++ b/util/rpc.py
@@ -0,0 +1,37 @@
+from pypresence import Presence
+import threading, os, time
+from config import config
+import ctypes
+
+RPC = None
+KILL_THREAD = None
+
+def __RPC_THREAD__():
+ global RPC
+ global KILL_THREAD
+ start = int(time.time())
+ while True:
+ if KILL_THREAD:
+ break
+ try:
+ RPC.update(
+ large_image = "de4py",
+ large_text = "De4py",
+ details = f"De4py {config.__VERSION__}",
+ state ="Python reverse engineering toolkit",
+ start = start,
+ buttons = [{"label": "Download", "url": "https://de4py.000.pe/"}, {"label": "Github", "url": "https://github.com/Fadi002"}]
+ )
+ time.sleep(3)
+ except:
+ break
+
+def start_RPC():
+ global RPC
+ try:
+ RPC = Presence("1190392428247650466")
+ RPC.connect()
+ threading.Thread(target=__RPC_THREAD__).start()
+ except:
+ pass
+
diff --git a/util/tui.py b/util/tui.py
index 818fd58..ea20ab4 100644
--- a/util/tui.py
+++ b/util/tui.py
@@ -1,5 +1,35 @@
-import os, logging, time
-from colorama import Fore, Style
+import os, logging, time, shutil, sys
+from colorama import Fore, Style, AnsiToWin32
+from traceback import extract_tb
+__RAW_BANNER__ = '''
+██████╗ ███████╗██╗ ██╗██████╗ ██╗ ██╗
+██╔══██╗██╔════╝██║ ██║██╔══██╗╚██╗ ██╔╝
+██║ ██║█████╗ ███████║██████╔╝ ╚████╔╝
+██║ ██║██╔══╝ ╚════██║██╔═══╝ ╚██╔╝
+██████╔╝███████╗ ██║██║ ██║
+╚═════╝ ╚══════╝ ╚═╝╚═╝ ╚═╝'''
+
+windows_logo = f"""{Fore.CYAN} ..,
+{Fore.CYAN} ....,,:;+ccllll
+{Fore.CYAN} ...,,+:; cllllllllllllllllll
+{Fore.CYAN},cclllllllllll lllllllllllllllllll
+{Fore.CYAN}llllllllllllll lllllllllllllllllll
+{Fore.CYAN}llllllllllllll lllllllllllllllllll
+{Fore.CYAN}llllllllllllll lllllllllllllllllll
+{Fore.CYAN}llllllllllllll lllllllllllllllllll
+{Fore.CYAN}llllllllllllll lllllllllllllllllll
+{Fore.CYAN}
+{Fore.CYAN}llllllllllllll lllllllllllllllllll
+{Fore.CYAN}llllllllllllll lllllllllllllllllll
+{Fore.CYAN}llllllllllllll lllllllllllllllllll
+{Fore.CYAN}llllllllllllll lllllllllllllllllll
+{Fore.CYAN}llllllllllllll lllllllllllllllllll
+{Fore.CYAN}llllllllllllll lllllllllllllllllll
+{Fore.CYAN}`'ccllllllllll lllllllllllllllllll
+{Fore.CYAN} `' \\*:: :ccllllllllllllllll
+{Fore.CYAN} ````''*::cll
+{Fore.CYAN} ``{Style.RESET_ALL}"""
+
def water(text):
os.system(""); faded = ""
green = 10
@@ -10,14 +40,11 @@ def water(text):
if green > 255:
green = 255
return faded
-__BANNER__ = water('''
-██████╗ ███████╗██╗ ██╗██████╗ ██╗ ██╗
-██╔══██╗██╔════╝██║ ██║██╔══██╗╚██╗ ██╔╝
-██║ ██║█████╗ ███████║██████╔╝ ╚████╔╝
-██║ ██║██╔══╝ ╚════██║██╔═══╝ ╚██╔╝
-██████╔╝███████╗ ██║██║ ██║
-╚═════╝ ╚══════╝ ╚═╝╚═╝ ╚═╝''')
+
+__BANNER__ = water(__RAW_BANNER__)
+
def clear_console():os.system('cls' if os.name == 'nt' else 'clear')
+
def setup_logging():
log_level = logging.INFO
logging_format = "%(levelname)s - %(message)s"
@@ -38,7 +65,143 @@ def emit(self, record):
else:
colored_message = message
print(colored_message)
+
def fade_type(text):
for c in text:
print(c,end='',flush=True)
- time.sleep(0.009)
\ No newline at end of file
+ time.sleep(0.009)
+
+def align(text: str) -> str:
+ """
+ credits : https://github.com/SirDank/dankware/blob/main/dankware/__init__.py
+ """
+
+ width = shutil.get_terminal_size().columns
+ aligned = text
+
+ for _ in tuple(vars(Fore).values()) + tuple(vars(Style).values()):
+ aligned = aligned.replace(_,'')
+
+ text = text.splitlines()
+ aligned = aligned.splitlines()
+
+ for _ in range(len(aligned)):
+ aligned[_] = aligned[_].center(width).replace(aligned[_],text[_])
+
+ return str('\n'.join(aligned) + Style.RESET_ALL)
+
+def draw_line():
+ terminal_width = shutil.get_terminal_size().columns
+ line = Fore.CYAN + "-" * terminal_width + Style.RESET_ALL
+ print(line)
+
+
+def loading_animation(text, loops=2):
+ frames = ['\\', '|', '/', '-']
+ for _ in range(loops):
+ for frame in frames:
+ line = f"{Fore.CYAN}{text} {Style.RESET_ALL}[{Fore.CYAN}{frame}{Style.RESET_ALL}]" + Style.RESET_ALL
+ print(line, end='\r')
+ time.sleep(0.2)
+
+def clear_line():
+ sys.stdout.write("\033[K")
+ sys.stdout.flush()
+
+def linux_prompt(tab="~"):
+ sys.stdout.write(f"{Fore.GREEN}de4py@{Fore.CYAN}{os.getenv('Username')}{Style.RESET_ALL} {Fore.GREEN}{tab}/ {Style.RESET_ALL}$ ")
+ sys.stdout.flush()
+
+
+
+def custom_error(exc_type, exc_value, exc_traceback):
+ print(f"{Fore.RED}=== Start Traceback ==={Style.RESET_ALL}")
+ print(f"{Fore.RED}Error Type:{Style.RESET_ALL} {exc_type.__name__}")
+ print(f"{Fore.RED}Error Message:{Style.RESET_ALL} {exc_value}")
+ print(f"{Fore.RED}Traceback:{Style.RESET_ALL}")
+ traceback_lines = []
+ for filename, line_num, func_name, line_code in extract_tb(exc_traceback):
+ traceback_lines.append(f" File '{filename}', line {line_num}, in {func_name}\n {line_code}")
+ print("\n".join(traceback_lines))
+ print(f"{Fore.RED}=== End of Traceback ==={Style.RESET_ALL}")
+
+
+
+class Add:
+
+ """
+ CREDITS: https://github.com/billythegoat356/pystyle/blob/main/pystyle/__init__.py
+ 1 function:
+ Add() | allow you to add a text to another, and even center it
+ """
+
+ def Add(banner1, banner2, spaces=0, center=False):
+ if center:
+ split1 = len(banner1.splitlines())
+ split2 = len(banner2.splitlines())
+ if split1 > split2:
+ spaces = (split1 - split2) // 2
+ elif split2 > split1:
+ spaces = (split2 - split1) // 2
+ else:
+ spaces = 0
+
+ if spaces > max(len(banner1.splitlines()), len(banner2.splitlines())):
+ # raise Banner.MaximumSpaces(spaces)
+ spaces = max(len(banner1.splitlines()), len(banner2.splitlines()))
+
+ ban1 = banner1.splitlines()
+ ban2 = banner2.splitlines()
+
+ ban1count = len(ban1)
+ ban2count = len(ban2)
+
+ size = Add._length(ban1)
+
+ ban1 = Add._edit(ban1, size)
+
+ ban1line = 0
+ ban2line = 0
+ text = ''
+
+ for _ in range(spaces):
+
+ if ban1count >= ban2count:
+ ban1data = ban1[ban1line]
+ ban2data = ''
+
+ ban1line += 1
+
+ else:
+ ban1data = " " * size
+ ban2data = ban2[ban2line]
+
+ ban2line += 1
+
+ text = text + ban1data + ban2data + '\n'
+ while ban1line < ban1count or ban2line < ban2count:
+
+ ban1data = ban1[ban1line] if ban1line < ban1count else " " * size
+ ban2data = ban2[ban2line] if ban2line < ban2count else ""
+ text = text + ban1data + ban2data + '\n'
+
+ ban1line += 1
+ ban2line += 1
+ return text
+
+ """ ! developper area ! """
+
+ class MaximumSpaces(Exception):
+ def __init__(self, spaces: str):
+ super().__init__(f"Too much spaces [{spaces}].")
+
+ def _length(ban1):
+ bigestline = 0
+
+ for line in ban1:
+ if len(line) > bigestline:
+ bigestline = len(line)
+ return bigestline
+
+ def _edit(ban1, size):
+ return [line + (size - len(line)) * " " for line in ban1]
\ No newline at end of file