Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ed8cc9380 | ||
|
|
142e9d1028 | ||
|
|
c96c30ff9a | ||
|
|
337f1cc100 | ||
|
|
c3cb89dbea | ||
|
|
445bd1f668 | ||
|
|
1bded908c1 |
No files matched your search
@@ -5,7 +5,7 @@
|
||||
|
||||
"Detect": ["Pefile/General", "Script/General"],
|
||||
|
||||
"Pixels": [224, 224],
|
||||
"Resize": [224, 224, 1, "nearest"],
|
||||
|
||||
"Values": 90
|
||||
}
|
||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
import os, gc, sys, time, json
|
||||
import ctypes, ctypes.wintypes
|
||||
import msvcrt, pyperclip
|
||||
import requests, msvcrt, pyperclip
|
||||
from PYAS_Engine import YRScan, DLScan
|
||||
from PYAS_Suffixes import file_types
|
||||
from PYAS_Language import translate_dict
|
||||
@@ -67,7 +67,7 @@ class MainWindow_Controller(QMainWindow): # 初始化主程式
|
||||
|
||||
def init_config_vars(self): # 初始化變數
|
||||
self.pyae_version = "AI Engine"
|
||||
self.pyas_version = "3.2.7"
|
||||
self.pyas_version = "3.2.8"
|
||||
self.mbr_value = None
|
||||
self.track_proc = None
|
||||
self.first_startup = 1
|
||||
@@ -305,7 +305,6 @@ class MainWindow_Controller(QMainWindow): # 初始化主程式
|
||||
self.ui.Virus_Scan_title.setText(self.trans("病毒掃描"))
|
||||
self.ui.Virus_Scan_text.setText(self.trans("請選擇掃描方式"))
|
||||
self.ui.Virus_Scan_choose_Button.setText(self.trans("病毒掃描"))
|
||||
self.ui.Virus_Scan_choose_Button.setStyleSheet(self.theme["button_on"])
|
||||
self.ui.File_Scan_Button.setText(self.trans("檔案掃描"))
|
||||
self.ui.Path_Scan_Button.setText(self.trans("路徑掃描"))
|
||||
self.ui.Disk_Scan_Button.setText(self.trans("全盤掃描"))
|
||||
@@ -331,15 +330,10 @@ class MainWindow_Controller(QMainWindow): # 初始化主程式
|
||||
self.ui.State_log.setText(self.trans("日誌:"))
|
||||
self.ui.More_Tools_Back_Button.setText(self.trans("工具>"))
|
||||
self.ui.System_Process_Manage_Button.setText(self.trans("系統進程管理"))
|
||||
self.ui.System_Process_Manage_Button.setStyleSheet(self.theme["button_off"])
|
||||
self.ui.Repair_System_Files_Button.setText(self.trans("系統檔案修復"))
|
||||
self.ui.Repair_System_Files_Button.setStyleSheet(self.theme["button_off"])
|
||||
self.ui.Clean_System_Files_Button.setText(self.trans("系統垃圾清理"))
|
||||
self.ui.Clean_System_Files_Button.setStyleSheet(self.theme["button_off"])
|
||||
self.ui.Window_Block_Button.setText(self.trans("軟體彈窗攔截"))
|
||||
self.ui.Window_Block_Button.setStyleSheet(self.theme["button_off"])
|
||||
self.ui.Repair_System_Network_Button.setText(self.trans("系統網路修復"))
|
||||
self.ui.Repair_System_Network_Button.setStyleSheet(self.theme["button_off"])
|
||||
self.ui.About_Back.setText(self.trans("返回"))
|
||||
self.ui.PYAS_Version.setText(self.trans(f"PYAS Security V{self.pyas_version} ({self.pyae_version})"))
|
||||
self.ui.GUI_Made_title.setText(self.trans("介面製作:"))
|
||||
@@ -372,7 +366,6 @@ class MainWindow_Controller(QMainWindow): # 初始化主程式
|
||||
self.ui.Language_title.setText(self.trans("顯示語言"))
|
||||
self.ui.Language_illustrate.setText(self.trans("請選擇語言"))
|
||||
self.ui.License_terms_title.setText(self.trans("許可條款:"))
|
||||
self.ui.Virus_Scan_choose_widget.setStyleSheet(self.theme["button_off"])
|
||||
|
||||
def init_config_color(self):
|
||||
self.config_theme = {
|
||||
@@ -573,6 +566,7 @@ class MainWindow_Controller(QMainWindow): # 初始化主程式
|
||||
Thread(target=self.protect_proc_thread, daemon=True).start()
|
||||
self.ui.Protection_switch_Button.setText(self.trans("已開啟"))
|
||||
self.ui.Protection_switch_Button.setStyleSheet(self.theme["button_on"])
|
||||
self.init_config_write(self.config_json)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
@@ -587,6 +581,7 @@ class MainWindow_Controller(QMainWindow): # 初始化主程式
|
||||
Thread(target=self.protect_file_thread, daemon=True).start()
|
||||
self.ui.Protection_switch_Button_2.setText(self.trans("已開啟"))
|
||||
self.ui.Protection_switch_Button_2.setStyleSheet(self.theme["button_on"])
|
||||
self.init_config_write(self.config_json)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
@@ -602,6 +597,7 @@ class MainWindow_Controller(QMainWindow): # 初始化主程式
|
||||
Thread(target=self.protect_reg_thread, daemon=True).start()
|
||||
self.ui.Protection_switch_Button_3.setText(self.trans("已開啟"))
|
||||
self.ui.Protection_switch_Button_3.setStyleSheet(self.theme["button_on"])
|
||||
self.init_config_write(self.config_json)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
@@ -646,6 +642,7 @@ class MainWindow_Controller(QMainWindow): # 初始化主程式
|
||||
Thread(target=self.protect_net_thread, daemon=True).start()
|
||||
self.ui.Protection_switch_Button_5.setText(self.trans("已開啟"))
|
||||
self.ui.Protection_switch_Button_5.setStyleSheet(self.theme["button_on"])
|
||||
self.init_config_write(self.config_json)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
@@ -658,6 +655,7 @@ class MainWindow_Controller(QMainWindow): # 初始化主程式
|
||||
self.config_json["sensitivity"] = 1
|
||||
self.ui.high_sensitivity_switch_Button.setText(self.trans("已開啟"))
|
||||
self.ui.high_sensitivity_switch_Button.setStyleSheet(self.theme["button_on"])
|
||||
self.init_config_write(self.config_json)
|
||||
|
||||
def extension_kit(self): # 初始化擴展引擎
|
||||
if self.ui.extension_kit_switch_Button.text() == self.trans("已開啟"):
|
||||
@@ -668,6 +666,7 @@ class MainWindow_Controller(QMainWindow): # 初始化主程式
|
||||
self.config_json["extend_mode"] = 1
|
||||
self.ui.extension_kit_switch_Button.setText(self.trans("已開啟"))
|
||||
self.ui.extension_kit_switch_Button.setStyleSheet(self.theme["button_on"])
|
||||
self.init_config_write(self.config_json)
|
||||
|
||||
def gc_collect_init(self): # 初始化程式回收
|
||||
try:
|
||||
|
||||
+17
-6
@@ -38,6 +38,10 @@ class YRScan:
|
||||
class DLScan:
|
||||
def __init__(self):
|
||||
self.models = {}
|
||||
self.valid_interpolations = {"none": Image.Resampling.NEAREST,
|
||||
"box": Image.Resampling.BOX, "bilinear": Image.Resampling.BILINEAR,
|
||||
"hamming": Image.Resampling.HAMMING, "bicubic": Image.Resampling.BICUBIC,
|
||||
"lanczos": Image.Resampling.LANCZOS, "nearest": Image.Resampling.NEAREST}
|
||||
self.shells = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!o',
|
||||
'cry', 'test', 'ace', 'yg', 'obr', 'tvm', 'dec', 'enc', 'b1_', 'base',
|
||||
'bss', 'clr_uef', 'cursors', 'trs_age', 'engine', 'enigma', 'protect',
|
||||
@@ -58,8 +62,8 @@ class DLScan:
|
||||
self.models[file_path] = onnxruntime.InferenceSession(file_path)
|
||||
self.labels = self.class_names['Labels']
|
||||
self.detect = self.class_names['Detect']
|
||||
self.pixels = self.class_names['Pixels']
|
||||
self.values = self.class_names['Values']
|
||||
self.resize = self.class_names['Resize']
|
||||
self.suffix = self.class_names['Suffix']
|
||||
except Exception as e:
|
||||
pass
|
||||
@@ -67,7 +71,7 @@ class DLScan:
|
||||
def dl_scan(self, file_data):
|
||||
try:
|
||||
label_similarities = {label: [] for label in self.labels}
|
||||
image_data = self.preprocess_image(file_data, tuple(self.pixels))
|
||||
image_data = self.preprocess_image(file_data, tuple(self.resize))
|
||||
image_array = numpy.asarray(image_data).astype('float32') / 255.0
|
||||
image_expand = numpy.expand_dims(image_array, axis=(0, -1))
|
||||
for model_name, model in self.models.items():
|
||||
@@ -83,12 +87,19 @@ class DLScan:
|
||||
return False, False
|
||||
|
||||
def preprocess_image(self, file_data, target_size):
|
||||
width, height, channels, interpolation = target_size
|
||||
wah = int(numpy.ceil(numpy.sqrt(len(file_data))))
|
||||
file_data = numpy.frombuffer(file_data, dtype=numpy.uint8)
|
||||
image_array = numpy.zeros((wah * wah,), dtype=numpy.uint8)
|
||||
image_array[:len(file_data)] = file_data
|
||||
image = Image.fromarray(image_array.reshape((wah, wah)), 'L')
|
||||
return image.resize(target_size, Image.Resampling.NEAREST)
|
||||
if channels == 1:
|
||||
image = Image.fromarray(image_array.reshape((wah, wah)), 'L')
|
||||
elif channels == 3:
|
||||
image = Image.fromarray(image_array.reshape((wah, wah)), 'RGB')
|
||||
if width == 0 and height == 0:
|
||||
return image
|
||||
interpolations = self.valid_interpolations[interpolation.lower()]
|
||||
return image.resize((width, height), interpolations)
|
||||
|
||||
def get_type(self, file_path):
|
||||
match_data = {}
|
||||
@@ -102,8 +113,8 @@ class DLScan:
|
||||
any(shell in section_name.lower() for shell in self.shells)):
|
||||
match_data[section_name] = section.get_data()
|
||||
except:
|
||||
if ftype in [".bat", ".cmd", ".ps1", ".vbs", ".wsf", ".html", ".js",
|
||||
".txt", ".htm", ".hta", ".php", ".css", ".xml", ".json", ".wasm"]:
|
||||
if ftype in [".bat", ".cmd", ".ps1", ".vbs", ".wsf", ".html",
|
||||
".js", ".txt", ".htm", ".hta", ".php", ".css", ".xml", ".json"]:
|
||||
with open(file_path, 'rb') as file:
|
||||
match_data[ftype] = file.read()
|
||||
return match_data
|
||||
+1
-1
@@ -2,7 +2,7 @@ import pyinstaller_versionfile
|
||||
|
||||
pyinstaller_versionfile.create_versionfile(
|
||||
output_file="versionfile.txt",
|
||||
version='3.2.7',
|
||||
version='3.2.8',
|
||||
company_name="PYAS Security",
|
||||
file_description="Python Antivirus Software",
|
||||
internal_name="PYAS",
|
||||
|
||||
Reference in new issue
Block a user