From cd1a24290e4e663b7e0cc86f13d6bcaf59c5bb58 Mon Sep 17 00:00:00 2001 From: 87owo <85057800+87owo@users.noreply.github.com> Date: Tue, 7 Oct 2025 23:08:14 +0800 Subject: [PATCH] Add files via upload --- PYAS_Engine.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PYAS_Engine.py b/PYAS_Engine.py index d33a20c..15d996c 100644 --- a/PYAS_Engine.py +++ b/PYAS_Engine.py @@ -186,6 +186,8 @@ class model_scanner: def extract_sections(self, file_path): match_data = {} + if not file_path or not os.path.isfile(file_path): + return match_data try: with pefile.PE(file_path, fast_load=True) as pe: for section in pe.sections: @@ -196,6 +198,8 @@ class model_scanner: with open(file_path, 'rb') as f: content = f.read() ext = os.path.splitext(file_path)[-1].lower() - if ext in self.suffix or self.is_text_file(content): + if ext in self.suffix and self.is_text_file(content): match_data[ext] = content + except Exception: + pass return match_data