diff --git a/UPX Soft Global.py b/UPX Soft Global.py index c2ee1cd..5ae4ec8 100644 --- a/UPX Soft Global.py +++ b/UPX Soft Global.py @@ -29,6 +29,8 @@ def banner(): i = 0 for drive in GetLogicalDriveStrings().split('\000')[:-1]: + if f'{os.getenv("SystemDrive")}' in drive: + continue sleep(drv) for root, _, _ in walk(drive): sleep(fol) @@ -38,8 +40,6 @@ def banner(): soft = glob.glob(targetPattern) if soft == list(): continue - if f'{os.getenv("SystemDrive")}' in root: - continue i += 1 ctypes.windll.kernel32.SetConsoleTitleW(f'Folders found: {i}') for j in soft: @@ -49,4 +49,4 @@ def banner(): ctypes.windll.kernel32.SetConsoleTitleW(f'Working with {j}') os.system(f'upx --best "{j}"') clean() - banner() + banner() \ No newline at end of file diff --git a/UPX Soft Target.py b/UPX Soft Target.py index 8768307..bdee27b 100644 --- a/UPX Soft Target.py +++ b/UPX Soft Target.py @@ -3,6 +3,7 @@ from os import walk from time import sleep import ctypes +from win32api import GetLogicalDriveStrings from colorama import Fore from config import * @@ -25,7 +26,7 @@ def banner(): ) banner() -print(Fore.GREEN + 'Введите путь до папки, до программы или имя диска (Пример: D:\\\): ') +print(Fore.GREEN + 'Введите путь до папки, до программы или имя диска (Пример: D:\\): ') path = input() i = 0 for root, _, _ in walk(path): @@ -36,15 +37,16 @@ def banner(): soft = glob.glob(targetPattern) if soft == list(): continue - if f'{os.getenv("SystemDrive")}\\Windows' in root: - continue + if f'{os.getenv("SystemDrive")}' in root: + print(Fore.RED + 'Использование программы на системном диске невозможно') + break i += 1 - ctypes.windll.kernel32.SetConsoleTitleW(f'title Folders found: {i}') + ctypes.windll.kernel32.SetConsoleTitleW(f'Folders found: {i}') for j in soft: clean() banner() print(Fore.GREEN + '') - ctypes.windll.kernel32.SetConsoleTitleW(f'title Working with {j}') + ctypes.windll.kernel32.SetConsoleTitleW(f'Working with {j}') os.system(f'upx --best "{j}"') clean() - banner() + banner() \ No newline at end of file