Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
87owo authored Feb 10, 2024
1 parent 2f06f2e commit bddaca2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions PYAS.py
Original file line number Diff line number Diff line change
Expand Up @@ -1285,14 +1285,19 @@ def protect_proc_thread(self):
pass

def protect_file_thread(self):
hDir = win32file.CreateFile("C:/Users/",win32con.GENERIC_READ,win32con.FILE_SHARE_READ|win32con.FILE_SHARE_WRITE|win32con.FILE_SHARE_DELETE,None,win32con.OPEN_EXISTING,win32con.FILE_FLAG_BACKUP_SEMANTICS,None)
hDir = win32file.CreateFile("C:/",win32con.GENERIC_READ,win32con.FILE_SHARE_READ|win32con.FILE_SHARE_WRITE|win32con.FILE_SHARE_DELETE,None,win32con.OPEN_EXISTING,win32con.FILE_FLAG_BACKUP_SEMANTICS,None)
while self.file_protect:
for action, file in win32file.ReadDirectoryChangesW(hDir,10485760,True,win32con.FILE_NOTIFY_CHANGE_FILE_NAME|win32con.FILE_NOTIFY_CHANGE_DIR_NAME|win32con.FILE_NOTIFY_CHANGE_ATTRIBUTES|win32con.FILE_NOTIFY_CHANGE_SIZE|win32con.FILE_NOTIFY_CHANGE_LAST_WRITE|win32con.FILE_NOTIFY_CHANGE_SECURITY,None,None):
try:
fpath = str(f"C:/Users/{file}").replace("\\", "/")
fpath = str(f"C:/{file}").replace("\\", "/")
ftype = str(f".{fpath.split('.')[-1]}").lower()
if action == 3 and ftype in slist and os.path.getsize(fpath) <= 20971520:
if self.api_scan(fpath) or self.pe_scan(fpath):
if action == 2 and ":/Users" in fpath and ftype in alist:
if "/AppData/" not in fpath:
self.proc.kill()
file = self.proc.exe().replace("\\", "/")
self.send_notify(self.trans("勒索行為攔截: ")+file)
elif action == 3 and ":/Windows" not in fpath and ftype in slist:
if os.path.getsize(fpath) <= 20971520 and self.api_scan(fpath):
os.remove(fpath)
self.send_notify(self.trans("惡意軟體刪除: ")+fpath)
except:
Expand Down
2 changes: 1 addition & 1 deletion PYAS_Language.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"惡":"恶","據":"据","庫":"库","經":"经","敗":"败"},
"en_US": {"已開啟":"On","已關閉":"Off","已开启":"On","已关闭":"Off",",":", ",
"立即刪除":"Delete Now","安全模式":"Safe Mode","官方網站":"Website",
"惡意檔案":"Virus ","惡意軟體":"Malware ","勒索軟體":"Ransom ",
"惡意檔案":"Virus ","惡意軟體":"Malware ","勒索行為":"Ransom ",
"惡意腳本":"Script ","惡意行為":"Behavior ","可疑軟體":"Suspicious ",
"許可條款":"License Terms","惡意":"Malicious","可疑":"Suspicious",
"啟用":"Enable ","禁用":"Disable ","正在初始化中":"Initializing ",
Expand Down

0 comments on commit bddaca2

Please sign in to comment.