Najeebsk

TOTAL-COMMANDS-PROMAX.py

Apr 15th, 2026 (edited)
208
0
Never
9
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 56.61 KB | None | 0 0
  1. import tkinter as tk
  2. from tkinter import ttk, filedialog, messagebox, scrolledtext
  3. import subprocess
  4. import threading
  5. import datetime
  6. import os
  7. import sys
  8. import platform
  9. import ctypes
  10. import socket
  11. import re
  12.  
  13. # Optional: psutil for system stats
  14. try:
  15.     import psutil
  16.     PSUTIL_AVAILABLE = True
  17. except ImportError:
  18.     PSUTIL_AVAILABLE = False
  19.     print("⚠️ psutil not installed. Install with: pip install psutil")
  20.  
  21.  
  22. class GodModeUltimate:
  23.     def __init__(self, root):
  24.         self.root = root
  25.         self.root.title("NAJEEB TOTAL CMD PRO MAX V4 - ULTIMATE ADMIN EDITION")
  26.         self.root.geometry("1200x850")
  27.         self.root.minsize(900, 700)
  28.  
  29.         # Theme Colors
  30.         self.dark_theme = {
  31.             "bg": "#1e1e1e", "fg": "#00ff00", "input_bg": "#2d2d2d",
  32.             "input_fg": "#ffffff", "btn_bg": "#333333", "btn_fg": "#ffffff",
  33.             "accent": "#007acc", "header_bg": "#252526", "warning": "#ff4444",
  34.             "success": "#00cc00", "info": "#0099ff"
  35.         }
  36.         self.light_theme = {
  37.             "bg": "#ffffff", "fg": "#000000", "input_bg": "#f0f0f0",
  38.             "input_fg": "#000000", "btn_bg": "#e1e1e1", "btn_fg": "#000000",
  39.             "accent": "#005fb8", "header_bg": "#f3f3f3", "warning": "#cc0000",
  40.             "success": "#009900", "info": "#0066cc"
  41.         }
  42.         self.current_theme = "dark"
  43.  
  44.         # Variables
  45.         self.commands = []
  46.         self.listbox_commands = []  # Maps listbox index to actual command
  47.         self.command_display_names = {}  # ✅ Maps command -> display name for fast search
  48.         self.history = []
  49.         self.is_running = False
  50.         self.is_admin = False
  51.         self.templates = self.get_command_templates()
  52.         self.process = None  # For stopping commands
  53.        
  54.         # 📁 Working Directory Variable
  55.         self.work_dir = tk.StringVar(value=os.getcwd())
  56.  
  57.         # Setup UI
  58.         self.setup_styles()
  59.         self.create_widgets()
  60.         self.apply_theme()
  61.         self.check_admin_privileges()
  62.  
  63.     def setup_styles(self):
  64.         style = ttk.Style()
  65.         style.theme_use('clam')
  66.         style.configure("Treeview", background="#2d2d2d", foreground="white", fieldbackground="#2d2d2d")
  67.         style.map("Treeview", background=[('selected', '#007acc')])
  68.        
  69.         self.output_tags = {
  70.             "error": ("red", "bold"),
  71.             "success": ("green", "normal"),
  72.             "warning": ("orange", "bold"),
  73.             "info": ("blue", "normal"),
  74.             "command": ("cyan", "bold")
  75.         }
  76.  
  77.     def get_command_templates(self):
  78.         return {
  79.     "🖥️ System Info": [
  80.         ("System Info", "systeminfo"),
  81.         ("OS Version", "ver"),
  82.         ("Uptime", "systeminfo | findstr /i \"uptime\""),
  83.         ("Computer Name", "echo %COMPUTERNAME%"),
  84.         ("User Profile", "echo %USERPROFILE%"),
  85.         ("Windows Dir", "echo %WINDIR%"),
  86.         ("System Root", "echo %SYSTEMROOT%"),
  87.         ("Processor Info", "wmic cpu get name,maxclockspeed /format:list"),
  88.         ("BIOS Info", "wmic bios get serialnumber,version /format:list"),
  89.         ("OS Details", "wmic os get caption,version,osarchitecture /format:list"),
  90.         ("Memory Info", "wmic memorychip get capacity,speed /format:list"),
  91.         ("Disk Info", "wmic diskdrive get model,size /format:list"),
  92.         ("Logical Disk", "wmic logicaldisk get size,freespace,caption /format:table"),
  93.     ],
  94.    
  95.     # ═══════════════════════════════════════════════════════════════
  96.     # 💾 DRIVES & STORAGE
  97.     # ═══════════════════════════════════════════════════════════════
  98.     "💾 Drives & Storage": [
  99.         ("C:\\Users List", "dir C:\\Users >> %COMPUTERNAME%-IS.txt"),
  100.         ("Program Files", "dir \"C:\\Program Files\" >> %COMPUTERNAME%-IS.txt"),
  101.         ("Drive Scan D:", "dir /S /B /A \"D:\\\" >> %COMPUTERNAME%-LISTD.txt"),
  102.         ("Drive Scan E:", "dir /S /B /A \"E:\\\" >> %COMPUTERNAME%-LISTE.txt"),
  103.         ("Drive Scan F:", "dir /S /B /A \"F:\\\" >> %COMPUTERNAME%-LISTF.txt"),
  104.         ("Drive Scan G:", "dir /S /B /A \"G:\\\" >> %COMPUTERNAME%-LISTG.txt"),
  105.         ("Drive Scan H:", "dir /S /B /A \"H:\\\" >> %COMPUTERNAME%-LISTH.txt"),
  106.         ("Volume Info", "vol C:"),
  107.         ("Diskpart List", "diskpart /c \"list disk\""),
  108.         ("Disk Check", "chkdsk C: /f /r"),
  109.         ("Defrag", "defrag C: /O /V"),
  110.         ("Format Disk", "format D: /FS:NTFS /Q"),
  111.     ],
  112.    
  113.     # ═══════════════════════════════════════════════════════════════
  114.     # 📁 FILES & FOLDERS (DIR, CD, MD, RD)
  115.     # ═══════════════════════════════════════════════════════════════
  116.     "📁 Files & Folders": [
  117.         ("Directory List", "dir /w"),
  118.         ("Directory Recursive", "dir /s /b"),
  119.         ("File Search *.txt", "dir /s /b *.txt"),
  120.         ("Find Files", "where /r C:\\ *.exe"),
  121.         ("Search Content", "findstr /s /i \"keyword\" *.txt"),
  122.         ("Change Dir", "cd /d D:\\Example"),
  123.         ("Root Dir", "cd\\"),
  124.         ("Parent Dir", "cd.."),
  125.         ("Make Directory", "mkdir NewFolder"),
  126.         ("Remove Directory", "rmdir /s /q foldername"),
  127.         ("Tree View", "tree C:\\ /f /a"),
  128.         ("File Attributes", "attrib filename.txt"),
  129.         ("Set Hidden", "attrib +h file.txt"),
  130.         ("Remove Hidden", "attrib -h file.txt"),
  131.         ("Set System", "attrib +s file.txt"),
  132.         ("Remove System", "attrib -s file.txt"),
  133.         ("Set Read-Only", "attrib +r file.txt"),
  134.         ("Remove Read-Only", "attrib -r file.txt"),
  135.     ],
  136.    
  137.     # ═══════════════════════════════════════════════════════════════
  138.     # 📋 COPY, MOVE, RENAME, DELETE
  139.     # ═══════════════════════════════════════════════════════════════
  140.     "📋 Copy/Move/Rename/Delete": [
  141.         ("Copy File", "copy source.txt dest\\"),
  142.         ("Copy Multiple", "copy file1.txt+file2.txt combined.txt"),
  143.         ("Copy Recursive", "copy /s source\\*.* destination\\"),
  144.         ("Move File", "move source.txt dest\\"),
  145.         ("Rename File", "ren oldname.txt newname.txt"),
  146.         ("Rename Extension", "ren *.pyw *.py"),
  147.         ("Robocopy Mirror", "robocopy source dest /mir"),
  148.         ("Robocopy Backup", "robocopy source dest /backup"),
  149.         ("XCopy Backup", "xcopy \"C:\\Data\" \"D:\\Backup\" /e /h /y"),
  150.         ("Delete File", "del file.txt"),
  151.         ("Delete Recursive", "del /s /q %temp%\\*.*"),
  152.         ("Delete Folder", "rd /s /q foldername"),
  153.         ("Force Delete", "del /f /q *.tmp"),
  154.     ],
  155.    
  156.     # ═══════════════════════════════════════════════════════════════
  157.     # 🌐 NETWORK & INTERNET
  158.     # ═══════════════════════════════════════════════════════════════
  159.     "🌐 Network": [
  160.         ("IP Configuration", "ipconfig /all"),
  161.         ("DNS Cache", "ipconfig /displaydns"),
  162.         ("Flush DNS", "ipconfig /flushdns"),
  163.         ("Network Connections", "netstat -ano"),
  164.         ("Listening Ports", "netstat -ano | find \"LISTEN\""),
  165.         ("Ping Test", "ping google.com -n 4"),
  166.         ("Traceroute", "tracert google.com"),
  167.         ("PathPing", "pathping google.com"),
  168.         ("ARP Table", "arp -a"),
  169.         ("Route Table", "route print"),
  170.         ("Get MAC", "getmac /v"),
  171.         ("WiFi Profiles", "netsh wlan show profiles"),
  172.         ("WiFi Details", "netsh wlan show profile name=\"SSID\" key=clear"),
  173.         ("DNS Lookup", "nslookup google.com"),
  174.         ("Netsh Firewall", "netsh advfirewall show allprofiles"),
  175.     ],
  176.    
  177.     # ═══════════════════════════════════════════════════════════════
  178.     # 👥 USERS, GROUPS & SESSIONS
  179.     # ═══════════════════════════════════════════════════════════════
  180.     "👥 Users & Groups": [
  181.         ("User Accounts", "net user"),
  182.         ("User Details", "net user %USERNAME%"),
  183.         ("Local Groups", "net localgroup"),
  184.         ("Local Admins", "net localgroup administrators"),
  185.         ("Current User", "whoami /all"),
  186.         ("Active Sessions", "query session"),
  187.         ("Logged Users", "query user"),
  188.         ("WMIC Users", "wmic useraccount get name,sid,disabled /format:table"),
  189.     ],
  190.    
  191.     # ═══════════════════════════════════════════════════════════════
  192.     # ⚙️ PROCESSES & SERVICES
  193.     # ═══════════════════════════════════════════════════════════════
  194.     "⚙️ Processes & Services": [
  195.         ("Running Processes", "tasklist"),
  196.         ("Process Filter", "tasklist /fi \"imagename eq chrome.exe\""),
  197.         ("Kill Process", "taskkill /f /im notepad.exe"),
  198.         ("Services Status", "sc query"),
  199.         ("Start Service", "sc start spooler"),
  200.         ("Stop Service", "sc stop spooler"),
  201.         ("Service Config", "sc config spooler start=auto"),
  202.         ("Startup Programs", "wmic startup get caption,command"),
  203.         ("Scheduled Tasks", "schtasks /query /fo LIST"),
  204.         ("Create Task", "schtasks /create /tn \"MyTask\" /tr \"C:\\app.exe\" /sc daily /st 09:00"),
  205.     ],
  206.    
  207.     # ═══════════════════════════════════════════════════════════════
  208.     # 🔐 SECURITY & FIREWALL
  209.     # ═══════════════════════════════════════════════════════════════
  210.     "🔐 Security": [
  211.         ("Firewall Status", "netsh advfirewall show allprofiles"),
  212.         ("Firewall Add Rule", "netsh advfirewall firewall add rule name=\"AllowApp\" dir=in action=allow program=\"C:\\app.exe\""),
  213.         ("Windows Defender", "powershell -Command \"Get-MpComputerStatus\""),
  214.         ("Audit Policy", "auditpol /get /category:*"),
  215.         ("Event Logs", "wevtutil qe System /c:5 /f:text"),
  216.         ("Clear Event Log", "wevtutil cl Application"),
  217.         ("Registry Query", "reg query HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"),
  218.         ("Take Ownership", "takeown /f file.txt"),
  219.         ("Set Permissions", "icacls file.txt /grant Users:F"),
  220.         ("Cipher Encrypt", "cipher /e C:\\SecretFolder"),
  221.     ],
  222.    
  223.     # ═══════════════════════════════════════════════════════════════
  224.     # 🔧 SYSTEM REPAIR & RECOVERY
  225.     # ═══════════════════════════════════════════════════════════════
  226.     "🔧 Repair & Recovery": [
  227.         ("SFC Scan", "sfc /scannow"),
  228.         ("DISM Check", "DISM /Online /Cleanup-Image /CheckHealth"),
  229.         ("DISM Restore", "DISM /Online /Cleanup-Image /RestoreHealth"),
  230.         ("BCD Edit", "bcdedit /enum"),
  231.         ("Bootrec Fix MBR", "bootrec /fixmbr"),
  232.         ("Bootrec Fix Boot", "bootrec /fixboot"),
  233.         ("Reagentc Info", "reagentc /info"),
  234.         ("System Restore", "rstrui.exe"),
  235.     ],
  236.    
  237.     # ═══════════════════════════════════════════════════════════════
  238.     # 🎨 UTILITIES & CONTROL PANEL
  239.     # ═══════════════════════════════════════════════════════════════
  240.     "🎨 Utilities": [
  241.         ("Open Notepad", "notepad"),
  242.         ("Open Calculator", "calc"),
  243.         ("Open Regedit", "regedit"),
  244.         ("Open Task Manager", "taskmgr"),
  245.         ("Open Services", "services.msc"),
  246.         ("Open Disk Management", "diskmgmt.msc"),
  247.         ("Open Device Manager", "devmgmt.msc"),
  248.         ("Open Event Viewer", "eventvwr.msc"),
  249.         ("System Properties", "sysdm.cpl"),
  250.         ("Control Panel", "control"),
  251.         ("MsConfig", "msconfig"),
  252.         ("DXDiag", "dxdiag"),
  253.         ("MsInfo32", "msinfo32"),
  254.         ("Color CMD", "color 0A"),
  255.     ],
  256.    
  257.     # ═══════════════════════════════════════════════════════════════
  258.     # 🎬 FFMPEG VIDEO/AUDIO TOOLS
  259.     # ═══════════════════════════════════════════════════════════════
  260.     "🎬 FFmpeg Tools": [
  261.         ("Convert Format", "ffmpeg -i input.mp4 output.mkv"),
  262.         ("Resize Video", "ffmpeg -i input.mp4 -vf \"scale=1280:-2\" output.mp4"),
  263.         ("Extract Audio", "ffmpeg -i video.mp4 -vn audio.mp3"),
  264.         ("Trim Video", "ffmpeg -ss 00:01:00 -t 30 -i input.mp4 -c copy clip.mp4"),
  265.         ("Change Quality", "ffmpeg -i input.mp4 -crf 23 output.mp4"),
  266.         ("Change Bitrate", "ffmpeg -i input.mp4 -b:v 2M output.mp4"),
  267.         ("Extract Frame", "ffmpeg -i input.mp4 -ss 00:00:05 -frames:v 1 image.png"),
  268.         ("Merge Videos", "ffmpeg -i input1.mp4 -i input2.mp4 -filter_complex \"concat\" output.mp4"),
  269.         ("Audio Only", "ffmpeg -i input.mp4 -vn output.mp3"),
  270.         ("Video Only", "ffmpeg -i input.mp4 -an output.mp4"),
  271.     ],
  272.    
  273.     # ═══════════════════════════════════════════════════════════════
  274.     # 🖼️ IMAGEMAGICK IMAGE TOOLS
  275.     # ═══════════════════════════════════════════════════════════════
  276.     "🖼️ ImageMagick Tools": [
  277.         ("Convert Format", "magick input.jpg output.png"),
  278.         ("Resize Image", "magick input.jpg -resize 800x600 output.jpg"),
  279.         ("Trim Image", "magick input.jpg -trim output.jpg"),
  280.         ("Crop Image", "magick input.jpg -crop 800x600+0+0 output.jpg"),
  281.         ("Rotate Image", "magick input.jpg -rotate 90 output.jpg"),
  282.         ("Add Watermark", "magick input.jpg -gravity center -annotate +0+0 \"Text\" output.jpg"),
  283.         ("Change Quality", "magick input.jpg -quality 85 output.jpg"),
  284.         ("Batch Resize", "mogrify -resize 1280x720 *.jpg"),
  285.         ("Batch Convert", "mogrify -format png *.jpg"),
  286.         ("Add Border", "magick input.jpg -bordercolor white -border 10 output.jpg"),
  287.     ],
  288.    
  289.     # ═══════════════════════════════════════════════════════════════
  290.     # 📦 BATCH & POWERSHELL SCRIPTS
  291.     # ═══════════════════════════════════════════════════════════════
  292.     "📦 Scripts": [
  293.         ("Batch Loop Files", "for %%f in (*.jpg) do echo %%f"),
  294.         ("Batch Rename", "for %%f in (*.txt) do ren \"%%f\" \"backup_%%f\""),
  295.         ("Batch Date Check", "IF \"%DATE%\" == \"Sat 12/16/2023\" start \"\" \"C:\\file.jpg\""),
  296.         ("PowerShell List", "powershell Get-ChildItem *.txt"),
  297.         ("PowerShell Rename", "powershell Get-ChildItem *.txt | Rename-Item -NewName {$_.Name -replace '.txt','.log'}"),
  298.         ("PowerShell Process", "powershell Get-Process | Sort CPU -Descending | Select -First 10"),
  299.         ("PowerShell Service", "powershell Get-Service | Where-Object {$_.Status -eq 'Running'}"),
  300.         ("PowerShell Download", "powershell Invoke-WebRequest \"URL\" -OutFile \"file.zip\""),
  301.     ],
  302.    
  303.     # ═══════════════════════════════════════════════════════════════
  304.     # 🧹 CLEANUP & MAINTENANCE
  305.     # ═══════════════════════════════════════════════════════════════
  306.     "🧹 Cleanup": [
  307.         ("Clear Temp", "del /s /q %temp%\\*.*"),
  308.         ("Clear Windows Temp", "del /s /q C:\\Windows\\Temp\\*.*"),
  309.         ("Empty Recycle Bin", "rd /s /q C:\\$Recycle.Bin"),
  310.         ("Clear DNS", "ipconfig /flushdns"),
  311.         ("Clear Event Logs", "wevtutil cl System && wevtutil cl Application"),
  312.         ("Disk Cleanup", "cleanmgr /sagerun:1"),
  313.         ("Compact OS", "compact /compactos:always"),
  314.         ("Prefetch Clean", "del /q C:\\Windows\\Prefetch\\*.*"),
  315.     ],
  316.    
  317.     # ═══════════════════════════════════════════════════════════════
  318.     # 🌍 WEB DOWNLOAD TOOLS (WGET/CURL/YOUTUBE-DL)
  319.     # ═══════════════════════════════════════════════════════════════
  320.     "🌍 Web Download": [
  321.         ("Wget Download", "wget https://example.com/file.zip"),
  322.         ("Wget Resume", "wget -c https://example.com/file.zip"),
  323.         ("Wget Recursive", "wget -r -A pdf,doc https://example.com/docs/"),
  324.         ("Curl Test", "curl -I https://example.com"),
  325.         ("YouTube-DL Video", "youtube-dl -f best https://youtube.com/watch?v=ID"),
  326.         ("YouTube-DL Audio", "youtube-dl -x --audio-format mp3 https://youtube.com/watch?v=ID"),
  327.         ("yt-dlp Update", "yt-dlp -U"),
  328.     ],
  329.    
  330.     # ═══════════════════════════════════════════════════════════════
  331.     # 📱 TERMUX (ANDROID) COMMANDS
  332.     # ═══════════════════════════════════════════════════════════════
  333.     "📱 Termux": [
  334.         ("Termux Update", "pkg update && pkg upgrade -y"),
  335.         ("Termux Storage", "termux-setup-storage"),
  336.         ("Termux Location", "termux-location"),
  337.         ("Termux Battery", "termux-battery-status"),
  338.         ("Termux WiFi Info", "termux-wifi-connectioninfo"),
  339.         ("Termux Camera", "termux-camera-photo /sdcard/pic.jpg"),
  340.         ("Termux SMS Send", "termux-sms-send -n 03001234567 \"Hello\""),
  341.         ("Termux Torch", "termux-torch on"),
  342.         ("Termux Vibrate", "termux-vibrate -d 1000"),
  343.         ("Termux TTS", "termux-tts-speak \"Hello world\""),
  344.     ],
  345.    
  346.     # ═══════════════════════════════════════════════════════════════
  347.     # 🛠️ NIRCMD UTILITY COMMANDS
  348.     # ═══════════════════════════════════════════════════════════════
  349.     "🛠️ NirCmd": [
  350.         ("Set Wallpaper", "nircmd.exe setwallpaper \"C:\\wallpaper.jpg\""),
  351.         ("Open URL", "nircmd.exe openurl \"https://example.com\""),
  352.         ("Monitor Off", "nircmd.exe monitor off"),
  353.         ("Mute Volume", "nircmd.exe mutesysvolume 1"),
  354.         ("Unmute Volume", "nircmd.exe mutesysvolume 0"),
  355.         ("Shutdown", "nircmd.exe exitwin poweroff force"),
  356.         ("Screenshot", "nircmd.exe savescreenshot \"C:\\shot.png\""),
  357.         ("Speak Text", "nircmd.exe speak text \"Hello\""),
  358.         ("Empty Recycle Bin", "nircmd.exe emptybin"),
  359.     ],
  360.    
  361.     # ═══════════════════════════════════════════════════════════════
  362.     # 🐍 PYTHON & PYINSTALLER
  363.     # ═══════════════════════════════════════════════════════════════
  364.     "🐍 Python/PyInstaller": [
  365.         ("Install PyInstaller", "pip install --upgrade pyinstaller"),
  366.         ("Build EXE Basic", "pyinstaller --onefile --noconsole script.py"),
  367.         ("Build EXE with Icon", "pyinstaller --onefile --noconsole --icon=app.ico script.py"),
  368.         ("Build EXE with Data", "pyinstaller --onefile --add-data \"data.txt;.\" script.py"),
  369.         ("Build EXE with VLC", "pyinstaller --onefile --add-binary \"libvlc.dll;.\" --noconsole script.py"),
  370.         ("Auto-Py-To-Exe", "auto-py-to-exe"),
  371.     ],
  372.    
  373.     # ═══════════════════════════════════════════════════════════════
  374.     # 🔗 QUICK WEB LINKS
  375.     # ═══════════════════════════════════════════════════════════════
  376.     "🔗 Web Links": [
  377.         ("ChatGPT", "start https://chatgpt.com"),
  378.         ("Qwen AI", "start https://chat.qwen.ai"),
  379.         ("Google Search", "start https://www.google.com/search?q="),
  380.         ("YouTube", "start https://www.youtube.com"),
  381.         ("GitHub", "start https://github.com"),
  382.         ("Pastebin", "start https://pastebin.com"),
  383.         ("VirusTotal", "start https://www.virustotal.com"),
  384.         ("DeepL Translator", "start https://www.deepl.com"),
  385.     ],
  386. }
  387.  
  388.     def create_widgets(self):
  389.         # === TOP BAR ===
  390.         self.top_bar = tk.Frame(self.root)
  391.         self.top_bar.pack(fill="x", padx=5, pady=5)
  392.  
  393.         tk.Label(self.top_bar, text="🔥 GOD MODE V4 - ULTIMATE ADMIN EDITION",
  394.                 font=("Segoe UI", 18, "bold")).pack(side="left")
  395.  
  396.         self.admin_indicator = tk.Label(self.top_bar, text="⚠️ NOT ADMIN",
  397.                                        font=("Segoe UI", 12, "bold"), fg="red")
  398.         self.admin_indicator.pack(side="right", padx=10)
  399.  
  400.         self.theme_btn = tk.Button(self.top_bar, text="🌙 Dark", command=self.toggle_theme, width=8)
  401.         self.theme_btn.pack(side="right", padx=5)
  402.  
  403.         # === ADMIN CONTROL PANEL ===
  404.         self.admin_panel = tk.Frame(self.root)
  405.         self.admin_panel.pack(fill="x", padx=5, pady=5)
  406.  
  407.         tk.Label(self.admin_panel, text="🛡️ ADMINISTRATOR CONTROL",
  408.                 font=("Segoe UI", 12, "bold")).pack(side="left", padx=10)
  409.  
  410.         self.admin_btn = tk.Button(self.admin_panel, text="🔓 Run as Admin",
  411.                                   command=self.run_as_admin, bg="#ff6600", fg="white", font=("Segoe UI", 10, "bold"))
  412.         self.admin_btn.pack(side="left", padx=5)
  413.  
  414.         self.refresh_admin_btn = tk.Button(self.admin_panel, text="🔄 Check Status",
  415.                                           command=self.check_admin_privileges, bg="#007acc", fg="white")
  416.         self.refresh_admin_btn.pack(side="left", padx=5)
  417.  
  418.         # === TOOLBAR WITH CATEGORIES ===
  419.         self.toolbar = tk.Frame(self.root)
  420.         self.toolbar.pack(fill="x", padx=10, pady=5)
  421.  
  422.         tk.Label(self.toolbar, text="📋 Templates:", font=("Segoe UI", 10)).pack(side="left")
  423.         self.category_var = tk.StringVar()
  424.         self.category_var.set("🖥️ System")
  425.         self.category_menu = ttk.Combobox(self.toolbar, textvariable=self.category_var,
  426.                                          values=list(self.templates.keys()), width=15, state="readonly")
  427.         self.category_menu.pack(side="left", padx=5)
  428.         self.category_menu.bind("<<ComboboxSelected>>", self.load_template_commands)
  429.  
  430.         self.load_template_btn = tk.Button(self.toolbar, text="📥 Load Templates",
  431.                                           command=self.load_template_commands, bg="#28a745", fg="white")
  432.         self.load_template_btn.pack(side="left", padx=5)
  433.  
  434.         quick_actions = [
  435.             ("🚀 Elevate CMD", self.elevate_cmd),
  436.             ("📊 System Monitor", self.open_system_monitor),
  437.             ("🌐 Network Tools", self.open_network_tools),
  438.             ("📜 Event Viewer", self.open_event_viewer),
  439.         ]
  440.  
  441.         for text, cmd in quick_actions:
  442.             btn = tk.Button(self.toolbar, text=text, command=cmd, width=12)
  443.             btn.pack(side="left", padx=2)
  444.  
  445.         tk.Button(self.toolbar, text="💾 Export Log", command=self.save_log, width=10).pack(side="right", padx=2)
  446.         tk.Button(self.toolbar, text="🗑️ Clear", command=self.clear_output, width=8).pack(side="right", padx=2)
  447.         tk.Button(self.toolbar, text="📋 Copy", command=self.copy_output, width=8).pack(side="right", padx=2)
  448.  
  449.         # === MAIN CONTENT AREA ===
  450.         self.paned = tk.PanedWindow(self.root, orient=tk.HORIZONTAL, bg="gray")
  451.         self.paned.pack(fill="both", expand=True, padx=5, pady=5)
  452.  
  453.         # LEFT PANEL - Command Library
  454.         self.left_frame = tk.Frame(self.paned)
  455.         self.paned.add(self.left_frame, width=350)
  456.  
  457.         # 🔍 Search Box - ✅ FIXED: Added textvariable
  458.         search_frame = tk.Frame(self.left_frame)
  459.         search_frame.pack(fill="x", padx=5, pady=5)
  460.         tk.Label(search_frame, text="🔍 Search:").pack(side="left")
  461.        
  462.         self.search_var = tk.StringVar()
  463.         # ✅ Compatible trace for all tkinter versions
  464.         try:
  465.             self.search_var.trace_add("write", self.filter_commands)
  466.         except AttributeError:
  467.             self.search_var.trace("w", self.filter_commands)
  468.        
  469.         # ✅ KEY FIX: Connect Entry to StringVar
  470.         self.search_entry = tk.Entry(search_frame, textvariable=self.search_var)
  471.         self.search_entry.pack(side="left", fill="x", expand=True, padx=5)
  472.  
  473.         # Command Listbox
  474.         self.listbox_frame = tk.Frame(self.left_frame)
  475.         self.listbox_frame.pack(fill="both", expand=True, padx=5, pady=5)
  476.  
  477.         self.listbox = tk.Listbox(self.listbox_frame, font=("Consolas", 9), exportselection=False)
  478.         self.listbox.pack(side="left", fill="both", expand=True)
  479.        
  480.         listbox_scroll = ttk.Scrollbar(self.listbox_frame, orient="vertical", command=self.listbox.yview)
  481.         listbox_scroll.pack(side="right", fill="y")
  482.         self.listbox.configure(yscrollcommand=listbox_scroll.set)
  483.         self.listbox.bind("<Double-Button-1>", self.load_to_input)
  484.         self.listbox.bind("<<ListboxSelect>>", self.on_listbox_select)
  485.  
  486.         # Listbox Controls
  487.         lb_controls = tk.Frame(self.left_frame)
  488.         lb_controls.pack(fill="x", padx=5, pady=5)
  489.         tk.Button(lb_controls, text="📂 Load List", command=self.load_file, width=10).pack(side="left", expand=True)
  490.         tk.Button(lb_controls, text="💾 Save List", command=self.save_file, width=10).pack(side="left", expand=True)
  491.         tk.Button(lb_controls, text="➕ Add", command=self.add_current_command, width=8).pack(side="left", expand=True)
  492.  
  493.         self.cmd_info_label = tk.Label(self.left_frame, text="Commands: 0",
  494.                                        font=("Segoe UI", 9), anchor="w")
  495.         self.cmd_info_label.pack(fill="x", padx=5, pady=2)
  496.  
  497.         # RIGHT PANEL - Execution Area
  498.         self.right_frame = tk.Frame(self.paned)
  499.         self.paned.add(self.right_frame)
  500.  
  501.         # Command Input Section
  502.         input_frame = tk.Frame(self.right_frame)
  503.         input_frame.pack(fill="x", padx=5, pady=5)
  504.  
  505.         tk.Label(input_frame, text="⌨️ Command:", font=("Segoe UI", 11, "bold")).pack(side="left")
  506.        
  507.         self.cmd_entry = tk.Entry(input_frame, font=("Consolas", 11))
  508.         self.cmd_entry.pack(side="left", fill="x", expand=True, padx=10)
  509.         self.cmd_entry.bind("<Return>", lambda e: self.run_command_thread())
  510.         self.cmd_entry.bind("<Up>", self.history_up)
  511.         self.cmd_entry.bind("<Down>", self.history_down)
  512.  
  513.         # Run Buttons
  514.         btn_frame = tk.Frame(input_frame)
  515.         btn_frame.pack(side="left", padx=5)
  516.  
  517.         self.run_btn = tk.Button(btn_frame, text="▶ RUN", command=self.run_command_thread,
  518.                                 bg="#28a745", fg="white", font=("Segoe UI", 10, "bold"), width=8)
  519.         self.run_btn.pack(side="left", padx=2)
  520.  
  521.         self.admin_run_btn = tk.Button(btn_frame, text="🔓 RUN AS ADMIN",
  522.                                        command=self.run_as_admin_command,
  523.                                        bg="#ff6600", fg="white", font=("Segoe UI", 10, "bold"), width=12)
  524.         self.admin_run_btn.pack(side="left", padx=2)
  525.  
  526.         self.stop_btn = tk.Button(btn_frame, text="⏹ STOP", command=self.stop_command,
  527.                                  bg="#dc3545", fg="white", width=6, state="disabled")
  528.         self.stop_btn.pack(side="left", padx=2)
  529.  
  530.         # Options Checkboxes
  531.         options_frame = tk.Frame(self.right_frame)
  532.         options_frame.pack(fill="x", padx=5, pady=3)
  533.  
  534.         self.run_as_admin_var = tk.BooleanVar(value=False)
  535.         tk.Checkbutton(options_frame, text="🔓 Always Run as Admin",
  536.                       variable=self.run_as_admin_var).pack(side="left", padx=5)
  537.  
  538.         self.show_output_var = tk.BooleanVar(value=True)
  539.         tk.Checkbutton(options_frame, text="📺 Show Output",
  540.                       variable=self.show_output_var).pack(side="left", padx=5)
  541.  
  542.         self.log_history_var = tk.BooleanVar(value=True)
  543.         tk.Checkbutton(options_frame, text="📜 Log History",
  544.                       variable=self.log_history_var).pack(side="left", padx=5)
  545.  
  546.         # 📁 WORKING DIRECTORY SECTION
  547.         dir_frame = tk.Frame(self.right_frame)
  548.         dir_frame.pack(fill="x", padx=5, pady=5)
  549.  
  550.         tk.Label(dir_frame, text="📂 Work Dir:", font=("Segoe UI", 9, "bold")).pack(side="left")
  551.        
  552.         self.dir_entry = tk.Entry(dir_frame, textvariable=self.work_dir, font=("Consolas", 9), width=55)
  553.         self.dir_entry.pack(side="left", fill="x", expand=True, padx=5)
  554.        
  555.         tk.Button(dir_frame, text="🗂️ Browse", command=self.browse_directory, width=8).pack(side="left", padx=2)
  556.         tk.Button(dir_frame, text="🔄 Reset", command=self.reset_directory, width=8).pack(side="left", padx=2)
  557.         tk.Button(dir_frame, text="▶ Apply", command=self.apply_directory, width=8, bg="#007acc", fg="white").pack(side="left", padx=2)
  558.  
  559.         # Output Area
  560.         output_frame = tk.Frame(self.right_frame)
  561.         output_frame.pack(fill="both", expand=True, padx=5, pady=5)
  562.  
  563.         tk.Label(output_frame, text="📊 Output Console:", font=("Segoe UI", 11, "bold")).pack(anchor="w")
  564.  
  565.         self.output = scrolledtext.ScrolledText(output_frame, font=("Consolas", 10), state='disabled')
  566.         self.output.pack(fill="both", expand=True)
  567.  
  568.         self.output.tag_config("error", foreground="red", font=("Consolas", 10, "bold"))
  569.         self.output.tag_config("success", foreground="green", font=("Consolas", 10))
  570.         self.output.tag_config("warning", foreground="orange", font=("Consolas", 10, "bold"))
  571.         self.output.tag_config("info", foreground="blue", font=("Consolas", 10))
  572.         self.output.tag_config("command", foreground="cyan", font=("Consolas", 10, "bold"))
  573.  
  574.         self.output_menu = tk.Menu(self.root, tearoff=0)
  575.         self.output_menu.add_command(label="📋 Copy All", command=self.copy_output)
  576.         self.output_menu.add_command(label="🗑️ Clear", command=self.clear_output)
  577.         self.output_menu.add_command(label="💾 Save Log", command=self.save_log)
  578.         self.output.bind("<Button-3>", self.show_output_menu)
  579.  
  580.         # === STATUS BAR ===
  581.         self.status_bar = tk.Frame(self.root)
  582.         self.status_bar.pack(fill="x", side="bottom")
  583.  
  584.         self.status_left = tk.Label(self.status_bar, text="Ready", bd=1, relief=tk.SUNKEN, anchor="w")
  585.         self.status_left.pack(side="left", fill="x", expand=True)
  586.  
  587.         self.status_middle = tk.Label(self.status_bar, text="| CPU: --% | RAM: --%", bd=1, relief=tk.SUNKEN)
  588.         self.status_middle.pack(side="left")
  589.  
  590.         self.status_right = tk.Label(self.status_bar, text="| V4.0 Ultimate", bd=1, relief=tk.SUNKEN, anchor="e")
  591.         self.status_right.pack(side="right")
  592.  
  593.         if PSUTIL_AVAILABLE:
  594.             self.update_system_stats()
  595.  
  596.         self.entry_menu = tk.Menu(self.root, tearoff=0)
  597.         self.entry_menu.add_command(label="Paste", command=self.paste_command)
  598.         self.cmd_entry.bind("<Button-3>", self.show_entry_menu)
  599.  
  600.     def apply_theme(self):
  601.         colors = self.dark_theme if self.current_theme == "dark" else self.light_theme
  602.        
  603.         self.root.configure(bg=colors["bg"])
  604.         self.top_bar.configure(bg=colors["header_bg"])
  605.         self.admin_panel.configure(bg=colors["header_bg"])
  606.         self.toolbar.configure(bg=colors["bg"])
  607.         self.left_frame.configure(bg=colors["bg"])
  608.         self.right_frame.configure(bg=colors["bg"])
  609.         self.paned.configure(bg=colors["bg"])
  610.         self.status_bar.configure(bg=colors["header_bg"])
  611.        
  612.         self.theme_btn.configure(bg=colors["btn_bg"], fg=colors["btn_fg"])
  613.         self.cmd_entry.configure(bg=colors["input_bg"], fg=colors["input_fg"],
  614.                                 insertbackground=colors["fg"])
  615.         self.output.configure(bg=colors["input_bg"], fg=colors["fg"])
  616.         self.listbox.configure(bg=colors["input_bg"], fg=colors["fg"])
  617.         self.search_entry.configure(bg=colors["input_bg"], fg=colors["input_fg"])
  618.         self.dir_entry.configure(bg=colors["input_bg"], fg=colors["input_fg"],
  619.                                 insertbackground=colors["fg"])
  620.        
  621.         self.status_left.configure(bg=colors["header_bg"], fg=colors["fg"])
  622.         self.status_middle.configure(bg=colors["header_bg"], fg=colors["fg"])
  623.         self.status_right.configure(bg=colors["header_bg"], fg=colors["fg"])
  624.         self.cmd_info_label.configure(bg=colors["bg"], fg=colors["fg"])
  625.  
  626.         for widget in self.toolbar.winfo_children():
  627.             if isinstance(widget, tk.Button):
  628.                 widget.configure(bg=colors["btn_bg"], fg=colors["btn_fg"])
  629.        
  630.         for widget in self.left_frame.winfo_children():
  631.             if isinstance(widget, tk.Frame):
  632.                 for child in widget.winfo_children():
  633.                     if isinstance(child, tk.Button):
  634.                         child.configure(bg=colors["btn_bg"], fg=colors["btn_fg"])
  635.        
  636.         # Directory frame buttons styling
  637.         dir_frame = None
  638.         for frame in self.right_frame.winfo_children():
  639.             if isinstance(frame, tk.Frame) and len(frame.winfo_children()) > 0:
  640.                 if any("Browse" in str(w.cget("text")) for w in frame.winfo_children() if isinstance(w, tk.Button)):
  641.                     dir_frame = frame
  642.                     break
  643.         if dir_frame:
  644.             dir_frame.configure(bg=colors["bg"])
  645.             for widget in dir_frame.winfo_children():
  646.                 if isinstance(widget, tk.Button):
  647.                     widget.configure(bg=colors["btn_bg"], fg=colors["btn_fg"])
  648.  
  649.     def toggle_theme(self):
  650.         self.current_theme = "light" if self.current_theme == "dark" else "dark"
  651.         self.theme_btn.config(text="🌞 Light" if self.current_theme == "dark" else "🌙 Dark")
  652.         self.apply_theme()
  653.  
  654.     def check_admin_privileges(self):
  655.         try:
  656.             if sys.platform == 'win32':
  657.                 self.is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0
  658.             else:
  659.                 self.is_admin = os.geteuid() == 0
  660.            
  661.             if self.is_admin:
  662.                 self.admin_indicator.config(text="✅ ADMIN", fg="green")
  663.                 self.admin_btn.config(text="✅ Running as Admin", state="disabled", bg="green")
  664.                 self.log_message("✅ Running with Administrator privileges", "success")
  665.             else:
  666.                 self.admin_indicator.config(text="⚠️ NOT ADMIN", fg="red")
  667.                 self.admin_btn.config(text="🔓 Run as Admin", state="normal", bg="#ff6600")
  668.                 self.log_message("⚠️ Not running as Administrator. Some commands may fail.", "warning")
  669.         except Exception as e:
  670.             self.admin_indicator.config(text="❓ Unknown", fg="orange")
  671.             self.log_message(f"❌ Admin check failed: {str(e)}", "error")
  672.  
  673.     def run_as_admin(self):
  674.         """Restart the script with administrator privileges"""
  675.         if sys.platform == 'win32':
  676.             try:
  677.                 ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable,
  678.                                                    " ".join([__file__] + sys.argv[1:]), None, 1)
  679.                 self.root.destroy()
  680.             except Exception as e:
  681.                 messagebox.showerror("Error", f"Failed to elevate: {str(e)}")
  682.         else:
  683.             messagebox.showinfo("Info", "Admin elevation only supported on Windows")
  684.  
  685.     def elevate_cmd(self):
  686.         """Open elevated Command Prompt"""
  687.         if sys.platform == 'win32':
  688.             try:
  689.                 subprocess.Popen('cmd.exe', shell=True)
  690.                 self.log_message("🚀 Command Prompt opened", "info")
  691.             except Exception as e:
  692.                 self.log_message(f"❌ Failed to open CMD: {str(e)}", "error")
  693.  
  694.     def open_system_monitor(self):
  695.         try:
  696.             subprocess.Popen('taskmgr.exe', shell=True)
  697.             self.log_message("📊 Task Manager opened", "info")
  698.         except Exception as e:
  699.             self.log_message(f"❌ Failed: {str(e)}", "error")
  700.  
  701.     def open_network_tools(self):
  702.         try:
  703.             subprocess.Popen('ncpa.cpl', shell=True)
  704.             self.log_message("🌐 Network Connections opened", "info")
  705.         except Exception as e:
  706.             self.log_message(f"❌ Failed: {str(e)}", "error")
  707.  
  708.     def open_event_viewer(self):
  709.         try:
  710.             subprocess.Popen('eventvwr.msc', shell=True)
  711.             self.log_message("📜 Event Viewer opened", "info")
  712.         except Exception as e:
  713.             self.log_message(f"❌ Failed: {str(e)}", "error")
  714.  
  715.     # ==================== 🛠️ HELPER METHODS ====================
  716.    
  717.     def _get_display_name(self, cmd):
  718.         """✅ Helper: Get friendly display name for any command"""
  719.         cmd_clean = cmd.strip().lower()
  720.        
  721.         # Search templates with flexible matching
  722.         for category in self.templates.values():
  723.             for name, actual_cmd in category:
  724.                 if actual_cmd.strip().lower() == cmd_clean:
  725.                     return name
  726.        
  727.         # Fallback: generate display name from command
  728.         clean_cmd = cmd.split('>>')[0].split('|')[0].strip()
  729.         parts = clean_cmd.split()
  730.        
  731.         if not parts:
  732.             return cmd[:40] + "..." if len(cmd) > 40 else cmd
  733.        
  734.         first_word = parts[0].lower().replace('"', '').replace("'", '')
  735.         if first_word in ['cmd', 'powershell', 'cmd.exe', 'powershell.exe'] and len(parts) > 1:
  736.             first_word = parts[1].replace('"', '').replace("'", '')
  737.        
  738.         display = cmd[:35] + "..." if len(cmd) > 35 else cmd
  739.         return display
  740.  
  741.     def load_template_commands(self, event=None):
  742.         """✅ Load commands with proper name/command mapping"""
  743.         category = self.category_var.get()
  744.         self.commands = []
  745.         self.listbox_commands = []
  746.         self.command_display_names = {}  # ✅ Reset mapping
  747.         self.listbox.delete(0, tk.END)
  748.        
  749.         if category in self.templates:
  750.             for name, cmd in self.templates[category]:
  751.                 self.commands.append(cmd)
  752.                 self.listbox_commands.append(cmd)
  753.                 self.command_display_names[cmd] = name  # ✅ Store for fast search
  754.                 self.listbox.insert(tk.END, name)
  755.        
  756.         self.update_command_count()
  757.         self.log_message(f"📥 Loaded {len(self.commands)} commands from {category}", "info")
  758.  
  759.     def filter_commands(self, *args):
  760.         """✅ FIXED: Filter works for both template AND custom commands"""
  761.         keyword = self.search_var.get().lower()
  762.         self.listbox.delete(0, tk.END)
  763.         self.listbox_commands = []
  764.        
  765.         for cmd in self.commands:
  766.             # ✅ Use stored display name or generate on fly
  767.             display_name = self.command_display_names.get(cmd, self._get_display_name(cmd))
  768.             if keyword in display_name.lower() or keyword in cmd.lower():
  769.                 self.listbox.insert(tk.END, display_name)
  770.                 self.listbox_commands.append(cmd)
  771.        
  772.         self.update_command_count()
  773.  
  774.     def load_file(self):
  775.         """✅ Load commands from file with proper display"""
  776.         path = filedialog.askopenfilename(filetypes=[("Text Files", "*.txt"), ("All Files", "*.*")])
  777.         if path:
  778.             try:
  779.                 with open(path, "r", encoding='utf-8') as f:
  780.                     loaded_commands = [line.strip() for line in f
  781.                                      if line.strip() and not line.strip().startswith('#')]
  782.                
  783.                 if not loaded_commands:
  784.                     messagebox.showinfo("Info", "No valid commands found in file")
  785.                     return
  786.                    
  787.                 self.commands = loaded_commands
  788.                 self.listbox_commands = loaded_commands[:]
  789.                
  790.                 self.listbox.delete(0, tk.END)
  791.                 for cmd in loaded_commands:
  792.                     display_name = self._get_display_name(cmd)
  793.                     self.command_display_names[cmd] = display_name  # ✅ Store mapping
  794.                     self.listbox.insert(tk.END, display_name)
  795.                
  796.                 self.update_command_count()
  797.                 self.log_message(f"✅ Loaded {len(self.commands)} commands from {os.path.basename(path)}", "success")
  798.                
  799.             except UnicodeDecodeError:
  800.                 try:
  801.                     with open(path, "r", encoding='latin-1') as f:
  802.                         loaded_commands = [line.strip() for line in f
  803.                                          if line.strip() and not line.strip().startswith('#')]
  804.                         self.commands = loaded_commands
  805.                         self.listbox_commands = loaded_commands[:]
  806.                         self.listbox.delete(0, tk.END)
  807.                         for cmd in loaded_commands:
  808.                             display_name = self._get_display_name(cmd)
  809.                             self.command_display_names[cmd] = display_name
  810.                             self.listbox.insert(tk.END, display_name)
  811.                         self.update_command_count()
  812.                         self.log_message(f"✅ Loaded {len(self.commands)} commands (latin-1 encoding)", "success")
  813.                 except Exception as e:
  814.                     messagebox.showerror("Encoding Error", f"Could not read file: {str(e)}")
  815.             except Exception as e:
  816.                 messagebox.showerror("Error", f"Failed to load file: {str(e)}")
  817.  
  818.     def add_current_command(self):
  819.         """✅ Add command with proper display name"""
  820.         cmd = self.cmd_entry.get().strip()
  821.         if cmd and cmd not in self.commands:
  822.             self.commands.append(cmd)
  823.             self.listbox_commands.append(cmd)
  824.             display_name = self._get_display_name(cmd)
  825.             self.command_display_names[cmd] = display_name  # ✅ Store for search
  826.             self.listbox.insert(tk.END, display_name)
  827.             self.update_command_count()
  828.             self.log_message("➕ Command added to list", "success")
  829.         elif cmd in self.commands:
  830.             self.log_message("⚠️ Command already in list", "warning")
  831.  
  832.     def on_listbox_select(self, event=None):
  833.         """Show command preview when selecting from listbox"""
  834.         selection = self.listbox.curselection()
  835.         if selection and self.listbox_commands:
  836.             idx = selection[0]
  837.             if idx < len(self.listbox_commands):
  838.                 cmd = self.listbox_commands[idx]
  839.                 self.status_left.config(text=f"Selected: {cmd[:60]}...")
  840.  
  841.     def update_command_count(self):
  842.         count = self.listbox.size()
  843.         self.cmd_info_label.config(text=f"Commands: {count}")
  844.  
  845.     def load_to_input(self, event=None):
  846.         """✅ Load actual command, not display name"""
  847.         selection = self.listbox.curselection()
  848.         if selection and self.listbox_commands:
  849.             idx = selection[0]
  850.             if idx < len(self.listbox_commands):
  851.                 cmd = self.listbox_commands[idx]
  852.                 self.cmd_entry.delete(0, tk.END)
  853.                 self.cmd_entry.insert(0, cmd)
  854.                 self.cmd_entry.focus()
  855.  
  856.     def save_file(self):
  857.         path = filedialog.asksaveasfilename(defaultextension=".txt",
  858.                                            filetypes=[("Text Files", "*.txt")])
  859.         if path:
  860.             try:
  861.                 with open(path, "w", encoding='utf-8') as f:
  862.                     for cmd in self.commands:
  863.                         f.write(cmd + "\n")
  864.                 self.log_message(f"💾 Saved {len(self.commands)} commands", "success")
  865.             except Exception as e:
  866.                 messagebox.showerror("Error", str(e))
  867.  
  868.     def save_log(self):
  869.         path = filedialog.asksaveasfilename(defaultextension=".log",
  870.                                            filetypes=[("Log Files", "*.log"), ("Text Files", "*.txt")])
  871.         if path:
  872.             try:
  873.                 with open(path, "w", encoding='utf-8') as f:
  874.                     f.write(self.output.get("1.0", tk.END))
  875.                 self.log_message(f"📜 Log saved to {os.path.basename(path)}", "success")
  876.             except Exception as e:
  877.                 messagebox.showerror("Error", str(e))
  878.  
  879.     def clear_output(self):
  880.         self.output.config(state='normal')
  881.         self.output.delete("1.0", tk.END)
  882.         self.output.config(state='disabled')
  883.         self.log_message("🧹 Output cleared", "info")
  884.  
  885.     def copy_output(self):
  886.         self.root.clipboard_clear()
  887.         self.root.clipboard_append(self.output.get("1.0", tk.END))
  888.         self.log_message("📋 Output copied to clipboard", "success")
  889.  
  890.     def paste_command(self):
  891.         try:
  892.             text = self.root.clipboard_get()
  893.             self.cmd_entry.insert(tk.END, text)
  894.         except:
  895.             pass
  896.  
  897.     def show_output_menu(self, event):
  898.         self.output_menu.post(event.x_root, event.y_root)
  899.  
  900.     def show_entry_menu(self, event):
  901.         self.entry_menu.post(event.x_root, event.y_root)
  902.  
  903.     def safety_check(self, cmd):
  904.         dangerous = ['format', 'fdisk', 'del /f /s', 'rm -rf', 'shutdown -r',
  905.                     'shutdown -s', 'diskpart', 'cipher /w']
  906.         for d in dangerous:
  907.             if d in cmd.lower():
  908.                 return messagebox.askyesno("⚠️ SECURITY WARNING",
  909.                     f"Dangerous command detected: '{d}'\n\nThis can PERMANENTLY damage your system!\n\nContinue?")
  910.         return True
  911.  
  912.     def log_message(self, msg, msg_type="info"):
  913.         timestamp = datetime.datetime.now().strftime("%H:%M:%S")
  914.         self.status_left.config(text=f"{msg}")
  915.        
  916.         if msg_type in ["error", "success", "warning", "info", "command"]:
  917.             self.output.config(state='normal')
  918.             self.output.insert(tk.END, f"[{timestamp}] {msg}\n", msg_type)
  919.             self.output.config(state='disabled')
  920.             self.output.see(tk.END)
  921.  
  922.     def update_system_stats(self):
  923.         """Update CPU and RAM usage in status bar"""
  924.         if PSUTIL_AVAILABLE:
  925.             try:
  926.                 cpu = psutil.cpu_percent(interval=1)
  927.                 ram = psutil.virtual_memory().percent
  928.                 self.status_middle.config(text=f"| CPU: {cpu}% | RAM: {ram}%")
  929.             except:
  930.                 pass
  931.         self.root.after(5000, self.update_system_stats)
  932.  
  933.     def history_up(self, event):
  934.         if self.history:
  935.             current = self.cmd_entry.get()
  936.             if current not in self.history:
  937.                 self.history.insert(0, current)
  938.             idx = self.history.index(current) + 1 if current in self.history else 0
  939.             if idx < len(self.history):
  940.                 self.cmd_entry.delete(0, tk.END)
  941.                 self.cmd_entry.insert(0, self.history[idx])
  942.  
  943.     def history_down(self, event):
  944.         if self.history:
  945.             current = self.cmd_entry.get()
  946.             if current in self.history:
  947.                 idx = self.history.index(current) - 1
  948.                 if idx >= 0:
  949.                     self.cmd_entry.delete(0, tk.END)
  950.                     self.cmd_entry.insert(0, self.history[idx])
  951.                 elif idx == -1:
  952.                     self.cmd_entry.delete(0, tk.END)
  953.  
  954.     # ==================== 📁 WORKING DIRECTORY METHODS ====================
  955.    
  956.     def browse_directory(self):
  957.         """🗂️ Open folder browser and set working directory"""
  958.         path = filedialog.askdirectory(title="Select Working Directory")
  959.         if path:
  960.             self.work_dir.set(path)
  961.             self.log_message(f"📂 Directory selected: {path}", "info")
  962.  
  963.     def reset_directory(self):
  964.         """🔄 Reset to default (current) directory"""
  965.         default_path = os.getcwd()
  966.         self.work_dir.set(default_path)
  967.         self.log_message(f"🔄 Directory reset to: {default_path}", "info")
  968.  
  969.     def apply_directory(self):
  970.         """▶ Validate and apply the working directory"""
  971.         path = self.work_dir.get().strip()
  972.         if path and os.path.isdir(path):
  973.             self.log_message(f"✅ Working directory set: {path}", "success")
  974.             return True
  975.         else:
  976.             self.log_message(f"❌ Invalid directory: {path}", "error")
  977.             messagebox.showerror("Invalid Path", f"Directory does not exist:\n{path}")
  978.             return False
  979.  
  980.     def get_working_directory(self):
  981.         """📁 Get validated working directory for command execution"""
  982.         path = self.work_dir.get().strip()
  983.         if path and os.path.isdir(path):
  984.             return path
  985.         return None  # Use default if invalid
  986.  
  987.     # ==================== COMMAND EXECUTION ====================
  988.  
  989.     def run_command_thread(self):
  990.         if self.is_running:
  991.             messagebox.showwarning("Warning", "A command is already running!")
  992.             return
  993.        
  994.         cmd = self.cmd_entry.get().strip()
  995.         if not cmd:
  996.             messagebox.showwarning("Warning", "Please enter a command!")
  997.             return
  998.        
  999.         if not self.safety_check(cmd):
  1000.             return
  1001.  
  1002.         self.is_running = True
  1003.         self.run_btn.config(state='disabled', text="⏳ Running...")
  1004.         self.stop_btn.config(state='normal')
  1005.        
  1006.         if self.log_history_var.get() and cmd not in self.history:
  1007.             self.history.insert(0, cmd)
  1008.             if len(self.history) > 100:
  1009.                 self.history.pop()
  1010.  
  1011.         run_as_admin = self.run_as_admin_var.get()
  1012.         thread = threading.Thread(target=self.execute_command, args=(cmd, run_as_admin))
  1013.         thread.daemon = True
  1014.         thread.start()
  1015.  
  1016.     def run_as_admin_command(self):
  1017.         """🔓 Run command with administrator privileges"""
  1018.         cmd = self.cmd_entry.get().strip()
  1019.         if not cmd:
  1020.             messagebox.showwarning("Warning", "Please enter a command!")
  1021.             return
  1022.        
  1023.         if not self.safety_check(cmd):
  1024.             return
  1025.  
  1026.         if sys.platform == 'win32':
  1027.             try:
  1028.                 # Get working directory for admin command
  1029.                 work_dir = self.get_working_directory()
  1030.                 if work_dir:
  1031.                     cmd = f'cd /d "{work_dir}" && {cmd}'
  1032.                
  1033.                 escaped_cmd = cmd.replace('"', '\\"')
  1034.                 ctypes.windll.shell32.ShellExecuteW(
  1035.                     None, "runas", "cmd.exe", f'/c "{escaped_cmd}"', None, 1
  1036.                 )
  1037.                 self.log_message(f"🔓 Command launched as Admin: {cmd}", "success")
  1038.             except Exception as e:
  1039.                 self.log_message(f"❌ Failed to run as admin: {str(e)}", "error")
  1040.         else:
  1041.             self.log_message("❌ Admin execution only supported on Windows", "error")
  1042.  
  1043.     def execute_command(self, cmd, run_as_admin=False):
  1044.         try:
  1045.             self.output.config(state='normal')
  1046.             timestamp = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
  1047.            
  1048.             # 📁 Get working directory
  1049.             work_dir = self.get_working_directory()
  1050.             dir_info = f"📁 Dir: {work_dir}\n" if work_dir else ""
  1051.            
  1052.             self.output.insert(tk.END, f"\n{'='*60}\n", "info")
  1053.             self.output.insert(tk.END, f"📅 [{timestamp}] ", "info")
  1054.             self.output.insert(tk.END, f"CMD: {cmd}\n", "command")
  1055.             if dir_info:
  1056.                 self.output.insert(tk.END, dir_info, "info")
  1057.             if run_as_admin:
  1058.                 self.output.insert(tk.END, f"🔓 Running as Administrator\n", "warning")
  1059.             self.output.insert(tk.END, f"{'='*60}\n\n", "info")
  1060.             self.output.config(state='disabled')
  1061.             self.output.see(tk.END)
  1062.  
  1063.             # 📁 Prepare subprocess with working directory
  1064.             subprocess_kwargs = {
  1065.                 'shell': True,
  1066.                 'stdout': subprocess.PIPE,
  1067.                 'stderr': subprocess.PIPE,
  1068.                 'text': True,
  1069.                 'encoding': 'utf-8',
  1070.                 'errors': 'replace'
  1071.             }
  1072.            
  1073.             # 📁 Add cwd if valid directory specified
  1074.             if work_dir:
  1075.                 subprocess_kwargs['cwd'] = work_dir
  1076.  
  1077.             self.process = subprocess.Popen(cmd, **subprocess_kwargs)
  1078.             stdout, stderr = self.process.communicate(timeout=120)
  1079.            
  1080.             self.root.after(0, self.update_output, stdout, stderr, self.process.returncode)
  1081.            
  1082.         except subprocess.TimeoutExpired:
  1083.             if self.process and self.process.poll() is None:
  1084.                 self.process.kill()
  1085.             self.root.after(0, self.update_output, "", "⏱️ Command timed out (120s)", -1)
  1086.         except FileNotFoundError as e:
  1087.             self.root.after(0, self.update_output, "", f"❌ Directory not found: {work_dir}\n{str(e)}", -1)
  1088.         except Exception as e:
  1089.             self.root.after(0, self.update_output, "", str(e), -1)
  1090.         finally:
  1091.             self.process = None
  1092.             self.root.after(0, self.reset_run_btn)
  1093.  
  1094.     def update_output(self, stdout, stderr, returncode):
  1095.         self.output.config(state='normal')
  1096.        
  1097.         if stdout:
  1098.             self.output.insert(tk.END, f"✅ OUTPUT:\n{stdout}\n", "success")
  1099.         if stderr:
  1100.             self.output.insert(tk.END, f"❌ ERROR:\n{stderr}\n", "error")
  1101.        
  1102.         status = "Success" if returncode == 0 else f"Failed (Code: {returncode})"
  1103.         status_tag = "success" if returncode == 0 else "error"
  1104.         self.output.insert(tk.END, f"🏁 Status: {status}\n", status_tag)
  1105.         self.output.insert(tk.END, f"{'='*60}\n", "info")
  1106.        
  1107.         self.output.see(tk.END)
  1108.         self.output.config(state='disabled')
  1109.  
  1110.     def reset_run_btn(self):
  1111.         self.is_running = False
  1112.         self.run_btn.config(state='normal', text="▶ RUN")
  1113.         self.stop_btn.config(state='disabled')
  1114.  
  1115.     def stop_command(self):
  1116.         """⏹ Stop running command"""
  1117.         if self.process and self.process.poll() is None:
  1118.             try:
  1119.                 self.process.kill()
  1120.                 self.log_message("⏹ Command stopped", "warning")
  1121.             except:
  1122.                 pass
  1123.         self.is_running = False
  1124.         self.reset_run_btn()
  1125.  
  1126.  
  1127. if __name__ == "__main__":
  1128.     root = tk.Tk()
  1129.    
  1130.     try:
  1131.         if os.path.exists('COMMANDS/icon.ico'):
  1132.             root.iconbitmap('COMMANDS/icon.ico')
  1133.     except:
  1134.         pass
  1135.    
  1136.     app = GodModeUltimate(root)
  1137.     root.mainloop()
  1138.  
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Tadoluk
    35 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
  • User was banned
  • Irilimuh
    15 days
    # CSS 0.45 KB | 0 0
    1. ⭐ Changelly Profit Exploit Documentation ⭐
    2.  
    3. https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=ryxjwerknp
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment