maya-umbrella 0.14.2__py2.py3-none-any.whl → 0.15.0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- __version__ = "0.14.2"
1
+ __version__ = "0.15.0"
@@ -9,16 +9,28 @@ virus20240430_sig1 = VirusSignature("virus20240430", "python(.*);.+exec.+(pyCode
9
9
  # https://regex101.com/r/2D14UA/1
10
10
  virus20240430_sig2 = VirusSignature("virus20240430", r"^\['.+']")
11
11
 
12
+ # maya_secure_system virus signatures
13
+ maya_secure_system_sig1 = VirusSignature("maya_secure_system", "import maya_secure_system")
14
+ maya_secure_system_sig2 = VirusSignature("maya_secure_system", r"maya_secure_system\.MayaSecureSystem\(\)\.startup\(\)")
15
+
12
16
  JOB_SCRIPTS_VIRUS_SIGNATURES = [
13
17
  "petri_dish_path.+cmds.internalVar.+",
14
18
  "userSetup",
15
19
  "fuckVirus",
16
20
  virus20240430_sig1.signature,
17
21
  virus20240430_sig2.signature,
22
+ maya_secure_system_sig1.signature,
23
+ maya_secure_system_sig2.signature,
18
24
  ]
19
25
 
20
26
  FILE_VIRUS_SIGNATURES = [
21
27
  "import vaccine",
22
28
  "cmds.evalDeferred.*leukocyte.+",
23
29
  virus20240430_sig1.signature,
30
+ maya_secure_system_sig1.signature,
31
+ ]
32
+
33
+ MAYA_SECURE_SYSTEM_VIRUS_SIGNATURES = [
34
+ maya_secure_system_sig1.signature,
35
+ maya_secure_system_sig2.signature,
24
36
  ]
@@ -0,0 +1,55 @@
1
+ # Import built-in modules
2
+ import os
3
+
4
+ # Import local modules
5
+ from maya_umbrella.filesystem import check_virus_by_signature
6
+ from maya_umbrella.filesystem import check_virus_file_by_signature
7
+ from maya_umbrella.maya_funs import check_reference_node_exists
8
+ from maya_umbrella.maya_funs import cmds
9
+ from maya_umbrella.maya_funs import get_attr_value
10
+ from maya_umbrella.signatures import MAYA_SECURE_SYSTEM_VIRUS_SIGNATURES
11
+ from maya_umbrella.vaccine import AbstractVaccine
12
+
13
+
14
+ class Vaccine(AbstractVaccine):
15
+ """A class for handling the maya_secure_system virus."""
16
+
17
+ virus_name = "maya_secure_system"
18
+
19
+ def collect_infected_nodes(self):
20
+ """Collect all bad nodes related to the virus."""
21
+ for script_node in cmds.ls(type="script"):
22
+ if check_reference_node_exists(script_node):
23
+ continue
24
+ for attr_name in ("before", "after"):
25
+ script_string = get_attr_value(script_node, attr_name)
26
+ if not script_string:
27
+ continue
28
+ if check_virus_by_signature(script_string, MAYA_SECURE_SYSTEM_VIRUS_SIGNATURES):
29
+ self.report_issue(script_node)
30
+ self.api.add_infected_node(script_node)
31
+
32
+ def collect_issues(self):
33
+ """Collect all issues related to the virus."""
34
+ # Add malicious files that need to be deleted
35
+ self.api.add_malicious_files(
36
+ [
37
+ os.path.join(self.api.local_script_path, "maya_secure_system.py"),
38
+ os.path.join(self.api.local_script_path, "maya_secure_system.pyc"),
39
+ ],
40
+ )
41
+ self.collect_infected_user_setup_py()
42
+ self.collect_infected_nodes()
43
+
44
+ def collect_infected_user_setup_py(self):
45
+ """Collect all bad userSetup.py files related to the virus."""
46
+ user_setup_py_files = [
47
+ os.path.join(self.api.local_script_path, "userSetup.py"),
48
+ os.path.join(self.api.user_script_path, "userSetup.py"),
49
+ ]
50
+
51
+ for user_setup_py in user_setup_py_files:
52
+ if os.path.exists(user_setup_py):
53
+ if check_virus_file_by_signature(user_setup_py):
54
+ self.report_issue(user_setup_py)
55
+ self.api.add_infected_file(user_setup_py)
@@ -1,9 +1,9 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: maya_umbrella
3
- Version: 0.14.2
3
+ Version: 0.15.0
4
4
  Summary: A better Autodesk Maya antivirus tool detects and removes malicious.
5
- Home-page: https://github.com/loonghao/maya_umbrella
6
5
  License: MIT
6
+ License-File: LICENSE
7
7
  Keywords: Autodesk Maya,python,Maya,dcc,antivirus,Security Tools,maya_umbrella
8
8
  Author: longhao
9
9
  Author-email: hal.long@outlook.com
@@ -19,11 +19,16 @@ Classifier: Programming Language :: Python :: 3.9
19
19
  Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
22
24
  Project-URL: Documentation, https://github.com/loonghao/maya_umbrella
25
+ Project-URL: Homepage, https://github.com/loonghao/maya_umbrella
23
26
  Project-URL: Repository, https://github.com/loonghao/maya_umbrella
24
27
  Description-Content-Type: text/markdown
25
28
 
26
- ![maya_umbrella.ing Banner](https://raw.githubusercontent.com/loonghao/maya_umbrella/main/resources/banner.png)
29
+ ![Maya Umbrella Banner](https://raw.githubusercontent.com/loonghao/maya_umbrella/main/resources/banner.png)
30
+
31
+ [English](https://github.com/loonghao/maya_umbrella/blob/main/README.md) | [中文](https://github.com/loonghao/maya_umbrella/blob/main/README_zh.md)
27
32
 
28
33
  [![Python Version](https://img.shields.io/pypi/pyversions/maya-umbrella)](https://img.shields.io/pypi/pyversions/maya-umbrella)
29
34
  [![Nox](https://img.shields.io/badge/%F0%9F%A6%8A-Nox-D85E00.svg)](https://github.com/wntrblm/nox)
@@ -46,7 +51,7 @@ Description-Content-Type: text/markdown
46
51
  [![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors-)
47
52
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
48
53
 
49
- A better Autodesk Maya antivirus tool detects and removes malicious.
54
+ A better Autodesk Maya antivirus tool that detects and removes malicious code.
50
55
 
51
56
  This tool is designed to provide a robust solution for identifying and resolving any potential viruses within Autodesk
52
57
  Maya.
@@ -54,144 +59,107 @@ It ensures a secure and seamless user experience by proactively scanning for thr
54
59
 
55
60
  It can be provided as an API for seamless integration into your existing pipeline.
56
61
 
57
- # 安装
62
+ # Installation
58
63
 
59
- ## pip 安装
64
+ ## pip installation
60
65
  maya_umbrella is distributed as a standard pipy package, so we can install it via pip install.
61
-
62
- maya_umbrella是以标准pipy包去发布的,所以我们可以通过pip install去安装
63
66
  ```shell
64
67
  your/maya-root/mayapy -m pip install maya-umbrella
65
68
  ```
66
- ## 一键安装
69
+ ## One-click installation
67
70
  Download the corresponding version of the zip package in the release, unzip it and double-click `install.bat` to install it.
68
71
 
69
- 在release里面下载对应版本的zip包,解压后双击`install.bat`即可安装
70
-
71
- 更新版本
72
+ Update version
72
73
  ```shell
73
74
  your/maya-root/mayapy -m pip install maya-umbrella --upgrade
74
75
  ```
75
- 卸载
76
+ Uninstall
76
77
  ```shell
77
78
  your/maya-root/mayapy -m pip uninstall maya-umbrella
78
79
  ```
79
80
 
80
- # 开发环境设置
81
+ # Development Environment Setup
81
82
 
82
83
  Set up the development environment using a virtual environment,
83
84
  and it is recommended to use Python 3.8 or higher versions.
84
85
 
85
- 通过虚拟环境去设置开发环境, 推荐python-3.8以上的版本
86
-
87
- 通过pip安装相关开发依赖
86
+ Install development dependencies via pip
88
87
 
89
88
  ```shell
90
89
  pip install -r requirements-dev.txt
91
90
  ```
92
91
 
93
- # 开发调试
92
+ # Development Debugging
94
93
 
95
94
 
96
- ## 在maya中测试
97
- With `nox -s maya -- <maya version>`, start maya.
98
- Nox will dynamically register a nox session based on your local installation of maya,
99
- e.g. if you have `maya-2018` installed locally, then you can start maya with a test environment.
100
- Then you can start maya with a test environment via
101
-
102
- 通过`nox -s maya -- <maya version>`, 启动maya.
103
- nox会动态根据你本地安装得maya去注册nox session, 比如你本地安装了`maya-2018`,
104
- 那么通过可以启动带有测试环境的maya
95
+ ## Testing in Maya
96
+ With `nox -s maya -- <maya version>`, start Maya.
97
+ Nox will dynamically register a nox session based on your local installation of Maya,
98
+ e.g. if you have `maya-2018` installed locally, then you can start Maya with a test environment.
105
99
 
106
100
  ```shell
107
101
  nox -s maya -- 2018
108
102
  ```
109
103
  **Note: there are two `-` between maya and the version number**.
110
104
 
111
- Starting maya and executing the following code in the script editor will dynamically open the ma file from `<repo>/tests/virus/` to test it.
112
-
113
- **注意:maya 与 版本号之间有 俩个`-`**
114
-
115
- 启动maya后在脚本编辑器中执行下面得代码,就会动态的从`<repo>/tests/virus/`里面去open ma文件去进行测试.
105
+ After starting Maya, executing the following code in the script editor will dynamically open the ma file from `<repo>/tests/virus/` to test it.
116
106
 
117
107
  ```python
118
108
  import manual_test_in_maya
119
109
 
120
110
  manual_test_in_maya.start()
121
111
  ```
122
- It is also possible to execute the corresponding tests via pytest, which also requires a local installation of the corresponding maya
123
-
124
- 也可以通过pytest去执行对应的测试,也需要本地安装了对应的maya
112
+ It is also possible to execute the corresponding tests via pytest, which also requires a local installation of the corresponding Maya
125
113
 
126
114
  ```shell
127
115
  nox -s maya -- 2018 --test
128
116
  ```
129
117
  **Note: Command line crash may occur in versions below maya-2022 (PY2)**.
130
118
 
131
- **注意:在maya-2022 (PY2) 以下的版本可能会出现命令行crash的情况**
132
119
 
133
-
134
- ## 增加新的疫苗
135
- Create a new py in `<repo>/maya_umbrella/vaccines/`, since many viruses don't have a specific name, we'll use `vaccine<id>.py`.
120
+ ## Adding New Vaccines
121
+ Create a new py in `<repo>/maya_umbrella/vaccines/`. Since many viruses don't have a specific name, we'll use `vaccine<id>.py`.
136
122
  Inherit `from maya_umbrella.vaccine import AbstractVaccine` and call the class `Vaccine`, and then write the virus collection logic.
137
123
 
138
- 在`<repo>/maya_umbrella/vaccines/` 新建一个py, 因为有很多病毒没有具体的名字代号,我们统一以`vaccine<id>.py`
139
- 继承`from maya_umbrella.vaccine import AbstractVaccine`并且class名字叫`Vaccine`即可, 然后去写具体的收集病毒逻辑
140
-
141
- ## 代码检查
124
+ ## Code Check
142
125
 
143
126
  We can use the encapsulated `nox` command to perform a code check.
144
127
 
145
- 我们可以利用封装好的`nox`命令去执行进行代码检查
146
-
147
128
  ```shell
148
129
  nox -s lint
149
130
  ```
150
131
 
151
- 进行代码整理
132
+ Format code
152
133
  ```shell
153
134
  nox -s lint-fix
154
135
  ```
155
136
 
156
- # 生成安装包
137
+ # Generate Installation Package
157
138
  Execute the following command to create a zip under <repo>/.zip, with `--version` the version number of the current tool.
158
139
 
159
140
  **Note: between `make-zip` and `--version` there are two `-`**.
160
141
 
161
- 执行下面的命令可以在<repo>/.zip下面创建zip,参数 `--version` 当前工具的版本号
162
-
163
- **注意:`make-zip` 与 `--version`之间有 俩个`-`**
164
-
165
142
  ```shell
166
143
  nox -s make-zip -- --version 0.5.0
167
144
  ```
168
145
 
169
- # 环境变量
170
- We can use the following environment variables to modify some of the settings of maya_umbrella,
171
-
146
+ # Environment Variables
147
+ We can use the following environment variables to modify some of the settings of maya_umbrella,
172
148
  so that companies with pipelines can better integrate them.
173
149
 
174
150
  Modify the log saving directory of maya umbrella, the default is the windows temp directory.
175
151
 
176
- 我们可以通过下列环境变量去修改maya_umbrella的一些设置,方便有pipeline的公司可以更好的集成
177
-
178
- 修改maya umbrella的日志保存目录,默认是windows temp目录
179
-
180
152
  ```shell
181
153
  MAYA_UMBRELLA_LOG_ROOT
182
154
  ```
183
155
  Change the name of the log file for maya umbrella, default is `maya_umbrella`.
184
156
 
185
- 修改maya umbrella的日志文件名称, 默认是`maya_umbrella`
186
-
187
157
  ```shell
188
158
  MAYA_UMBRELLA_LOG_NAME
189
159
  ```
190
160
 
191
161
  Set the log level, the default is info, can be debug can see more log information.
192
162
 
193
- 设置日志级别,默认是info, 可以是debug可以看到更多的日志信息.
194
-
195
163
  ```shell
196
164
  MAYA_UMBRELLA_LOG_LEVEL
197
165
  ```
@@ -202,53 +170,36 @@ For example:
202
170
  Your file path is `c:/your/path/file.ma`.
203
171
 
204
172
  Then the backup file path is `c:/your/path/_virus/file.ma`.
205
-
206
- 修改杀毒后文件的备份文件夹名称, 默认是`_virus`
207
- 比如:
208
- 你文件路径是 `c:/your/path/file.ma`
209
- 那么备份文件路径是 `c:/your/path/_virus/file.ma`
210
173
  ```shell
211
174
  MAYA_UMBRELLA_BACKUP_FOLDER_NAME
212
175
  ```
213
176
  The default display language, including logging printouts, etc.
214
-
215
- is set by default according to your current maya interface language,
216
-
177
+ is set by default according to your current maya interface language,
217
178
  but of course we can also set it via the following environment variables.
218
-
219
- 默认的显示语言,包含日志打印输出等,默认是根据你当前maya的界面语言来设置的,当然我们也可以通过下面的环境变量去设置.
220
179
  ```shell
221
180
  MAYA_UMBRELLA_LANG
222
181
  ```
223
182
  Ignore saving to the backup folder,
224
- *please note that if you are not clear about the consequences of this please do not modify it easily*,
225
- the default batch antivirus will automatically back up the source file to the current file's backup folder
183
+ *please note that if you are not clear about the consequences of this please do not modify it easily*,
184
+ the default batch antivirus will automatically back up the source file to the current file's backup folder
226
185
  after the batch antivirus.
227
186
 
228
- 忽略保存到备份文件夹,*请注意,如果你不清楚这个会导致的后果请不要轻易修改*,默认批量杀毒后会把源文件自动备份到当前文件的备份文件夹.
229
-
230
187
  ```shell
231
188
  MAYA_UMBRELLA_IGNORE_BACKUP
232
189
  ```
233
190
  If ignored please set to
234
-
235
- 如果忽略请设置为
236
191
  ```shell
237
192
  SET MAYA_UMBRELLA_IGNORE_BACKUP=true
238
193
  ```
239
194
 
240
- For the portable version of Maya,
195
+ For the portable version of Maya,
241
196
  you can specify the Maya path by adding the `MAYA_LOCATION` environment variable.
242
197
 
243
- 如果是便携版Maya,可以通过添加 `MAYA_LOCATION` 环境变量指定Maya路径
244
-
245
198
  ```shell
246
199
  SET MAYA_LOCATION=d:/your/path/maya_version/
247
200
  ```
248
201
  You can also specify a directory from the command line.
249
202
 
250
- 也可以通过命令行指定目录
251
-
252
203
  ```shell
253
204
  nox -s maya -- 2018 --install-root /your/local/maya/root
254
205
 
@@ -258,8 +209,6 @@ nox -s maya -- 2018 --install-root /your/local/maya/root
258
209
 
259
210
  Get virus files that have not been repaired in the current scenario.
260
211
 
261
- 获取当前场景没有被修复的病毒文件
262
-
263
212
  ```python
264
213
  from maya_umbrella import MayaVirusDefender
265
214
 
@@ -268,8 +217,6 @@ print(api.get_unfixed_references())
268
217
  ```
269
218
 
270
219
  Batch repair of files, via regular expressions.
271
-
272
- 批量修复文件, 通过正则表达式
273
220
  ```python
274
221
  from maya_umbrella import MayaVirusScanner
275
222
 
@@ -278,7 +225,7 @@ print(api.scan_files_from_pattern("your/path/*.m[ab]"))
278
225
 
279
226
  ```
280
227
 
281
- # 案例
228
+ # Examples
282
229
 
283
230
  If you want to quickly go through maya standalone and batch clean up maya files.
284
231
 
@@ -291,14 +238,6 @@ For example, if you have `2018` installed locally, Then `nox -s maya -- 2018 --s
291
238
 
292
239
  The following syntax starts a maya-2020 environment to dynamically check for viruses from the `c:/test` folder.
293
240
 
294
- 如果你想要快速通过maya standalone去批量清理maya文件,
295
- 可以`下载`或者`git clone`当前`main`分支的工程,
296
- 根据上面指引设置好开发环境,
297
- 通过`nox`命令去启动maya `standalone`环境,maya版本根据你当前本地安装的maya为准,
298
- 比如你本地安装了`2018`,
299
- 那么就是 `nox -s maya -- 2018 --standalone`
300
- 下面的语法是启动一个maya-2020的环境去动态从`c:/test`文件夹下去查杀病毒
301
-
302
241
  ```shell
303
242
  nox -s maya -- 2018 --standalone --pattern c:/test/*.m[ab]
304
243
  ```
@@ -1,5 +1,5 @@
1
1
  maya_umbrella/__init__.py,sha256=rcCnFWmELeJsGoKvLHyzC_GmZu-eT1QXjQCHRGj6HuQ,529
2
- maya_umbrella/__version__.py,sha256=hR3o7j_Ti5BahUZJjIeDkTEL09cseYBFJTIE0WEh8nw,23
2
+ maya_umbrella/__version__.py,sha256=wGIgxINRfcIKyk0LjIbc9UF9UwuclyCQZv_axTUzwNw,23
3
3
  maya_umbrella/_vendor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  maya_umbrella/_vendor/atomicwrites/LICENSE,sha256=h4Mp8L2HitAVEpzovagvSB6G7C6Agx6QnA1nFx2SLnM,1069
5
5
  maya_umbrella/_vendor/atomicwrites/__init__.py,sha256=myvxvKRBb7vebPTSUiAopsRrvsm6VojiAvET1xohT-4,6970
@@ -27,13 +27,14 @@ maya_umbrella/locales/zh_CN.json,sha256=eQbsZsUj87B5HhHi_usTNGzwo01MLjkHKM11KWhh
27
27
  maya_umbrella/log.py,sha256=SLgBPpnDpkDhOU94UHNPqanhKr6aZiJn4XdwIsoXD4M,1355
28
28
  maya_umbrella/maya_funs.py,sha256=_4LaMO4cRTCcbgNj2ei7UtSLAnCRY_ylHiLGKgvM4sE,3652
29
29
  maya_umbrella/scanner.py,sha256=1-GY-Jx1iECnAo-L2Lw5e5t5zaQsMwWDH0A4TOjlIww,4428
30
- maya_umbrella/signatures.py,sha256=GmsqpGa98WLg1ZeixxVEcTypveM0kc5dA5kb56y9kVI,658
30
+ maya_umbrella/signatures.py,sha256=FkQ5VpiP7tTrF0K7H6sFVe_E3RB9uImZGPldxyRpegk,1148
31
31
  maya_umbrella/vaccine.py,sha256=aBW6pdT4tD4OMBPZ-d3E4_n16Rylz-2gb7JWzMZVPK0,1022
32
32
  maya_umbrella/vaccines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
33
  maya_umbrella/vaccines/vaccine1.py,sha256=WLo1uJElTLSjVCf5CBtRNU4HKs63my5mkHiGqTfnNEE,489
34
34
  maya_umbrella/vaccines/vaccine2.py,sha256=qYiI_-BSojgN7j4esYCGBDLeyBSneDOGUwZhKHccxh8,2170
35
35
  maya_umbrella/vaccines/vaccine3.py,sha256=vcjGt0jZxBDb7iCUMmBWBQGPZD3BFH96gL6pPxNwDr0,3676
36
- maya_umbrella-0.14.2.dist-info/LICENSE,sha256=tJf0Pz8q_65AjEkm3872K1cl4jGil28vJO5Ko_LhUqc,1060
37
- maya_umbrella-0.14.2.dist-info/METADATA,sha256=U5BOnzsheso13RpGbApuxgWrkrJuYrmRg1WHVlfu2dc,15755
38
- maya_umbrella-0.14.2.dist-info/WHEEL,sha256=IrRNNNJ-uuL1ggO5qMvT1GGhQVdQU54d6ZpYqEZfEWo,92
39
- maya_umbrella-0.14.2.dist-info/RECORD,,
36
+ maya_umbrella/vaccines/vaccine4.py,sha256=IftMSf9CM6NJ9FmTXeRTYQ3qiYVrRSzJxMyHDdE2tQc,2272
37
+ maya_umbrella-0.15.0.dist-info/METADATA,sha256=8cCvHo7XX-OV7InxxPU6sAVzEBm4yzxoULOgP4j6C4w,13134
38
+ maya_umbrella-0.15.0.dist-info/WHEEL,sha256=MICUlqIgkuEnKh9OWy254Ca7q2MHOW-q0u36TZR60nU,92
39
+ maya_umbrella-0.15.0.dist-info/licenses/LICENSE,sha256=tJf0Pz8q_65AjEkm3872K1cl4jGil28vJO5Ko_LhUqc,1060
40
+ maya_umbrella-0.15.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.0
2
+ Generator: poetry-core 2.2.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2.py3-none-any