Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d0404dd29c | ||
|
|
9d3761e7f6 | ||
|
|
03515acc68 | ||
|
|
f8413f4cfb | ||
|
|
24f7f67e63 | ||
|
|
85129cdfe1 | ||
|
|
6d4f8b2731 | ||
|
|
24a0efcce1 | ||
|
|
ce6be1b4d5 | ||
|
|
723ac47c48 | ||
|
|
720d163bdb | ||
|
|
a74047d4e5 | ||
|
|
f6538f93c7 | ||
|
|
49cb0b3ef5 | ||
|
|
c81845ba3a | ||
|
|
053ae64008 | ||
|
|
48989840b8 | ||
|
|
36c7bcd87f | ||
|
|
a50eca1600 | ||
|
|
f70dc8eb46 | ||
|
|
f13d816c5b | ||
|
|
3429e658b6 | ||
|
|
0c6f9d6041 | ||
|
|
4a668499b0 | ||
|
|
f1057252b3 | ||
|
|
4e3c866536 | ||
|
|
c585cb370c | ||
|
|
2211a2b1d4 | ||
|
|
42069e2aac | ||
|
|
fd499a17fe | ||
|
|
0cc56d3da7 | ||
|
|
2096f55ce8 | ||
|
|
a4afe0ac10 | ||
|
|
d523b66970 | ||
|
|
192335249c | ||
|
|
e02879b3d7 | ||
|
|
bf7157fb3e | ||
|
|
7c2ae87c73 | ||
|
|
c1357bb2e1 | ||
|
|
c298c3773e | ||
|
|
7d09c6501c | ||
|
|
1a051d42af | ||
|
|
22bbcc5217 | ||
|
|
017f153002 |
No files matched your search
@@ -5,6 +5,7 @@ import win32gui, win32api, win32con
|
||||
import xml.etree.ElementTree as xmlet
|
||||
from PYAS_Scripts import scripts_list
|
||||
from PYAS_Function import function_list
|
||||
from PYAS_Function_Safe import function_list_safe
|
||||
from PYAS_Extension import slist, alist
|
||||
from PYAS_Language import translate_dict
|
||||
from PYAS_Interface import Ui_MainWindow
|
||||
@@ -19,7 +20,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.setAttribute(Qt.WA_TranslucentBackground)
|
||||
self.setWindowFlags(Qt.FramelessWindowHint)
|
||||
self.pyas = str(sys.argv[0]).replace("\\", "/")
|
||||
self.pyas_version = "2.8.7"
|
||||
self.pyas_version = "2.8.9"
|
||||
self.ui = Ui_MainWindow()
|
||||
self.ui.setupUi(self)
|
||||
self.init_tray_icon()
|
||||
@@ -261,7 +262,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.ui.Window_Block_Button.setText(self.trans("軟體彈窗攔截"))
|
||||
self.ui.Repair_System_Network_Button.setText(self.trans("系統網路修復"))
|
||||
self.ui.About_Back.setText(self.trans("返回"))
|
||||
self.ui.PYAS_Version.setText(self.trans(f"PYAS V{self.pyas_version}"))
|
||||
self.ui.PYAS_Version.setText(self.trans(f"PYAS V{self.pyas_version} (ML Engine)"))
|
||||
self.ui.GUI_Made_title.setText(self.trans("介面製作:"))
|
||||
self.ui.GUI_Made_Name.setText(self.trans("mtkiao"))
|
||||
self.ui.Core_Made_title.setText(self.trans("核心製作:"))
|
||||
@@ -628,11 +629,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.ui.Virus_Scan_text.setText(self.trans("正在初始化中"))
|
||||
QApplication.processEvents()
|
||||
for file in self.virus_list:
|
||||
try:
|
||||
msvcrt.locking(self.virus_lock[file], msvcrt.LK_UNLCK, 0)
|
||||
os.close(self.virus_lock[file])
|
||||
except:
|
||||
continue
|
||||
self.unlock_file(file)
|
||||
self.scan_file = True
|
||||
self.init_virus_list()
|
||||
self.ui.Virus_Scan_Solve_Button.hide()
|
||||
@@ -655,6 +652,20 @@ class MainWindow_Controller(QMainWindow):
|
||||
copyPath.triggered.connect(lambda: copyPathFunc())
|
||||
menu.exec_(self.ui.Virus_Scan_output.mapToGlobal(point))
|
||||
|
||||
def lock_file(self, file):
|
||||
try:
|
||||
self.virus_lock[file] = os.open(file, os.O_RDWR)
|
||||
msvcrt.locking(self.virus_lock[file], msvcrt.LK_NBLCK, 0)
|
||||
except:
|
||||
pass
|
||||
|
||||
def unlock_file(self, file):
|
||||
try:
|
||||
msvcrt.locking(self.virus_lock[file], msvcrt.LK_UNLCK, 0)
|
||||
os.close(self.virus_lock[file])
|
||||
except:
|
||||
pass
|
||||
|
||||
def virus_solve(self):
|
||||
try:
|
||||
self.ui.Virus_Scan_Solve_Button.hide()
|
||||
@@ -663,12 +674,10 @@ class MainWindow_Controller(QMainWindow):
|
||||
if self.ui.Virus_Scan_output.findItems(file, Qt.MatchContains)[0].checkState() == Qt.Checked:
|
||||
self.ui.Virus_Scan_text.setText(self.trans("正在刪除: ")+file)
|
||||
QApplication.processEvents()
|
||||
msvcrt.locking(self.virus_lock[file], msvcrt.LK_UNLCK, 0)
|
||||
os.close(self.virus_lock[file])
|
||||
self.unlock_file(file)
|
||||
os.remove(file)
|
||||
else:
|
||||
msvcrt.locking(self.virus_lock[file], msvcrt.LK_UNLCK, 0)
|
||||
os.close(self.virus_lock[file])
|
||||
self.unlock_file(file)
|
||||
except:
|
||||
continue
|
||||
self.init_state_safe()
|
||||
@@ -680,6 +689,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
|
||||
def write_scan(self, state, file):
|
||||
try:
|
||||
self.lock_file(file)
|
||||
self.virus_list.append(file)
|
||||
self.virus_list_ui.append(f"[{state}] {file}")
|
||||
item = QListWidgetItem()
|
||||
@@ -687,8 +697,6 @@ class MainWindow_Controller(QMainWindow):
|
||||
item.setFlags(item.flags() | Qt.ItemIsUserCheckable)
|
||||
item.setCheckState(Qt.Checked)
|
||||
self.ui.Virus_Scan_output.addItem(item)
|
||||
self.virus_lock[file] = os.open(file, os.O_RDWR)
|
||||
msvcrt.locking(self.virus_lock[file], msvcrt.LK_NBLCK, 0)
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -764,11 +772,15 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.write_scan(self.trans("惡意"),file)
|
||||
elif self.pe_scan(file):
|
||||
self.write_scan(self.trans("可疑"),file)
|
||||
elif self.scr_scan(file):
|
||||
self.write_scan(self.trans("可疑"),file)
|
||||
elif file_type in slist and self.sign_scan(file):
|
||||
if self.api_scan(file):
|
||||
self.write_scan(self.trans("惡意"),file)
|
||||
elif self.pe_scan(file):
|
||||
self.write_scan(self.trans("可疑"),file)
|
||||
elif self.scr_scan(file):
|
||||
self.write_scan(self.trans("可疑"),file)
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -820,15 +832,18 @@ class MainWindow_Controller(QMainWindow):
|
||||
|
||||
def pe_scan(self, file):
|
||||
try:
|
||||
pe_func = []
|
||||
fn = set()
|
||||
with pefile.PE(file) as pe:
|
||||
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
||||
for func in entry.imports:
|
||||
try:
|
||||
pe_func.append(str(func.name, "utf-8"))
|
||||
fn.add(str(func.name, "utf-8"))
|
||||
except:
|
||||
pass
|
||||
return pe_func in function_list
|
||||
max_vfl = max(len(set(fn) & set(vfl)) / len(set(fn) | set(vfl)) for vfl in function_list)
|
||||
max_sfl = max(len(set(fn) & set(sfl)) / len(set(fn) | set(sfl)) for sfl in function_list_safe)
|
||||
#print(f'Virus:{int(max_vfl * 100)}%, Safe:{int(max_sfl * 100)}%')
|
||||
return int(max_vfl * 100) > int(max_sfl * 100)
|
||||
except:
|
||||
return False
|
||||
|
||||
@@ -1171,7 +1186,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
elif "cmd.exe" in name and self.api_scan(" ".join(cmd[2:])):
|
||||
p.kill()
|
||||
self.send_notify(self.trans("惡意腳本攔截: ")+name)
|
||||
elif self.scr_scan(cmd) or self.api_scan(cmd[-1]):
|
||||
elif self.scr_scan(file) or self.api_scan(cmd[-1]):
|
||||
p.kill()
|
||||
self.send_notify(self.trans("惡意軟體攔截: ")+name)
|
||||
elif file != self.pyas and file not in self.whitelist:
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
slist = [".exe",".dll",".com",".msi",".scr",
|
||||
".bat",".cmd",".ps1",".vbs",".js"]
|
||||
".bat",".cmd",".ps1",".vbs",".jar",
|
||||
".js",".elf",".doc",".xls",".xlsx"]
|
||||
|
||||
alist = [".ppt",".pptx",".wps",".txt",".rtf",
|
||||
".pdf",".xls",".xlsx",".doc",".docx",
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
scripts_list = ["%0|%0","ExclusionPath","cmdkey","eiculwo","random","bypass"]
|
||||
scripts_list = ["%0|%0","ExclusionPath","cmdkey","eiculwo"]
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import pyinstaller_versionfile
|
||||
pyinstaller_versionfile.create_versionfile(
|
||||
output_file="versionfile.txt",
|
||||
version='2.8.7',
|
||||
version='2.8.9',
|
||||
company_name="PYAS Security",
|
||||
file_description="Python Antivirus Software",
|
||||
internal_name="PYAS",
|
||||
|
||||
Reference in new issue
Block a user