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.3k stars 281 forks source link

[BUG] RuntimeError: the format of obfuscated script is incorrect #1936

Open PidgeyBE opened 2 days ago

PidgeyBE commented 2 days ago

Pyarmor version: 8.5.11 Docker env: python:3.12.5-slim-bookworm

The issue is very similar to https://github.com/dashingsoft/pyarmor/issues/1275

  1. We Pyarmor a python package via
    pyarmor gen  --output $BUILD_DIR -r --exclude "tests/"  --exclude "setup.py" \
    --obf-code 0 --platform linux.x86_64 --platform linux.aarch64 $SRC_DIR
  2. We then pip install that package when building a docker image and get
    7.919         File "/tmp/pip-build-env-7ta15lqb/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 318, in run_setup
    7.919           exec(code, locals())
    7.919         File "<frozen __main__>", line 3, in <module>
    7.919       RuntimeError: the format of obfuscated script is incorrect (1:1266)

-> The code works up to python 3.12.4 but fails for python 3.12.5 and 3.12.6.

jondy commented 2 days ago
  1. We Pyarmor a python package via pyarmor gen --output $BUILD_DIR -r ...

In this machine, make sure Python version is also Python 3.12.5+

jondy commented 2 days ago

Also please do a simple test, first obfuscate one simple script hello.py, then only run it in docker env. Check it works or not.