From f5abaf06de7374677fcfb3d5f433e6bc184f15cf Mon Sep 17 00:00:00 2001 From: 87owo <85057800+87owo@users.noreply.github.com> Date: Wed, 8 Apr 2026 17:57:14 +0800 Subject: [PATCH] Add files via upload --- PYAS.py | 4 +++- PYAS_Engine.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/PYAS.py b/PYAS.py index 7002f06..11d86c3 100644 --- a/PYAS.py +++ b/PYAS.py @@ -479,7 +479,9 @@ class MainWindow_Controller(QMainWindow): self.pyas_config[name] = bool(checked) if name == "sensitive_switch": if checked: - if self.send_message("增強模式可能會誤報檔案,您確定要啟用嗎?", "quest", True): + if not self.isVisible(): + self.save_config(self.file_config, self.pyas_config) + elif self.send_message("增強模式可能會誤報檔案,您確定要啟用嗎?", "quest", True): self.save_config(self.file_config, self.pyas_config) else: self.pyas_config[name] = False diff --git a/PYAS_Engine.py b/PYAS_Engine.py index 3aa6a7e..693eae1 100644 --- a/PYAS_Engine.py +++ b/PYAS_Engine.py @@ -538,10 +538,12 @@ class pe_scanner: pe = None try: fsize = os.path.getsize(file_path) - if fsize == 0 or fsize > 268435456: + if fsize == 0 or fsize > 512 * 1024 * 1024: return None + with open(file_path, "rb") as f: file_bytes = f.read() + pe = pefile.PE(data=file_bytes, fast_load=True) fts['TrustSigned'] = 1 if self.signer.sign_verify(file_path) else 0 fh = pe.FILE_HEADER