Skip to content

Latest commit

 

History

History
315 lines (286 loc) · 10.6 KB

platforms.rst

File metadata and controls

315 lines (286 loc) · 10.6 KB

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 <https://github.com/dashingsoft/pyarmor-core/blob/master/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

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
  • alpine.x86_64
  • alpine.arm
  • 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 _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
alpine.x86_64 Alpine Linux x86_64 _pytransform.so Built with musl-1.1.21 for Docker
alpine.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
Table-3. The Prebuilt Extensions For Super Mode
Name Platform Arch Features Download Description
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.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
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