Support Platfroms

The core of PyArmor is written by C, the prebuilt dynamic libraries include the common platforms and some embeded platforms.

Some of them are distributed with PyArmor source package, in these platforms, pyarmor could run without downloading anything. Refer to Prebuilt Libraries Distributed with PyArmor.

For the other platforms, pyarmor first searches path ~/.pyarmor/platforms/SYSTEM/ARCH, SYSTEM.ARCH is one of Standard Platform Names. If there is none, PyArmor will download it from remote server automatically. Refer to The Others Prebuilt Libraries For PyArmor.

Since v6.2.0, Super Mode is introduced, it uses the extension module pytransform directly. All the prebuilt extension files list in the table The Prebuilt Extensions For Super Mode

For all the latest platforms, refer to pyarmor-core/platforms/index.json

There may be serveral dynamic libraries with different features in each platform. The platform name with feature number suffix combines an unique name.

Each feature has its own bit

  • 1: Anti-Debug
  • 2: JIT
  • 4: ADV, advanced mode
  • 8: SUPER, super mode
  • 16: VM, vm protection mode

For example, windows.x86_64.7 means anti-debug(1), JIT(2) and advanced mode(4) supported, windows.x86_64.0 means no any feature, so highest speed.

Note that zero feature dynamic library isn’t compatible with any featured library. For security reason, the zero feature library uses different alogrithm to obfuscate the scripts. So the platform windows.x86_64.7 can not share the same obfuscated scripts with platform linux.armv7.0.

In some platforms, pyarmor doesn’t know it but there is available dynamic library in the table The Others Prebuilt Libraries For PyArmor. Just download it and save it in the path ~/.pyarmor/platforms/SYSTEM/ARCH, this command pyarmor -d download will also display this path at the beginning. It’s appreicated to send this platform information to jondy.zhao@gmail.com so that it could be recognized by pyarmor automatically.

This script will display the required information by pyarmor:

from platform import *
print('system name: %s' % system())
print('machine: %s' % machine())
print('processor: %s' % processor())
print('aliased terse platform: %s' % platform(aliased=1, terse=1))

if system().lower().startswith('linux'):
    print('libc: %s' % libc_ver())
    print('distribution: %s' % linux_distribution())

Contact jondy.zhao@gmail.com if you’d like to run PyArmor in other platform.

Standard Platform Names

These names are used in the command obfuscate, build, runtime, download to specify platform.

  • windows.x86
  • windows.x86_64
  • linux.x86
  • linux.x86_64
  • darwin.x86_64
  • vs2015.x86
  • vs2015.x86_64
  • linux.arm
  • linux.armv6
  • linux.armv7
  • linux.aarch32
  • linux.aarch64
  • android.aarch64
  • android.armv7 (New in 5.9.3)
  • uclibc.armv7 (New in 5.9.4)
  • linux.ppc64
  • darwin.arm64
  • freebsd.x86_64
  • musl.x86_64 (Renamed in 6.3.1, the old name is alpine.x86_64)
  • musl.arm (Renamed in 6.3.1, the old name is alpine.arm)
  • musl.mips32 (New in 6.3.1)
  • linux.mips64 (New in 6.3.3)
  • linux.mips64el (New in 6.3.3)
  • poky.x86

Platform Tables

Table-1. Prebuilt Libraries Distributed with PyArmor
Name Platform Arch Features Download Description
windows.x86 Windows i686 Anti-Debug, JIT, ADV _pytransform.dll Cross compile by i686-pc-mingw32-gcc in cygwin
windows.x86_64 Windows AMD64 Anti-Debug, JIT, ADV _pytransform.dll Cross compile by x86_64-w64-mingw32-gcc in cygwin
linux.x86 Linux i686 Anti-Debug, JIT, ADV _pytransform.so Built by GCC
linux.x86_64 Linux x86_64 Anti-Debug, JIT, ADV _pytransform.so Built by GCC
darwin.x86_64 MacOSX x86_64, intel Anti-Debug, JIT, ADV _pytransform.dylib Built by CLang with MacOSX10.11
Table-2. The Others Prebuilt Libraries For PyArmor
Name Platform Arch Features Download Description
vs2015.x86 Windows x86   _pytransform.dll Built by VS2015
vs2015.x86_64 Windows x64   _pytransform.dll Built by VS2015
linxu.arm Linux armv5   _pytransform.so 32-bit Armv5 (arm926ej-s)
linxu.armv6 Linux armv6 Anti-Debug, JIT _pytransform.so 32-bit Armv6 (-marm -march=armv6 -mfloat-abi=hard)
linux.armv7 Linux armv7 Anti-Debug, JIT _pytransform.so 32-bit Armv7 Cortex-A, hard-float, little-endian
linux.aarch32 Linux aarch32 Anti-Debug, JIT _pytransform.so 32-bit Armv8 Cortex-A, hard-float, little-endian
linux.aarch64 Linux aarch64 Anti-Debug, JIT _pytransform.so 64-bit Armv8 Cortex-A, little-endian
linux.ppc64 Linux ppc64le   _pytransform.so For POWER8
darwin.arm64 iOS arm64   _pytransform.dylib Built by CLang with iPhoneOS9.3.sdk
freebsd.x86_64 FreeBSD x86_64   _pytransform.so Not support harddisk serial number
musl.x86_64 Alpine Linux x86_64   _pytransform.so Built with musl-1.1.21 for Docker
musl.arm Alpine Linux arm   _pytransform.so Built with musl-1.1.21, 32-bit Armv5T, hard-float, little-endian
poky.x86 Inel Quark i586   _pytransform.so Cross compile by i586-poky-linux
android.aarch64 Android aarch64   _pytransform.so Build by android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang
android.armv7 Android armv7l   _pytransform.so Build by android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-android21-clang
uclibc.armv7 Linux armv7l   _pytransform.so Build by armv7-buildroot-uclibceabihf-gcc
windows.x86.21 Windows i686 Anti-Debug, ADV, VM _pytransform.dll Cross compile by i686-w64-mingw32-gcc in cygwin
windows.x86_64.21 Windows AMD64 Anti-Debug, ADV, VM _pytransform.dll Cross compile by x86_64-w64-mingw32-gcc in cygwin
Table-3. The Prebuilt Extensions For Super Mode
Name Platform Arch Features Download Description
darwin.x86_64.11.py39 MacOSX x86_64, intel Anti-Debug, JIT, SUPER pytransform.cpython-39-darwin.so Built by CLang with MacOSX10.11
darwin.x86_64.11.py38 MacOSX x86_64, intel Anti-Debug, JIT, SUPER pytransform.cpython-38-darwin.so Built by CLang with MacOSX10.11
darwin.x86_64.11.py37 MacOSX x86_64, intel Anti-Debug, JIT, SUPER pytransform.cpython-37m-darwin.so Built by CLang with MacOSX10.11
darwin.x86_64.11.py27 MacOSX x86_64, intel Anti-Debug, JIT, SUPER pytransform.so Built by CLang with MacOSX10.11
linux.x86_64.11.py39 Linux x86_64 Anti-Debug, JIT, SUPER pytransform.cpython-39-x86_64-linux-gnu.so Built by gcc
linux.x86_64.11.py38 Linux x86_64 Anti-Debug, JIT, SUPER pytransform.cpython-38-x86_64-linux-gnu.so Built by gcc
linux.x86_64.11.py37 Linux x86_64 Anti-Debug, JIT, SUPER pytransform.cpython-37m-x86_64-linux-gnu.so Built by gcc
linux.x86_64.11.py27 Linux x86_64 Anti-Debug, JIT, SUPER pytransform.so Built by gcc, UCS4
centos6.x86_64.11.py27 Linux x86_64 Anti-Debug, JIT, SUPER pytransform.so Built by gcc, UCS2
windows.x86_64.11.py39 Windows AMD64 Anti-Debug, JIT, SUPER pytransform.pyd Cross compile by x86_64-w64-mingw32-gcc in cygwin
windows.x86_64.11.py38 Windows AMD64 Anti-Debug, JIT, SUPER pytransform.pyd Cross compile by x86_64-w64-mingw32-gcc in cygwin
windows.x86_64.11.py37 Windows AMD64 Anti-Debug, JIT, SUPER pytransform.pyd Cross compile by x86_64-w64-mingw32-gcc in cygwin
windows.x86_64.11.py27 Windows AMD64 Anti-Debug, JIT, SUPER pytransform.pyd Cross compile by x86_64-w64-mingw32-gcc in cygwin
windows.x86.11.py39 Windows i386 Anti-Debug, JIT, SUPER pytransform.pyd Cross compile by i686-w64-mingw32-gcc in cygwin
windows.x86.11.py38 Windows i386 Anti-Debug, JIT, SUPER pytransform.pyd Cross compile by i686-w64-mingw32-gcc in cygwin
windows.x86.11.py37 Windows i386 Anti-Debug, JIT, SUPER pytransform.pyd Cross compile by i686-w64-mingw32-gcc in cygwin
windows.x86.11.py27 Windows i386 Anti-Debug, JIT, SUPER pytransform.pyd Cross compile by i686-w64-mingw32-gcc in cygwin
linux.x86.11.py39 Linux i386 Anti-Debug, JIT, SUPER pytransform.cpython-39-i386-linux-gnu.so Built by gcc
linux.x86.11.py38 Linux i386 Anti-Debug, JIT, SUPER pytransform.cpython-38-i386-linux-gnu.so Built by gcc
linux.x86.11.py37 Linux i386 Anti-Debug, JIT, SUPER pytransform.cpython-37m-i386-linux-gnu.so Built by gcc
linux.x86.11.py27 Linux i386 Anti-Debug, JIT, SUPER pytransform.so Built by gcc
linux.aarch64.11.py39 Linux aarch64 Anti-Debug, JIT, SUPER pytransform.cpython-39-aarch64-linux-gnu.so Built by gcc
linux.aarch64.11.py38 Linux aarch64 Anti-Debug, JIT, SUPER pytransform.cpython-38-aarch64-linux-gnu.so Built by gcc
linux.aarch64.11.py37 Linux aarch64 Anti-Debug, JIT, SUPER pytransform.cpython-37m-aarch64-linux-gnu.so Built by gcc
linux.aarch64.11.py27 Linux aarch64 Anti-Debug, JIT, SUPER pytransform.so Built by gcc
linux.aarch32.11.py39 Linux aarch32 Anti-Debug, JIT, SUPER pytransform.cpython-39-arm-linux-gnu.so Built by gcc
linux.aarch32.11.py38 Linux aarch32 Anti-Debug, JIT, SUPER pytransform.cpython-38-arm-linux-gnu.so Built by gcc
linux.aarch32.11.py37 Linux aarch32 Anti-Debug, JIT, SUPER pytransform.cpython-37m-arm-linux-gnu.so Built by gcc
linux.aarch32.11.py27 Linux aarch32 Anti-Debug, JIT, SUPER pytransform.so Built by gcc
linux.armv7.11.py39 Linux armv7l Anti-Debug, JIT, SUPER pytransform.cpython-39-arm-linux-gnu.so Built by gcc
linux.armv7.11.py38 Linux armv7l Anti-Debug, JIT, SUPER pytransform.cpython-38-arm-linux-gnu.so Built by gcc
linux.armv7.11.py37 Linux armv7l Anti-Debug, JIT, SUPER pytransform.cpython-37m-arm-linux-gnu.so Built by gcc
linux.armv7.11.py27 Linux armv7l Anti-Debug, JIT, SUPER pytransform.so Built by gcc
linux.armv6.11.py39 Linux armv6l Anti-Debug, JIT, SUPER pytransform.cpython-39-arm-linux-gnu.so Built by gcc
linux.armv6.11.py38 Linux armv6l Anti-Debug, JIT, SUPER pytransform.cpython-38-arm-linux-gnu.so Built by gcc
linux.armv6.11.py37 Linux armv6l Anti-Debug, JIT, SUPER pytransform.cpython-37m-arm-linux-gnu.so Built by gcc
linux.armv6.11.py27 Linux armv6l Anti-Debug, JIT, SUPER pytransform.so Built by gcc
windows.x86_64.25.py39 Windows AMD64 Anti-Debug, SUPER, VM pytransform.pyd Cross compile by x86_64-w64-mingw32-gcc in cygwin
windows.x86_64.25.py38 Windows AMD64 Anti-Debug, SUPER, VM pytransform.pyd Cross compile by x86_64-w64-mingw32-gcc in cygwin
windows.x86_64.25.py37 Windows AMD64 Anti-Debug, SUPER, VM pytransform.pyd Cross compile by x86_64-w64-mingw32-gcc in cygwin
windows.x86_64.25.py27 Windows AMD64 Anti-Debug, SUPER, VM pytransform.pyd Cross compile by x86_64-w64-mingw32-gcc in cygwin
windows.x86.25.py39 Windows i386 Anti-Debug, SUPER, VM pytransform.pyd Cross compile by i686-w64-mingw32-gcc in cygwin
windows.x86.25.py38 Windows i386 Anti-Debug, SUPER, VM pytransform.pyd Cross compile by i686-w64-mingw32-gcc in cygwin
windows.x86.25.py37 Windows i386 Anti-Debug, SUPER, VM pytransform.pyd Cross compile by i686-w64-mingw32-gcc in cygwin
windows.x86.25.py27 Windows i386 Anti-Debug, SUPER, VM pytransform.pyd Cross compile by i686-w64-mingw32-gcc in cygwin

Downloading Dynamic Library By Manual

If the machine is not connected to internet, download the corresponding dynamic library in other machine, then copy it in the right location.

First make sure there is platform index file platforms/index.json. If not, run any pyarmor command in target machine, it raises exception. For example:

pyarmor.py o --advanced 2 foo.py

INFO     PyArmor Version 6.4.2
INFO     Target platforms: Native
INFO     Getting remote file: https://github.com/dashingsoft/pyarmor-core/raw/r34.8/platforms/index.json
INFO     Could not get file from https://github.com/dashingsoft/pyarmor-core/raw/r34.8/platforms: <urlopen error timed out>
INFO     Getting remote file: https://pyarmor.dashingsoft.com/downloads/r34.8/index.json
INFO     Could not get file from https://pyarmor.dashingsoft.com/downloads/r34.8: <urlopen error timed out>
ERROR    No platform list file /data/user/.pyarmor/platforms/index.json found

There are 2 available urls in the log message, download one of them from other machine, for example:

https://pyarmor.dashingsoft.com/downloads/r34.8/index.json

And copy it to the prompt path in target machine:

/data/user/.pyarmor/platforms/index.json

Next run pyarmor command in target machine again, this time it will prompt the download file and target path. For example:

pyarmor o --advanced 2 foo.py

...
INFO Use capsule: /root/.pyarmor/.pyarmor_capsule.zip
INFO Output path is: /root/supervisor/dist
INFO Taget platforms: []
INFO Update target platforms to: [u'linux.x86_64.11.py27']
INFO Generating super runtime library to dist
INFO Search library for platform: linux.x86_64.11.py27
INFO Found available libraries: [u'linux.x86_64.11.py27']
INFO Target path for linux.x86_64.11.py27: /home/jondy/.pyarmor/platforms/linux/x86_64/11/py27
INFO Downloading library file for linux.x86_64.11.py27 ...
INFO Getting remote file: https://github.com/dashingsoft/pyarmor-core/raw/r34.8/platforms/linux.x86_64.11.py27/pytransform.so
INFO Could not get file from https://github.com/dashingsoft/pyarmor-core/raw/r34.8/platforms: <urlopen error [Errno 111] Connection refused>
INFO Getting remote file: https://pyarmor.dashingsoft.com/downloads/r34.8/linux.x86_64.11.py27/pytransform.so
INFO Could not get file from https://pyarmor.dashingsoft.com/downloads/r34.8: <urlopen error [Errno 111] Connection refused>
ERROR Download library file failed

Download it as before, for example

https://github.com/dashingsoft/pyarmor-core/raw/r34.8/platforms/linux.x86_64.11.py27/pytransform.so

And copy it to the path in the line INFO Target path. Here it is:

/home/jondy/.pyarmor/platforms/linux/x86_64/11/py27

Before PyArmor 6.5.5, no target path line. Save it to ~/.pyarmor/platforms/ plus platform path. For example, the target path of platform linux.x86_64.11.py27 is ~/.pyarmor/platforms/linux/x86_64/11/py27.

All the available dynamic libraries are stored in the repos pyarmor-core

https://github.com/dashingsoft/pyarmor-core

Each pyarmor version has the corresponding tag, for example, PyArmor 6.4.2 -> tag “r34.8”. Switch this tag and download fiels from platforms.