From c61fab4dc124e65289cf3c34b1cf428d7d49ca24 Mon Sep 17 00:00:00 2001 From: "Mariusz B. / mgeeky" Date: Sat, 23 Oct 2021 12:30:53 +0200 Subject: [PATCH] fix --- windows/findSymbols.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/windows/findSymbols.py b/windows/findSymbols.py index f7d12c2..c3591e6 100644 --- a/windows/findSymbols.py +++ b/windows/findSymbols.py @@ -245,14 +245,17 @@ def processDir(args, regexes, path, results, uniqueSymbols, filesProcessed, symb filePaths = [] for file in glob.glob(os.path.join(path, '**'), recursive=args.recurse): - if os.path.isfile(file): - looks_like_pe = False - with open(file, 'rb') as f: - mz = f.read(2) - if len(mz) == 2: - looks_like_pe = (mz[0] == ord('M') and mz[1] == ord('Z')) or (mz[1] == ord('M') and mz[0] == ord('Z')) + try: + if os.path.isfile(file): + looks_like_pe = False + with open(file, 'rb') as f: + mz = f.read(2) + if len(mz) == 2: + looks_like_pe = (mz[0] == ord('M') and mz[1] == ord('Z')) or (mz[1] == ord('M') and mz[0] == ord('Z')) - if looks_like_pe: filePaths.append(file) + if looks_like_pe: filePaths.append(file) + except: + continue cpu_count = multiprocessing.cpu_count()