dashingsoft / pyarmor

A tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.
http://pyarmor.dashingsoft.com
Other
3.44k stars 290 forks source link

[BUG] ERROR invalid network date format #1981

Closed hansroh closed 3 days ago

hansroh commented 4 days ago

My CI license raises error from today. I dosen't modify code related with pyarmor at all.

#14 [build  7/16] RUN pyarmor reg pyarmor-ci-4815.zip && pyarmor -v
#14 0.672 INFO     Python 3.11.0
#14 0.673 INFO     Pyarmor 9.0.4 (trial), 000000, non-profits
#14 0.675 INFO     Platform linux.x86_64
#14 0.675 INFO     register "pyarmor-ci-4815.zip"
#14 0.676 INFO     This license registration information:
#14 0.676 
#14 0.676 License Type    : pyarmor-basic
#14 0.676 License No.     : pyarmor-vax-004815
#14 0.676 License To      : Hans Roh
#14 0.676 License Product : KrackNet
#14 0.676 
#14 0.676 BCC Mode        : No
#14 0.676 RFT Mode        : No
#14 0.676 CI/CD Mode      : Yes

#12  [build  8/16] RUN pyarmor gen --outer skitaid.py:
#12 0.511 INFO     Python 3.11.0
#12 0.512 INFO     Pyarmor 9.0.4 (basic), 004815, KrackNet
#12 0.513 INFO     Platform linux.x86_64
#12 0.513 INFO     search inputs ...
#12 0.513 INFO     find script skitaid.py
#12 0.513 INFO     find 1 top resources
#12 1.294 ERROR    invalid network date format
jondy commented 4 days ago

This issue will be fixed in next pyarmor.cli.core release

For now, download the dev version from

https://pyarmor.dashingsoft.com/downloads/temp/linux.x86_64/libs/cp3.9/pytransform3.so

Overwrite /path/to/package/pyarmor/cli/core/pytransform3.so

hansroh commented 4 days ago

Another question:

I must deploy my app today.

So I run build-docker container locally and I copied files under ~/.pyarmor to /root/.pyarmor in build-docker container.

and without license registration, pyarmor Basic license works.

If on same machine, does pyarmor Basic licence work even in a docker container with just copying pyarmor license files?

Or it consumed license installable machine count? As my understanding the machine limit is 100.

hansroh commented 4 days ago

@jondy I run Python 3.11. Doesn't work.

ERROR    /usr/local/lib/python3.11/dist-packages/pyarmor/cli/core/pytransform3.so: undefined symbol: _PyFloat_Pack8
hansroh commented 4 days ago

Oh, 3.11 link exists also.

CI license works.

hansroh commented 4 days ago

Nope. dosen't work.

At the end of obfuscating,

15 53.85 INFO     write dist/kracknet/rkn/models/ssd/service_model.py
#15 53.85 INFO     obfuscating file __init__.py
#15 54.12 INFO     write dist/kracknet/rkn/models/ssd/__init__.py
#15 54.12 INFO     obfuscate scripts OK
#15 54.16 free(): invalid pointer
#15 54.35 Aborted (core dumped)
hansroh commented 4 days ago

I look into my .license.token, there is some kind of expiation date.

Until that date, I think just copying token is fine.

I will use this token today.

hansroh commented 4 days ago

@jondy I expected the pyarmor.rkey files generated from my "004815 basic" license to work with pyarmored scripts on any machine or CI pipeline, but I encountered the following error.

kracknet    | Traceback (most recent call last):
kracknet    |   File "/app/./skitaid.py", line 3, in <module>
kracknet    |     from pyarmor_runtime_004815 import __pyarmor__
kracknet    |   File "/app/pyarmor_runtime_004815/__init__.py", line 2, in <module>
kracknet    |     from .pyarmor_runtime import __pyarmor__
kracknet    | RuntimeError: Invalid input packet. (1:10748)

Today,

  1. I created pyarmor.rkey on my host machine with basic pyarmor license.
  2. Source codes were obfuscated within build-docker with --outer option and copied license.lic and .license.token.

Is the above RuntimeError a result of an unusual usage today? Or I must the obfuscation and rkey generation be performed in the same docker? (rkey which was created in bulid-docker works fine.)

If it's the latter, does it mean I need to create separate Docker containers with obfuscated code and rkey for each customer?

jondy commented 3 days ago

I have uploaded new dev version to fix crash issue, please download it agagin.

I expected the pyarmor.rkey files generated from my "004815 basic" license to work with pyarmored scripts on any machine or CI pipeline

With same license and same outer key name, the runtime key should work even if it's generated in different machine.

Please check Man page, and test it with one simple script. If it doesn't work as expected, please submit new issue.

hansroh commented 3 days ago

@jondy Maybe my mistake, I am testing now.

New dev version works fine.

Thank you.