From 696ac22f7715e14edcd171e821bb582e9574a79d Mon Sep 17 00:00:00 2001 From: 87owo <85057800+87owo@users.noreply.github.com> Date: Sat, 27 Dec 2025 15:17:13 +0800 Subject: [PATCH] Add files via upload --- PYAS_Engine.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/PYAS_Engine.py b/PYAS_Engine.py index 0313ddb..9e1edb1 100644 --- a/PYAS_Engine.py +++ b/PYAS_Engine.py @@ -195,13 +195,14 @@ class model_scanner: match_data = {} fpath_str = str(file_path) ext = os.path.splitext(fpath_str)[-1].lower() - try: - with pefile.PE(fpath_str, fast_load=True) as pe: - for section in pe.sections: - name = section.Name.rstrip(b'\x00').decode('latin1', errors='ignore').lower() - data = section.get_data() - if data: - match_data[name] = data - except Exception: - pass + if ext in self.suffix: + try: + with pefile.PE(fpath_str, fast_load=True) as pe: + for section in pe.sections: + name = section.Name.rstrip(b'\x00').decode('latin1', errors='ignore').lower() + data = section.get_data() + if data: + match_data[name] = data + except Exception: + pass return match_data