Repository navigation
Expand file tree
/
Copy pathdefault.cfg
More file actions
457 lines (350 loc) · 11.7 KB
/
Copy pathdefault.cfg
File metadata and controls
457 lines (350 loc) · 11.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
[pyarmor]
;; Pyarmor version
major = 8
minor = 5
patch = 12
;; Compatible core version
cli.core = 6.5.3
;; Deprecated since Pyarmor 8.2.5
; cli.runtime = 3.2.5
;; Default timeout when send request to remote server for
;; check Pyarmor license
;; register Pyarmor license
timeout = 6
regurl = https://api.dashingsoft.com/product/key/enter/%s/?
buyurl = https://order.mycommerce.com/product?vendorid=200089125&productid=301044051
[logging]
debug_logfile = .pyarmor/pyarmor.debug.log
trace_logfile = .pyarmor/pyarmor.trace.log
[finder]
recursive = 0
;; includes =
excludes = */__pycache__
pyexts = .py .pyw
;; Data files need to copy to output path
;; *.txt only copy .txt file
;; * means all data files
;; 0 means nothing to copy
data_files = 0
;;
;; How to find dependent packages
;;
findall = 0
[builder]
;;
;; Part 1: only global/local settings, not in module level
;;
;; File encoding to read scripts
encoding = utf-8
;; Trace obfuscation
enable_trace = 0
;; Use Themida to protect runtime package in windows
enable_themida = 0
;; Import prefix to import runtime package
import_prefix = 0
;; Sometimes __file__ is not defined, replace it with __name__ to fix this issue
bootstrap_file = __file__
;; Exclude co objects by co_name
exclude_co_names = <lambda> <listcomp> <setcomp> <dictcomp> <genexpr>
;; Common modules which are no restrict
exclude_restrict_modules = __init__
;; Outer key name
outer_keyname = pyarmor.rkey
;; The final marker is "# %s: " % VALUE
;; If VALUE == "false", then disable inline plugin
inline_plugin_marker = pyarmor
;; Default plugins
plugins = CodesignPlugin DarwinUniversalPlugin
;; Using shared runtime package
; use_runtime = /path/to/runtime
;; How many loops for jit iv
jit_iv_threshold = 100
;; Now "argument" is not available
rft_enables = builtin import function class method global local
;; Exclude unknown attrs automically
; 0 disable auto exclude, use auto include
; 1 auto exclude and load .pyarmor/rft/exclude_table
; 2 auto exclude but not load exclude_table
rft_auto_exclude = 1
;; Export all the names in module attribute __all__
;; It means leave all the names in the __all__ as they're
rft_auto_export = 1
;; Enable dev mode for rft
rft_dev_mode = 0
;; Export module and classes
; rft_export_names = pkg.mod pkg.mod.cls pkg.mod.attr
;; How to reform import statement
;; 0 Convert import statement to security form
;; 1 Simple rename the imported name
rft_simple_import = 0
;; Extra paths to find dependent package
; pypaths =
;; List module names couldn't be found automically
; hidden_imports =
;; If it's enabled, disable some features to make scripts work with nuitka
;; convenient settings for nuitka, but now it's TBD
; support_nuitka = 0
;; Group device flag for machine id
group_device_flag = 22
;; Whether propagate package private configuration to module
;;
;; If enable, "pkg.mod" will inherit "pkg" configuration
;;
;; Otherwise, "pkg.mod" doesn't merge "pkg" configuration
propagate_package_options = 0
;;
;; Part 2: global/local/module level options
;;
;; The argument optimize specifies the optimization level of the
;; compiler; the default value of -1 selects the optimization level of
;; the interpreter as given by -O options. Explicit levels are 0 (no
;; optimization; __debug__ is true), 1 (asserts are removed, __debug__
;; is false) or 2 (docstrings are removed too).
optimize = -1
;; It's not used now
type_comments = false
;; Write refactor result scripts
trace_rft = 0
enable_jit = 0
enable_bcc = 0
enable_rft = 0
;; assert: call import
assert_call = 0
assert_import = 0
;; mix string constant
mix_str = 0
;; hide function name in traceback
;; 1: hide function.__name__
;; 2: also hide function.__qualname__ (not implemented)
mix_coname = 0
;; mix local variables
mix_localnames = 1
;; mix argument names, it also clears annotations
mix_argnames = 0
obf_module = 1
obf_code = 1
;; 0: no wrap mode
;; 1: simple wrap mode
;; 2: full wrap mode
;; Since Python 3.12, "2" is same as "1", both of them use full wrap mode
wrap_mode = 1
restrict_module = 1
;;
;; Advanced features
;;
;; check license when importing each module
import_check_license = 0
;; clear module co after importing
clear_module_co = 1
;; clear frame.f_locals for wrap mode, it's meanless for non-wrap mode
clear_frame_locals = 0
;; Model level to rename attributes ruler
;;
;; x.y.z:?.%.z
;;
;; ? auto map
;; % force rename
;;
; rft_rulers =
;; Model level to exclude names
; rft_excludes =
;; Whether encrypt name in statement import
rft_mix_import_name = 0
;; Unused, now this option isn't used
;; Strip leading name package
strip_package_name = 1
;;
;; Compatiable options
;;
;; Since pyarmor 8.5.3, pyarmor.core 6.5.1
;;
;; If private_module_same_as_restrict is set to 1, --private is same as --restrict, it's default behaviours in previous version. Both --private and --restrict don't allow plain scripts to import the obfsucated modules
;;
;; But the right way should be
;;
;; --private allow
;; --restrict not allow
;;
;; When need this behaviours, set private_module_same_as_restrict is to 0
;;
private_module_same_as_restrict = 0
[runtime]
;; Generate extension for all Python3.7+
universal = 0
;; Default runtime package name
package_name_format = pyarmor_runtime_{suffix}
;; The file ext only keep .so/.pyd, for example
;; pyarmor_runtime.cpython-37m-darwin.so
;; if simple_extension_name == 1 then
;; pyarmor_runtime.so
simple_extension_name = 1
;; Whether patching extension to embedded runtime key
;;
;; 0: do not patch extension, but store runtime key to one file
;; 1: runtime key is embedded into extension
;;
;; The purpose is to solve code sign issue for Darwin platform
;; Do not patch extension will keep code sign, so need not re-sign
;; But it need an extra file.
;;
;; Note: it's different from outer runtime key.
;;
patch_extension = 1
;; Obfuscate runtime key
;; 0: no obfuscation
;; 1: simple obfuscation
;;
obf_key_mode = 0
;; Enable outer runtime key
outer = 0
;; Pyarmor raises PyExc_RuntimeError by default
;; 0 raise PyExc_RuntimeError
;; 1 raise PyExc_SystemExit
;; 2 call libc exit to quit directly
on_error = 0
;; Check runtime key periodically, support formats:
;; 3600s
;; 60m
;; 1h
;; 1 = 1h
; period = 1
;; Expired runtime key, support 2 forms:
;;
;; 30: expired in 30 days
;; 2025-12-31
;;
; expired =
;; Check network time by those servers
;;
;; Support formats:
;;
;; [and,]host1,host2,...
;;
;; If host is start with "http://", then send http request, otherwise use ntp protocol
;;
;; If host is special name "local", return local time
;;
;; If there are many hosts, first request host1, if not get response, then request host2, ...
;;
;; If there is leading "and,", then check all the hosts and return the largest timestamp
;;
;; For example,
;;
;; pool.ntp.org
;; http://www.ntp.org
;; http://146.75.112.223
;; pool.ntp.org,http://worldtimeapi.org/api
;; pool.ntp.org,http://worldtimeapi.org/api,local
;; and,pool.ntp.org,http://worldtimeapi.org/api,local
;;
nts = local
nts_timeout = 3
;; Bind runtime key to multiple devices, one line one machine
; devices =
;; Bind runtime key to Python interperter. Each line defines a rule,
;; match all the rules. The rule formats
;;
;; D
;; S: symbol start end xxxxxx(md5)
;;
; interps =
;; Insert runtime hooks
; hooks = hooks.py
;; Enable timer
timer = 0
;; Target platforms
; platforms =
;; If there are customized runtime messages
messages = messages.cfg:utf-8
[assert.call]
;; and: function is in obfuscated script and match ruler
;; or: function is in obfuscated script or match ruler
auto_mode = and
; includes =
; excludes =
[assert.import]
;; and: module is obfuscated and match ruler
;; or: module is obfuscated or match ruler
auto_mode = and
; includes =
; excludes =
[mix.str]
;; do not mix short string len(s) < this value
threshold = 8
; includes =
; excludes =
[pack]
;; For Darwin to code sign binary file
; codesign_identify =
;; Strip output path to match archive info
strip = 0
;; How to do when the obfuscated module has no matched .pyc in bundle
;; error, issue a error and exit
;; warning, issue a warning and continue
;; ignore, do nothing
;; append, append it to archive
no_matched_pyc = error
;; Extra options to call PyInstaller when packing the obfuscated scripts
;; One option one line, name and value separted by one whitespace
;; For example
;;
;; pyi_options = -w
;; --add-data default.cfg:.
;; --icon myapp.ico
;;
;; The following options could not be used here:
;;
;; --distpath, --workpath, --specpath
;;
; pyi_options =
[bcc]
unsupported_functions = exec eval super locals __assert_armored__
unsupported_nodes = AsyncFunctionDef AsyncFor AsyncWith Await Yield YieldFrom GeneratorExp NamedExpr MatchValue MatchSingleton MatchSequence MatchMapping MatchClass MatchStar MatchAs MatchOr
;; Include and exclude function/method names
; includes =
; excludes =
;; Use opcode CALL_FUNCTION_EX to patch call
;; Global option, all scripts must be same
call_function_ex = 0
;; Generate bcc function to show right lineno in traceback
;; If disable, lineno is always function definition lineno
trace_lineno = 0
keep_nest_name = 0
;; Do not convert lambda to bcc
ignore_lambda = 0
;; Use op_mkfunc2 to build unsupported functions
enable_pure_function = 1
;; Convert comprehensions to bcc code
enable_comprehension = 1
[windows.x86_64.bcc]
cc = clang.exe
cflags = -O3 -Wno-unsequenced -fno-asynchronous-unwind-tables -fno-unwind-tables --target=x86_64-elf-windows -c -DENABLE_BCC_MEMSET
[windows.x86.bcc]
cc = clang.exe
cflags = --target=i686-elf-linux -O3 -Wno-unsequenced -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-stack-protector -fPIC -mno-sse -std=c99 -c
[linux.x86_64.bcc]
cflags = -O3 -Wno-unsequenced -fno-asynchronous-unwind-tables -fno-unwind-tables -fPIC -fno-stack-protector -c
[linux.aarch64.bcc]
cflags = -O3 -Wno-unsequenced -fno-asynchronous-unwind-tables -fno-unwind-tables -fPIC -fno-stack-protector -shared -nostdlib -DENABLE_BCC_MEMSET -Tlinux.aarch64.ldscript
[linux.x86.bcc]
cflags = -O3 -Wno-unsequenced -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-stack-protector -fPIC -c
[linux.armv7.bcc]
cflags = -O3 -Wno-unsequenced -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-stack-protector -shared -nostdlib -Tlinux.armv7.ldscript
[darwin.x86_64.bcc]
cflags = -O3 -Wno-unsequenced -fno-asynchronous-unwind-tables -fno-unwind-tables --target=x86_64-elf-gnu_linux -fPIC -c -DENABLE_BCC_MEMSET
[darwin.aarch64.bcc]
cflags = -O3 -Wno-unsequenced -fno-asynchronous-unwind-tables -fno-unwind-tables --target=arm64-macho-darwin -fPIC -fno-addrsig -fno-stack-protector -shared -nostdlib -lsystem
[android.x86_64.bcc]
cflags = -O3 -Wno-unsequenced -fno-asynchronous-unwind-tables -fno-unwind-tables -fPIC -fno-stack-protector -c
[android.aarch64.bcc]
cflags = -O3 -Wno-unsequenced -fno-asynchronous-unwind-tables -fno-unwind-tables -fPIC -fno-stack-protector -shared -nostdlib -DENABLE_BCC_MEMSET -Tlinux.aarch64.ldscript
[android.x86.bcc]
cflags = -O3 -Wno-unsequenced -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-stack-protector -fPIC -c
[android.armv7.bcc]
cflags = -O3 -Wno-unsequenced -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-stack-protector -shared -nostdlib -Tlinux.armv7.ldscript
[alpine.x86_64.bcc]
cflags = -O3 -Wno-unsequenced -fno-asynchronous-unwind-tables -fno-unwind-tables -fPIC -fno-stack-protector -c
[alpine.aarch64.bcc]
cflags = -O3 -Wno-unsequenced -fno-asynchronous-unwind-tables -fno-unwind-tables -fPIC -fno-stack-protector -shared -nostdlib -DENABLE_BCC_MEMSET -Tlinux.aarch64.ldscript
[freebsd.x86_64.bcc]
cflags = -O3 -Wno-unsequenced -fno-asynchronous-unwind-tables -fno-unwind-tables -fPIC -fno-stack-protector -c