File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222import os
2323import sys
2424import time
25+ import errno
2526import subprocess
2627try :
2728 from modules .common_utils import get_dir_path , hold_console_for_input
@@ -48,6 +49,7 @@ def display_banner():
4849 print (" /____/_/\n " )
4950 print ("=" * 75 )
5051
52+
5153def should_reinitialize_db ():
5254 """
5355 Checks if the required .dll files exist in the db directory and if their file sizes are valid.
@@ -181,10 +183,26 @@ def main():
181183
182184 try :
183185 subprocess .run (command , check = True )
186+ except OSError as e :
187+ winerror = getattr (e , "winerror" , None )
188+ if e .errno == errno .EPERM or winerror == 225 :
189+ print ("\n [!] It looks like a security program is preventing this application from running." )
190+ print ("\n [*] To fix this, please try the following steps:" )
191+ print (" 1. Reinstall ShadowCrypt." )
192+ print (" 2. Add the installation directory (e.g., 'C:\\ Program Files (x86)\\ ShadowCrypt') to your antivirus or security software's exclusion list." )
193+ print (" 3. Restart your computer and try again.\n \n Exiting...\n " )
194+ else :
195+ print (f"\n [!] OS Error occurred: { e } " )
196+ hold_console_for_input ()
197+ sys .exit (1 )
184198 except subprocess .CalledProcessError as e :
185199 sys .exit (1 )
186200 except (KeyboardInterrupt , EOFError ):
187201 sys .exit (1 )
202+ except Exception as e :
203+ print (f"\n [!] An unexpected error occurred: { e } " )
204+ hold_console_for_input ()
205+ sys .exit (1 )
188206
189207 return module
190208
You can’t perform that action at this time.
0 commit comments