Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a83bba10e3 | ||
|
|
4b9342fa8b | ||
|
|
a48162cf4a | ||
|
|
3fa61e777c | ||
|
|
01a2c55207 | ||
|
|
1a2376e6b7 | ||
|
|
dab0d6a47f | ||
|
|
b5d90b5cb7 | ||
|
|
25fd0bd2af | ||
|
|
a4bb63fcd4 | ||
|
|
9d85785c27 | ||
|
|
4206242627 | ||
|
|
f0149be9ad | ||
|
|
5d56a1f0e0 | ||
|
|
ad06c75058 | ||
|
|
d5b6e17e59 | ||
|
|
ffe2514e11 | ||
|
|
8621bed5d4 | ||
|
|
634031e6dc | ||
|
|
11fae36469 | ||
|
|
3d01e36a71 | ||
|
|
c2082b1ac5 | ||
|
|
c94bbf84fe | ||
|
|
930363cd3f | ||
|
|
085ca9eb58 | ||
|
|
f486d44804 |
No files matched your search
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
@@ -8,5 +8,5 @@
|
||||
|
||||
"Pixels": [224, 224],
|
||||
|
||||
"Values": 85
|
||||
"Values": 90
|
||||
}
|
||||
Binary file not shown.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,117 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
; Repair system restrictions
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MMC]
|
||||
; NoControlPanel
|
||||
"NoControlPanel"=dword:00000000
|
||||
; NoDrives
|
||||
"NoDrives"=dword:00000000
|
||||
; NoFileMenu
|
||||
"NoFileMenu"=dword:00000000
|
||||
; NoFind
|
||||
"NoFind"=dword:00000000
|
||||
; NoRealMode
|
||||
"NoRealMode"=dword:00000000
|
||||
; NoRecentDocsMenu
|
||||
"NoRecentDocsMenu"=dword:00000000
|
||||
; NoSetFolders
|
||||
"NoSetFolders"=dword:00000000
|
||||
; NoSetFolderOptions
|
||||
"NoSetFolderOptions"=dword:00000000
|
||||
; NoViewOnDrive
|
||||
"NoViewOnDrive"=dword:00000000
|
||||
; NoClose
|
||||
"NoClose"=dword:00000000
|
||||
; NoRun
|
||||
"NoRun"=dword:00000000
|
||||
; NoDesktop
|
||||
"NoDesktop"=dword:00000000
|
||||
; NoLogOff
|
||||
"NoLogOff"=dword:00000000
|
||||
; NoFolderOptions
|
||||
"NoFolderOptions"=dword:00000000
|
||||
; RestrictRun
|
||||
"RestrictRun"=dword:00000000
|
||||
; NoViewContextMenu
|
||||
"NoViewContexMenu"=dword:00000000
|
||||
; HideClock
|
||||
"HideClock"=dword:00000000
|
||||
; NoStartMenuMorePrograms
|
||||
"NoStartMenuMorePrograms"=dword:00000000
|
||||
; NoStartMenuMyGames
|
||||
"NoStartMenuMyGames"=dword:00000000
|
||||
; NoStartMenuMyMusic
|
||||
"NoStartMenuMyMusic"=dword:00000000
|
||||
; DisableCMD
|
||||
"DisableCMD"=dword:00000000
|
||||
; NoWinKeys
|
||||
"NoWinKeys"=dword:00000000
|
||||
; StartMenuLogOff
|
||||
"StartMenuLogOff"=dword:00000000
|
||||
; NoSimpleNetlDList
|
||||
"NoSimpleNetlDList"=dword:00000000
|
||||
; NoLowDiskSpaceChecks
|
||||
"NoLowDiskSpaceChecks"=dword:00000000
|
||||
; DisableLockWorkstation
|
||||
"DisableLockWorkstation"=dword:00000000
|
||||
; Restrict_Run
|
||||
"Restrict_Run"=dword:00000000
|
||||
; DisableTaskMgr
|
||||
"DisableTaskMgr"=dword:00000000
|
||||
; DisableRegistryTools
|
||||
"DisableRegistryTools"=dword:00000000
|
||||
; DisableChangePassword
|
||||
"DisableChangePassword"=dword:00000000
|
||||
; Wallpaper
|
||||
"Wallpaper"=dword:00000000
|
||||
; NoComponents
|
||||
"NoComponents"=dword:00000000
|
||||
; NoAddingComponents
|
||||
"NoAddingComponents"=dword:00000000
|
||||
; NoStartMenuPinnedList
|
||||
"NoStartMenuPinnedList"=dword:00000000
|
||||
; NoActiveDesktop
|
||||
"NoActiveDesktop"=dword:00000000
|
||||
; NoSetActiveDesktop
|
||||
"NoSetActiveDesktop"=dword:00000000
|
||||
; NoActiveDesktopChanges
|
||||
"NoActiveDesktopChanges"=dword:00000000
|
||||
; NoChangeStartMenu
|
||||
"NoChangeStartMenu"=dword:00000000
|
||||
; NoFavoritesMenu
|
||||
"NoFavoritesMenu"=dword:00000000
|
||||
; NoRecentDocsHistory
|
||||
"NoRecentDocsHistory"=dword:00000000
|
||||
; NoSetTaskbar
|
||||
"NoSetTaskbar"=dword:00000000
|
||||
; NoSMHelp
|
||||
"NoSMHelp"=dword:00000000
|
||||
; NoTrayContextMenu
|
||||
"NoTrayContextMenu"=dword:00000000
|
||||
; NoViewContextMenu
|
||||
"NoViewContextMenu"=dword:00000000
|
||||
; NoManageMyComputerVerb
|
||||
"NoManageMyComputerVerb"=dword:00000000
|
||||
; NoWindowsUpdate
|
||||
"NoWindowsUpdate"=dword:00000000
|
||||
; ClearRecentDocsOnExit
|
||||
"ClearRecentDocsOnExit"=dword:00000000
|
||||
; NoStartMenuNetworkPlaces
|
||||
"NoStartMenuNetworkPlaces"=dword:00000000
|
||||
|
||||
; Repair Image File Execution Options
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options]
|
||||
; (Delete all subkeys here if necessary)
|
||||
|
||||
; Repair executable file icon
|
||||
[HKEY_CLASSES_ROOT\exefile\DefaultIcon]
|
||||
@="%1"
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile\DefaultIcon]
|
||||
@="%1"
|
||||
|
||||
; Repair executable file type
|
||||
[HKEY_CLASSES_ROOT\.exe]
|
||||
@="exefile"
|
||||
[HKEY_CLASSES_ROOT\exefile\shell\open\command]
|
||||
@="\"%1\" %*"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
sfc /scannow
|
||||
@@ -0,0 +1 @@
|
||||
None
|
||||
@@ -52,7 +52,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.pyas = sys.argv[0].replace("\\", "/")
|
||||
self.dir = os.path.dirname(self.pyas)
|
||||
self.pyae_version = "AI Engine"
|
||||
self.pyas_version = "3.2.4"
|
||||
self.pyas_version = "3.2.6"
|
||||
self.first_startup = True
|
||||
self.init_tray_icon()
|
||||
self.init_data_base()
|
||||
@@ -91,6 +91,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
try:
|
||||
self.ntdll = ctypes.WinDLL('ntdll', use_last_error=True)
|
||||
self.psapi = ctypes.WinDLL('Psapi', use_last_error=True)
|
||||
self.user32 = ctypes.WinDLL('user32', use_last_error=True)
|
||||
self.kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
|
||||
self.advapi32 = ctypes.WinDLL('advapi32', use_last_error=True)
|
||||
self.iphlpapi = ctypes.WinDLL('iphlpapi', use_last_error=True)
|
||||
@@ -112,13 +113,13 @@ class MainWindow_Controller(QMainWindow):
|
||||
def init_data_base(self):
|
||||
try:
|
||||
self.model = DLScan()
|
||||
data_path = os.path.join(self.dir, "Model")
|
||||
data_path = os.path.join(self.dir, "Engine/Model")
|
||||
for root, dirs, files in os.walk(data_path):
|
||||
for file in files:
|
||||
file_path = os.path.join(root, file)
|
||||
self.model.load_model(file_path)
|
||||
self.rules = YRScan()
|
||||
data_path = os.path.join(self.dir, "Rules")
|
||||
data_path = os.path.join(self.dir, "Engine/Rules")
|
||||
for root, dirs, files in os.walk(data_path):
|
||||
for file in files:
|
||||
file_path = os.path.join(root, file)
|
||||
@@ -409,7 +410,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.ui.Navigation_Bar.setStyleSheet("QWidget#Navigation_Bar {background-color:rgb(250,250,220);}")
|
||||
elif self.ui.Theme_Customize.isChecked():
|
||||
if not os.path.exists(os.path.join(self.json["theme_color"],"Color.ini")):
|
||||
path = str(QFileDialog.getExistingDirectory(self,self.trans("自定主題"),"C:/"))
|
||||
path = str(QFileDialog.getExistingDirectory(self,self.trans("自定主題"),""))
|
||||
if path and os.path.exists(os.path.join(path,"Color.ini")):
|
||||
self.json["theme_color"] = path
|
||||
with open(os.path.join(self.json["theme_color"],"Color.ini"), "r") as f:
|
||||
@@ -888,7 +889,6 @@ class MainWindow_Controller(QMainWindow):
|
||||
else:
|
||||
self.virus_scan_break()
|
||||
text = self.trans("當前未發現病毒")
|
||||
self.scan_thread.join()
|
||||
QMetaObject.invokeMethod(self.ui.Virus_Scan_text, "setText",
|
||||
Qt.QueuedConnection, Q_ARG(str, text))
|
||||
self.send_notify(text)
|
||||
@@ -913,29 +913,31 @@ class MainWindow_Controller(QMainWindow):
|
||||
|
||||
def file_scan(self):
|
||||
try:
|
||||
file = str(QFileDialog.getOpenFileName(self,self.trans("病毒掃描"),"C:/")[0])
|
||||
if file and file not in self.whitelist and file != self.pyas:
|
||||
file = str(QFileDialog.getOpenFileName(self,self.trans("病毒掃描"),"")[0])
|
||||
if file and not self.check_whitelist(file):
|
||||
self.init_scan()
|
||||
self.scan_thread = Thread(target=self.write_scan,
|
||||
args=(self.start_scan(file),file,), daemon=True)
|
||||
self.scan_thread.start()
|
||||
while self.scan_thread.is_alive():
|
||||
QApplication.processEvents()
|
||||
self.answer_scan()
|
||||
self.scan_thread.join()
|
||||
self.answer_scan()
|
||||
except Exception as e:
|
||||
self.bug_event(e)
|
||||
self.virus_scan_break()
|
||||
|
||||
def path_scan(self):
|
||||
try:
|
||||
path = str(QFileDialog.getExistingDirectory(self,self.trans("病毒掃描"),"C:/"))
|
||||
if path:
|
||||
path = str(QFileDialog.getExistingDirectory(self,self.trans("病毒掃描"),""))
|
||||
if path and not self.check_whitelist(path):
|
||||
self.init_scan()
|
||||
self.scan_thread = Thread(target=self.traverse_path, args=(path,), daemon=True)
|
||||
self.scan_thread.start()
|
||||
while self.scan_thread.is_alive():
|
||||
QApplication.processEvents()
|
||||
self.answer_scan()
|
||||
self.scan_thread.join()
|
||||
self.answer_scan()
|
||||
except Exception as e:
|
||||
self.bug_event(e)
|
||||
self.virus_scan_break()
|
||||
@@ -949,6 +951,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.scan_thread.start()
|
||||
while self.scan_thread.is_alive():
|
||||
QApplication.processEvents()
|
||||
self.scan_thread.join()
|
||||
self.answer_scan()
|
||||
except Exception as e:
|
||||
self.bug_event(e)
|
||||
@@ -962,7 +965,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
break
|
||||
elif os.path.isdir(file):
|
||||
self.traverse_path(file)
|
||||
elif file != self.pyas and file not in self.whitelist:
|
||||
elif not self.check_whitelist(file):
|
||||
QMetaObject.invokeMethod(self.ui.Virus_Scan_title, "setText",
|
||||
Qt.QueuedConnection, Q_ARG(str, self.trans("正在掃描")))
|
||||
QMetaObject.invokeMethod(self.ui.Virus_Scan_text, "setText",
|
||||
@@ -1006,81 +1009,62 @@ class MainWindow_Controller(QMainWindow):
|
||||
|
||||
def open_registry_key(self, hkey, subkey, access=0xF003F):
|
||||
key_handle = ctypes.wintypes.HANDLE()
|
||||
result = self.advapi32.RegOpenKeyExW(hkey, subkey, 0, access, ctypes.byref(key_handle))
|
||||
return key_handle
|
||||
|
||||
def set_registry_value(self, hkey, subkey, value_name, value_type, value):
|
||||
key_handle = self.open_registry_key(hkey, subkey)
|
||||
self.advapi32.RegSetValueExW(key_handle, value_name, 0,
|
||||
value_type, ctypes.create_unicode_buffer(value), len(value) * 2)
|
||||
self.advapi32.RegCloseKey(key_handle)
|
||||
|
||||
def delete_registry_value(self, key_handle, value_name):
|
||||
try:
|
||||
result = self.advapi32.RegDeleteValueW(key_handle, value_name)
|
||||
if result == 0 and self.track_proc:
|
||||
self.kill_process("註冊表攔截", *self.track_proc)
|
||||
except Exception as e:
|
||||
pass
|
||||
if self.advapi32.RegOpenKeyExW(hkey, subkey, 0, access, ctypes.byref(key_handle)) == 0:
|
||||
return key_handle
|
||||
return None
|
||||
|
||||
def delete_registry_key(self, hkey, subkey):
|
||||
try:
|
||||
result = self.advapi32.RegDeleteKeyW(hkey, subkey)
|
||||
if result == 0 and self.track_proc:
|
||||
self.kill_process("註冊表攔截", *self.track_proc)
|
||||
except Exception as e:
|
||||
pass
|
||||
if self.advapi32.RegDeleteKeyW(hkey, subkey) == 0 and self.track_proc:
|
||||
self.kill_process("註冊表攔截", *self.track_proc)
|
||||
|
||||
def create_registry_keys(self, keys):
|
||||
for hkey, subkey in keys:
|
||||
key_handle = ctypes.wintypes.HANDLE()
|
||||
def create_registry_keys(self, hkey, subkey):
|
||||
key_handle = self.open_registry_key(hkey, subkey)
|
||||
if key_handle:
|
||||
self.advapi32.RegCreateKeyExW(hkey, subkey, 0, None, 0, 0xF003F, None, ctypes.byref(key_handle), None)
|
||||
self.advapi32.RegCloseKey(key_handle)
|
||||
|
||||
def set_registry_value(self, hkey, subkey, value_name, value_data):
|
||||
key_handle = self.open_registry_key(hkey, subkey)
|
||||
if key_handle:
|
||||
self.advapi32.RegSetValueExW(key_handle, value_name, 0, 1, value_data, (len(value_data) + 1) * 2)
|
||||
self.advapi32.RegCloseKey(key_handle)
|
||||
|
||||
def delete_registry_value(self, hkey, subkey, value_name):
|
||||
key_handle = self.open_registry_key(hkey, subkey)
|
||||
if key_handle and self.advapi32.RegDeleteValueW(key_handle, value_name) == 0 and self.track_proc:
|
||||
self.kill_process("註冊表攔截", *self.track_proc)
|
||||
self.advapi32.RegCloseKey(key_handle)
|
||||
|
||||
def repair_system_restrict(self):
|
||||
try:
|
||||
permissions = ["NoControlPanel", "NoDrives", "NoFileMenu", "NoFind", "NoRealMode", "NoRecentDocsMenu","NoSetFolders",
|
||||
"NoSetFolderOptions", "NoViewOnDrive", "NoClose", "NoRun", "NoDesktop", "NoLogOff", "NoFolderOptions", "RestrictRun",
|
||||
"NoViewContexMenu", "HideClock", "NoStartMenuMorePrograms", "NoStartMenuMyGames", "NoStartMenuMyMusic", "DisableCMD",
|
||||
"NoWinKeys", "StartMenuLogOff", "NoSimpleNetlDList", "NoLowDiskSpaceChecks", "DisableLockWorkstation", "Restrict_Run",
|
||||
"DisableTaskMgr", "DisableRegistryTools", "DisableChangePassword", "Wallpaper", "NoComponents", "NoAddingComponents",
|
||||
"NoStartMenuPinnedList", "NoActiveDesktop", "NoSetActiveDesktop", "NoActiveDesktopChanges", "NoChangeStartMenu",
|
||||
"NoFavoritesMenu", "NoRecentDocsHistory", "NoSetTaskbar", "NoSMHelp", "NoTrayContextMenu", "NoViewContextMenu",
|
||||
"NoManageMyComputerVerb", "NoWindowsUpdate", "ClearRecentDocsOnExit", "NoStartMenuNetworkPlaces"]
|
||||
keys_to_create = [(0x80000001, r"Software\Policies\Microsoft\MMC"),
|
||||
(0x80000001, r"Software\Policies\Microsoft\MMC\{8FC0B734-A0E1-11D1-A7D3-0000F87571E3}"),
|
||||
(0x80000001, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"),
|
||||
(0x80000001, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"),
|
||||
(0x80000001, r"SOFTWARE\Policies\Microsoft\Windows\System"),
|
||||
(0x80000002, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"),
|
||||
(0x80000002, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"),
|
||||
(0x80000002, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop"),
|
||||
(0x80000002, r"SOFTWARE\Policies\Microsoft\Windows\System")]
|
||||
self.create_registry_keys(keys_to_create)
|
||||
for hkey, subkey in keys_to_create:
|
||||
try:
|
||||
key_handle = self.open_registry_key(hkey, subkey)
|
||||
for perm in permissions:
|
||||
self.delete_registry_value(key_handle, perm)
|
||||
self.advapi32.RegCloseKey(key_handle)
|
||||
except:
|
||||
pass
|
||||
except:
|
||||
pass
|
||||
|
||||
def repair_system_file_icon(self):
|
||||
try:
|
||||
self.set_registry_value(0x80000000, 'exefile', 'DefaultIcon', 1, '%1')
|
||||
except Exception as e:
|
||||
pass
|
||||
try:
|
||||
self.set_registry_value(0x80000002, r'SOFTWARE\Classes\exefile', 'DefaultIcon', 1, '%1')
|
||||
except Exception as e:
|
||||
pass
|
||||
permissions = ["NoControlPanel", "NoDrives", "NoFileMenu", "NoFind", "NoRealMode", "NoRecentDocsMenu","NoSetFolders",
|
||||
"NoSetFolderOptions", "NoViewOnDrive", "NoClose", "NoRun", "NoDesktop", "NoLogOff", "NoFolderOptions", "RestrictRun",
|
||||
"NoViewContexMenu", "HideClock", "NoStartMenuMorePrograms", "NoStartMenuMyGames", "NoStartMenuMyMusic", "DisableCMD",
|
||||
"NoWinKeys", "StartMenuLogOff", "NoSimpleNetlDList", "NoLowDiskSpaceChecks", "DisableLockWorkstation", "Restrict_Run",
|
||||
"DisableTaskMgr", "DisableRegistryTools", "DisableChangePassword", "Wallpaper", "NoComponents", "NoAddingComponents",
|
||||
"NoStartMenuPinnedList", "NoActiveDesktop", "NoSetActiveDesktop", "NoActiveDesktopChanges", "NoChangeStartMenu",
|
||||
"NoFavoritesMenu", "NoRecentDocsHistory", "NoSetTaskbar", "NoSMHelp", "NoTrayContextMenu", "NoViewContextMenu",
|
||||
"NoManageMyComputerVerb", "NoWindowsUpdate", "ClearRecentDocsOnExit", "NoStartMenuNetworkPlaces"]
|
||||
keys_to_create = [(0x80000001, r"Software\Policies\Microsoft\MMC"),
|
||||
(0x80000001, r"Software\Policies\Microsoft\MMC\{8FC0B734-A0E1-11D1-A7D3-0000F87571E3}"),
|
||||
(0x80000001, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"),
|
||||
(0x80000001, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"),
|
||||
(0x80000001, r"SOFTWARE\Policies\Microsoft\Windows\System"),
|
||||
(0x80000002, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer"),
|
||||
(0x80000002, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"),
|
||||
(0x80000002, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop"),
|
||||
(0x80000002, r"SOFTWARE\Policies\Microsoft\Windows\System")]
|
||||
for hkey, subkey in keys_to_create:
|
||||
try:
|
||||
self.create_registry_keys(hkey, subkey)
|
||||
for value_name in permissions:
|
||||
self.delete_registry_value(hkey, subkey, value_name)
|
||||
except:
|
||||
print(e)
|
||||
|
||||
def repair_system_image(self):
|
||||
try:
|
||||
key_handle = self.open_registry_key(0x80000002,
|
||||
r'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options', 0xF003F)
|
||||
image_file = r'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options'
|
||||
key_handle = self.open_registry_key(0x80000002, image_file, 0xF003F)
|
||||
count = ctypes.wintypes.DWORD()
|
||||
self.advapi32.RegQueryInfoKeyW(key_handle, None, None, None,
|
||||
ctypes.byref(count), None, None, None, None, None, None, None)
|
||||
@@ -1090,35 +1074,33 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.advapi32.RegEnumKeyW(key_handle, i, subkey_name, 256)
|
||||
self.delete_registry_key(key_handle, subkey_name.value)
|
||||
except Exception as e:
|
||||
pass
|
||||
print(e)
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
def repair_system_file_icon(self):
|
||||
try:
|
||||
self.set_registry_value(0x80000000, 'exefile', 'DefaultIcon', '%1')
|
||||
self.set_registry_value(0x80000002, r'SOFTWARE\Classes\exefile', 'DefaultIcon', '%1')
|
||||
except:
|
||||
pass
|
||||
|
||||
def repair_system_file_type(self):
|
||||
try:
|
||||
data = [('.exe', 'exefile'), ('exefile', 'Application')]
|
||||
key_handle = self.open_registry_key(0x80000002, r'SOFTWARE\Classes', 0xF003F)
|
||||
for ext, value in data:
|
||||
self.set_registry_value(0x80000002, ext, '', 1, value)
|
||||
self.advapi32.RegCloseKey(key_handle)
|
||||
key_handle = self.open_registry_key(0x80000001, r'SOFTWARE\Classes', 0xF003F)
|
||||
for ext, value in data:
|
||||
self.set_registry_value(0x80000001, ext, '', 1, value)
|
||||
self.set_registry_value(0x80000001, ext + r'\shell\open\command', '', 1, '"%1" %*')
|
||||
self.advapi32.RegCloseKey(key_handle)
|
||||
except Exception as e:
|
||||
pass
|
||||
for hkey in [0x80000002, 0x80000001, 0x80000000]:
|
||||
for ext, value in [('.exe', 'exefile'), ('exefile', 'Application')]:
|
||||
try:
|
||||
self.set_registry_value(hkey, r'SOFTWARE\Classes', ext, value)
|
||||
self.set_registry_value(hkey, f'{ext}\\shell\\open\\command', '', '"%1" %*')
|
||||
except:
|
||||
pass
|
||||
|
||||
def repair_system_wallpaper(self):
|
||||
try:
|
||||
key_handle = self.open_registry_key(0x80000001, r"Control Panel\Desktop", 0xF003F)
|
||||
self.advapi32.RegSetValueExW(key_handle, "Wallpaper", 0, 1,
|
||||
ctypes.create_unicode_buffer('C:/Windows/web/wallpaper/windows/img0.jpg'),
|
||||
len('C:/Windows/web/wallpaper/windows/img0.jpg') * 2)
|
||||
self.advapi32.RegCloseKey(key_handle)
|
||||
ctypes.windll.user32.SystemParametersInfoW(20, 0, 'C:/Windows/web/wallpaper/windows/img0.jpg', 2)
|
||||
wallpaper = "C:/Windows/web/wallpaper/windows/img0.jpg"
|
||||
self.set_registry_value(0x80000001, "Wallpaper", ctypes.create_unicode_buffer(wallpaper), wallpaper)
|
||||
self.user32.SystemParametersInfoW(20, 0, wallpaper, 2)
|
||||
except Exception as e:
|
||||
pass
|
||||
print(e)
|
||||
|
||||
def clean_system(self):
|
||||
try:
|
||||
@@ -1148,7 +1130,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
|
||||
def add_white_list(self):
|
||||
try:
|
||||
file = str(QFileDialog.getOpenFileName(self,self.trans("增加到白名單"),"C:/")[0]).replace("\\", "/")
|
||||
file = str(QFileDialog.getExistingDirectory(self,self.trans("增加到白名單"),"")).replace("\\", "/")
|
||||
if file and file not in self.whitelist:
|
||||
if self.question_event("您確定要增加到白名單嗎?"):
|
||||
self.whitelist.append(file)
|
||||
@@ -1194,17 +1176,17 @@ class MainWindow_Controller(QMainWindow):
|
||||
Thread(target=self.block_software_window, daemon=True).start()
|
||||
|
||||
def get_foreground_window_title(self):
|
||||
hWnd = ctypes.windll.user32.GetForegroundWindow()
|
||||
length = ctypes.windll.user32.GetWindowTextLengthW(hWnd)
|
||||
hWnd = self.user32.GetForegroundWindow()
|
||||
length = self.user32.GetWindowTextLengthW(hWnd)
|
||||
title = ctypes.create_unicode_buffer(length + 1)
|
||||
ctypes.windll.user32.GetWindowTextW(hWnd, title, length + 1)
|
||||
self.user32.GetWindowTextW(hWnd, title, length + 1)
|
||||
return str(title.value)
|
||||
|
||||
def find_window_by_name(self, window_name):
|
||||
return ctypes.windll.user32.FindWindowW(None, ctypes.create_unicode_buffer(window_name))
|
||||
return self.user32.FindWindowW(None, ctypes.create_unicode_buffer(window_name))
|
||||
|
||||
def post_close_message(self, hWnd):
|
||||
ctypes.windll.user32.PostMessageW(hWnd, 274, 61536, 0)
|
||||
self.user32.PostMessageW(hWnd, 274, 61536, 0)
|
||||
|
||||
def block_software_window(self):
|
||||
while self.block_window:
|
||||
@@ -1212,7 +1194,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
time.sleep(0.2)
|
||||
for window_name in self.blocklist:
|
||||
hWnd = self.find_window_by_name(window_name)
|
||||
if hWnd != 0: # 如果找到窗口
|
||||
if hWnd != 0:
|
||||
self.post_close_message(hWnd)
|
||||
except Exception as e:
|
||||
pass
|
||||
@@ -1328,7 +1310,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
|
||||
def protect_drv_init(self):
|
||||
try:
|
||||
file_path = os.path.join(self.dir, "Driver").replace("\\", "/")
|
||||
file_path = os.path.join(self.dir, "Driver/Protect").replace("\\", "/")
|
||||
if os.path.exists(file_path):
|
||||
if self.ui.Protection_switch_Button_4.text() == self.trans("已開啟"):
|
||||
result = Popen("sc stop PYAS_Driver", shell=True, stdout=PIPE, stderr=PIPE).wait()
|
||||
@@ -1423,16 +1405,23 @@ class MainWindow_Controller(QMainWindow):
|
||||
try:
|
||||
h_process = self.kernel32.OpenProcess(0x1F0FFF, False, pid)
|
||||
file = self.get_process_file(h_process).replace("\\", "/")
|
||||
if file != self.pyas and file not in self.whitelist:
|
||||
if os.path.exists(file) and not self.check_whitelist(file):
|
||||
self.lock_process(h_process, True)
|
||||
if self.start_scan(file):
|
||||
self.kill_process("病毒攔截", h_process, file)
|
||||
elif ":/Windows" not in file and os.path.exists(file):
|
||||
elif ":/Windows" not in file and ":/Program" not in file:
|
||||
self.track_proc = (h_process, file)
|
||||
self.lock_process(h_process, False)
|
||||
except:
|
||||
self.lock_process(h_process, False)
|
||||
|
||||
def check_whitelist(self, file):
|
||||
path = os.path.dirname(file)
|
||||
for whitefile in self.whitelist:
|
||||
if whitefile in path:
|
||||
return True
|
||||
return False
|
||||
|
||||
def kill_process(self, info, h_process, file):
|
||||
try:
|
||||
self.kernel32.TerminateProcess(h_process, 0)
|
||||
@@ -1478,7 +1467,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
notify_info = FILE_NOTIFY_INFORMATION.from_buffer_copy(buffer[0:])
|
||||
raw_filename = notify_info.FileName[:notify_info.FileNameLength // 2]
|
||||
fpath = f"C:/{raw_filename}".replace("\\", "/")
|
||||
ftype = f".{fpath.split('.')[-1]}".lower()
|
||||
ftype = os.path.splitext(fpath)[-1].lower()
|
||||
if self.ransom_counts >= 5 and self.track_proc:
|
||||
self.ransom_counts = 0
|
||||
self.kill_process("勒索攔截", *self.track_proc)
|
||||
|
||||
+4
-4
@@ -9,7 +9,7 @@ class YRScan:
|
||||
|
||||
def load_rules(self, file_path):
|
||||
try:
|
||||
ftype = str(f".{file_path.split('.')[-1]}").lower()
|
||||
ftype = os.path.splitext(file_path)[-1].lower()
|
||||
if ftype in [".yara", ".yar"]:
|
||||
self.rules[file_path] = yara.compile(file_path)
|
||||
elif ftype in [".yc", ".yrc"]:
|
||||
@@ -50,7 +50,7 @@ class DLScan:
|
||||
|
||||
def load_model(self, file_path):
|
||||
try:
|
||||
ftype = str(f".{file_path.split('.')[-1]}").lower()
|
||||
ftype = os.path.splitext(file_path)[-1].lower()
|
||||
if ftype in [".json", ".txt"]:
|
||||
with open(file_path, 'r') as f:
|
||||
self.class_names = json.load(f)
|
||||
@@ -75,7 +75,7 @@ class DLScan:
|
||||
pre_answers = model.run(None, {input_name: image_expand})[0][0]
|
||||
for k, score in enumerate(pre_answers):
|
||||
label_similarities[self.labels[k].strip()].append(score)
|
||||
label_percentage = {label: (sum(similarities) / len(image_expand)) * 100
|
||||
label_percentage = {label: (sum(similarities) / len(self.models)) * 100
|
||||
for label, similarities in label_similarities.items()}
|
||||
label, level = max(label_percentage.items(), key=lambda x: x[1])
|
||||
return label, int(level)
|
||||
@@ -92,7 +92,7 @@ class DLScan:
|
||||
|
||||
def get_type(self, file_path):
|
||||
match_data = {}
|
||||
ftype = str(f".{file_path.split('.')[-1]}").lower()
|
||||
ftype = os.path.splitext(file_path)[-1].lower()
|
||||
if ftype in self.suffix:
|
||||
try:
|
||||
with pefile.PE(file_path, fast_load=True) as pe:
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import pyinstaller_versionfile
|
||||
|
||||
pyinstaller_versionfile.create_versionfile(
|
||||
output_file="versionfile.txt",
|
||||
version='3.2.4',
|
||||
version='3.2.6',
|
||||
company_name="PYAS Security",
|
||||
file_description="Python Antivirus Software",
|
||||
internal_name="PYAS",
|
||||
|
||||
@@ -11,11 +11,8 @@
|
||||
## Requirements
|
||||
|
||||
```
|
||||
pip install psutil==5.9.5
|
||||
pip install pefile==2023.2.7
|
||||
pip install requests==2.31.0
|
||||
pip install pyperclip==1.8.2
|
||||
pip install pywin32==306
|
||||
pip install PyQt5==5.15.9
|
||||
pip install yara-python==4.5.1
|
||||
pip install numpy==2.1.1
|
||||
@@ -27,26 +24,22 @@ pip install pillow==10.4.0
|
||||
|
||||
```
|
||||
PYAS/
|
||||
├── Driver/
|
||||
│ ├── PYAS_Driver.sys -------> Driver Protect (self protection driver for pyas by 0sha0)
|
||||
├── Driver/ (Protect driver and Microsoft runtime)
|
||||
│ └── ...
|
||||
│
|
||||
├── Model/
|
||||
│ ├── PYAS_Model.json -------> Virus Database (the database must be in the specified dir)
|
||||
├── Engine/ (Deep learn model and Yara database)
|
||||
│ └── ...
|
||||
│
|
||||
├── Rules/
|
||||
│ ├── Yara_Rules.yar ---------> Yara Rules (yara rules in plain text format)
|
||||
│ ├── Yara_Rules.yrc ---------> Compile Rules (yara rules in compiled format)
|
||||
├── Exten/ (Exten tools and System repair tools)
|
||||
│ └── ...
|
||||
│
|
||||
├── PYAS.py ---------------------> Main PYAS Program (including animation, scan, protect functions, ...)
|
||||
├── PYAS_Engine.py -------------> Conversion Database (used to transform profiles and forecast data)
|
||||
├── PYAS_Suffixes.py -----------> File Suffixes (including scanned file suffixes and common suffixes)
|
||||
├── PYAS_Interface.py ----------> PyQt5 Interface (use QT designer, must be matched with the main program)
|
||||
├── PYAS_Resource.py -----------> PyQt5 Resource (status pictures, icon packages, button icons, ...)
|
||||
├── PYAS_Language.py -----------> Translate Dict (Traditional Chinese, Simplified Chinese, English)
|
||||
├── PYAS_Version.py ------------> Pyinstaller (file information, version information, original name, ...)
|
||||
├── PYAS.py (Main PYAS program with qtui interaction and protect function)
|
||||
├── PYAS_Engine.py (Deep learning predict and yara rules file scanner)
|
||||
├── PYAS_Suffixes.py (including scan file suffixes and common suffixes)
|
||||
├── PYAS_Interface.py (Qt designer ui, must be matched with the main program)
|
||||
├── PYAS_Resource.py (status pictures, icon packages, and button icons)
|
||||
├── PYAS_Language.py (Traditional Chinese, Simplified Chinese and English)
|
||||
├── PYAS_Version.py (file information, version information, original name)
|
||||
└── ...
|
||||
```
|
||||
|
||||
@@ -76,6 +69,6 @@ Other systems may experience software malfunctions or crash
|
||||
|
||||
## Special Thanks
|
||||
|
||||
Wix, 0sha0, mtkiao129, AV-T Team of LisectGroup
|
||||
Wix, mtkiao129, 0sha0, AV-T Team of LisectGroup
|
||||
|
||||
Copyright© 2020~2024 PYAS Security By 87owo
|
||||
+11
-18
@@ -5,11 +5,8 @@
|
||||
## 安装要求
|
||||
|
||||
```
|
||||
pip install psutil==5.9.5
|
||||
pip install pefile==2023.2.7
|
||||
pip install requests==2.31.0
|
||||
pip install pyperclip==1.8.2
|
||||
pip install pywin32==306
|
||||
pip install PyQt5==5.15.9
|
||||
pip install yara-python==4.5.1
|
||||
pip install numpy==2.1.1
|
||||
@@ -21,26 +18,22 @@ pip install pillow==10.4.0
|
||||
|
||||
```
|
||||
PYAS/
|
||||
├── Driver/
|
||||
│ ├── PYAS_Driver.sys -------> 驱动程序 (0sha0 为 pyas 提供的自我保护驱动程序)
|
||||
├── Driver/ (驱动保护和微软运行库)
|
||||
│ └── ...
|
||||
│
|
||||
├── Model/
|
||||
│ ├── PYAS_Model.json -------> 病毒数据库 (数据库必须位于指定目录中)
|
||||
├── Engine/ (深度学习和规则数据库)
|
||||
│ └── ...
|
||||
│
|
||||
├── Rules/
|
||||
│ ├── Yara_Rules.yar ---------> Yara 规则 (纯文本格式的 yara 规则)
|
||||
│ ├── Yara_Rules.yrc ---------> 编译规则 (编译格式的 yara 规则)
|
||||
├── Exten/ (扩展功能与系统修复工具)
|
||||
│ └── ...
|
||||
│
|
||||
├── PYAS.py ---------------------> PYAS主程序(包含动画、扫描、保护等功能...)
|
||||
├── PYAS_Engine.py -------------> 转换数据库(用于转换剖面图和预报数据)
|
||||
├── PYAS_Suffixes.py -----------> 文件后缀(包含扫描文件后缀和常用后缀)
|
||||
├── PYAS_Interface.py ----------> PyQt5界面(使用QT设计器,需与主程序搭配使用)
|
||||
├── PYAS_Resource.py -----------> PyQt5资源(状态图片、图标包、按钮图标...)
|
||||
├── PYAS_Language.py -----------> 翻译词典(繁体中文、简体中文、英文)
|
||||
├── PYAS_Version.py ------------> 安裝信息(文件信息、版本信息、原名...)
|
||||
├── PYAS.py (PYAS主程序含界面交互与保护功能)
|
||||
├── PYAS_Engine.py (深度学习预测和规则扫描器)
|
||||
├── PYAS_Suffixes.py (获取扫描或事件文件的后缀)
|
||||
├── PYAS_Interface.py (搭配主程序的Qt设计介面)
|
||||
├── PYAS_Resource.py (状态图片和图标和按钮图片)
|
||||
├── PYAS_Language.py (繁体中文和简体中文和英文翻译)
|
||||
├── PYAS_Version.py (版本和讯息名称和打包文件名)
|
||||
└── ...
|
||||
```
|
||||
|
||||
@@ -70,6 +63,6 @@ Windows 8.1, 10, 11 (64-bit), 内存 500MB, 存储 200MB 或更高
|
||||
|
||||
## 特别感谢
|
||||
|
||||
360, Wix, VirusShare, mtkiao129, AV-T Team of LisectGroup
|
||||
Wix, mtkiao129, 0sha0, AV-T Team of LisectGroup
|
||||
|
||||
Copyright© 2020~2024 PYAS Security By 87owo
|
||||
+11
-18
@@ -5,11 +5,8 @@
|
||||
## 安裝要求
|
||||
|
||||
```
|
||||
pip install psutil==5.9.5
|
||||
pip install pefile==2023.2.7
|
||||
pip install requests==2.31.0
|
||||
pip install pyperclip==1.8.2
|
||||
pip install pywin32==306
|
||||
pip install PyQt5==5.15.9
|
||||
pip install yara-python==4.5.1
|
||||
pip install numpy==2.1.1
|
||||
@@ -21,26 +18,22 @@ pip install pillow==10.4.0
|
||||
|
||||
```
|
||||
PYAS/
|
||||
├── Driver/
|
||||
│ ├── PYAS_Driver.sys -------> 驅動程式 (0sha0 為 pyas 提供的自我保護驅動程式)
|
||||
├── Driver/ (驅動防護和微軟運行庫)
|
||||
│ └── ...
|
||||
│
|
||||
├── Model/
|
||||
│ ├── PYAS_Model.json -------> 病毒資料庫 (資料庫必須位於指定目錄)
|
||||
├── Engine/ (深度學習和規則數據庫)
|
||||
│ └── ...
|
||||
│
|
||||
├── Rules/
|
||||
│ ├── Yara_Rules.yar ---------> Yara 規則 (純文字格式的 yara 規則)
|
||||
│ ├── Yara_Rules.yrc ---------> 編譯規則 (編譯格式的 yara 規則)
|
||||
├── Exten/ (擴展功能與系統修復工具)
|
||||
│ └── ...
|
||||
│
|
||||
├── PYAS.py ---------------------> PYAS主程式(包含動畫、掃描、保護等功能...)
|
||||
├── PYAS_Engine.py -------------> 轉換資料庫(用於轉換剖面圖和預報資料)
|
||||
├── PYAS_Suffixes.py -----------> 文件後綴(包含掃描文件後綴和常用後綴)
|
||||
├── PYAS_Interface.py ----------> PyQt5介面(使用QT設計器,需與主程式搭配使用)
|
||||
├── PYAS_Resource.py -----------> PyQt5資源(狀態圖片、圖示包、按鈕圖示...)
|
||||
├── PYAS_Language.py -----------> 翻譯字典(繁體中文、簡體中文、英文)
|
||||
├── PYAS_Version.py ------------> 安裝資訊(檔案資訊、版本資訊、原名...)
|
||||
├── PYAS.py (PYAS主程序含介面交互與防護功能)
|
||||
├── PYAS_Engine.py (深度學習預測和規則掃描器)
|
||||
├── PYAS_Suffixes.py (獲取掃描或事件檔案的副檔名)
|
||||
├── PYAS_Interface.py (搭配主程序的Qt設計介面)
|
||||
├── PYAS_Resource.py (狀態圖片圖標和按鈕圖片)
|
||||
├── PYAS_Language.py (繁體中文和簡體中文和英文翻譯)
|
||||
├── PYAS_Version.py (檔案版本和訊息名稱和打包檔名)
|
||||
└── ...
|
||||
```
|
||||
|
||||
@@ -70,6 +63,6 @@ Windows 8.1, 10, 11 (64-bit),記憶體 500MB, 磁碟容量 200MB 或更高
|
||||
|
||||
## 特別感謝
|
||||
|
||||
Wix, 0sha0, mtkiao129, AV-T Team of LisectGroup
|
||||
Wix, mtkiao129, 0sha0, AV-T Team of LisectGroup
|
||||
|
||||
Copyright© 2020~2024 PYAS Security By 87owo
|
||||
Reference in new issue
Block a user