A tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.

Overview

PyArmor

PyArmor is a command line tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts. It protects Python scripts by the following ways:

  • Obfuscate code object to protect constants and literal strings.
  • Obfuscate co_code of each function (code object) in runtime.
  • Clear f_locals of frame as soon as code object completed execution.
  • Verify the license file of obfuscated scripts while running it.

Also refer to The Security of PyArmor

Support Platforms

  • Python 2.5, 2.6, 2.7 and Python3
  • Prebuilt Platform: win32, win_amd64, linux_i386, linux_x86_64, macosx_x86_64
  • Embedded Platform: Raspberry Pi, Banana Pi, Orange Pi, TS-4600 / TS-7600

Refer to Standard Platform Names

Quick Start

Installation

pip install pyarmor

Obfuscate scripts

pyarmor obfuscate foo.py

Run obfuscated scripts

python dist/foo.py

Pack obfuscated scripts into one bundle

pip install pyinstaller
pyarmor pack foo.py

Obfuscate scripts with an expired license

pyarmor licenses --expired 2018-12-31 r001
pyarmor obfuscate --with-license licenses/r001/license.lic foo.py

There is also a web-ui package pyarmor-webui

pip install pyarmor-webui

Start webui, open web page in browser (snapshots)

pyarmor-webui

More usage, refer to

License & Purchase

PyArmor is published as shareware, free trial version never expires, but there are some limitations:

  • The maximum size of code object is about 32768 bytes in trial version
  • All the trial version uses same public capsule other than private capsule
  • In trial version the module could not be obfuscated by advanced mode if there are more than about 30 functions (code objects) in this module.
  • ...

For details, refer to PyArmor License.

Change Logs

Report issuses

Click here to report an issue, for security issue email to [email protected].

Issues
  • Access to raw code objects

    Access to raw code objects

    I obfuscated the following Python script.

    examples/test/mymod.py:

    from __future__ import division, absolute_import, print_function, unicode_literals
    
    def func2():
        print('func2')
    
    def func3():
        print(err)
    

    Build pyarmor:

    python pyarmor.py init --src=examples/test --entry=mymod.py projects/test
    
    python pyarmor.py config --disable-restrict-mode=1 projects/test
    
    cd projects/test
    ./pyarmor build
    

    In Python shell:

    >>> import mymod, dis
    >>> dis.dis(mymod)
    Disassembly of func2:
      4     >>    0 LOAD_GLOBAL              0 (print)
                  3 LOAD_CONST               1 (u'func2')
                  6 CALL_FUNCTION            1
                  9 POP_TOP             
                 10 LOAD_CONST               0 (None)
                 13 RETURN_VALUE        
                 14 NOP                 
                 15 NOP                 
                 16 NOP                 
                 17 NOP                 
                 18 NOP                 
                 19 NOP                 
                 20 NOP                 
                 21 NOP                 
                 22 NOP                 
                 23 NOP                 
                 24 JUMP_ABSOLUTE            0
    
    Disassembly of func3:
      7     >>    0 LOAD_GLOBAL              0 (print)
                  3 LOAD_GLOBAL              1 (err)
                  6 CALL_FUNCTION            1
                  9 POP_TOP             
                 10 LOAD_CONST               0 (None)
                 13 RETURN_VALUE        
                 14 NOP                 
                 15 NOP                 
                 16 NOP                 
                 17 NOP                 
                 18 NOP                 
                 19 NOP                 
                 20 NOP                 
                 21 NOP                 
                 22 NOP                 
                 23 NOP                 
                 24 JUMP_ABSOLUTE            0
    

    Is it the correct behaviour that you have access to the raw code objects of a module? So, what is the advantage of using pyarmor? Thanks.

    opened by joonis 118
  • Pyarmor是否可以对第三方工具supervisor的py源码程序加密?

    Pyarmor是否可以对第三方工具supervisor的py源码程序加密?

    您好!Pyarmor是否可以对第三方工具supervisor的py源码程序加密?我对supervisor的py源码程序进行加密,suservisorctl.py 执行完后报堆栈溢出错误。以下我的报错信息!

    *** Error in `python': corrupted double-linked list: 0x0000000001ee32f0 *** ======= Backtrace: ========= /lib64/libc.so.6(+0x7f3e4)[0x7f0b7fc0b3e4] /lib64/libc.so.6(+0x8132d)[0x7f0b7fc0d32d] /lib64/libpython2.7.so.1.0(+0x817d8)[0x7f0b809007d8] /lib64/libpython2.7.so.1.0(+0x817bf)[0x7f0b809007bf] /lib64/libpython2.7.so.1.0(+0x59c7b)[0x7f0b808d8c7b] /lib64/libpython2.7.so.1.0(+0x817bf)[0x7f0b809007bf] /lib64/libpython2.7.so.1.0(+0x9e254)[0x7f0b8091d254] /lib64/libpython2.7.so.1.0(+0x817bf)[0x7f0b809007bf] /lib64/libpython2.7.so.1.0(+0x817bf)[0x7f0b809007bf] /lib64/libpython2.7.so.1.0(+0x9e254)[0x7f0b8091d254] /lib64/libpython2.7.so.1.0(+0x808df)[0x7f0b808ff8df] /lib64/libpython2.7.so.1.0(+0x822a0)[0x7f0b809012a0] /lib64/libpython2.7.so.1.0(_PyModule_Clear+0x16c)[0x7f0b80905dac] /lib64/libpython2.7.so.1.0(PyImport_Cleanup+0x27f)[0x7f0b80975d3f] /lib64/libpython2.7.so.1.0(Py_Finalize+0xfe)[0x7f0b809817ee] /lib64/libpython2.7.so.1.0(Py_Main+0x6a5)[0x7f0b80992ba5] /lib64/libc.so.6(__libc_start_main+0xf5)[0x7f0b7fbae555] python[0x40068e] ======= Memory map: ======== 00400000-00401000 r-xp 00000000 08:08 756171 /usr/bin/python2.7 00600000-00601000 r--p 00000000 08:08 756171 /usr/bin/python2.7 00601000-00602000 rw-p 00001000 08:08 756171 /usr/bin/python2.7 01a69000-01fc3000 rw-p 00000000 00:00 0 [heap] 7f0b6c000000-7f0b6c021000 rw-p 00000000 00:00 0 7f0b6c021000-7f0b70000000 ---p 00000000 00:00 0 7f0b72ce8000-7f0b72cfd000 r-xp 00000000 08:08 757853 /usr/lib64/libgcc_s-4.8.5-20150702.so.1 7f0b72cfd000-7f0b72efc000 ---p 00015000 08:08 757853 /usr/lib64/libgcc_s-4.8.5-20150702.so.1 7f0b72efc000-7f0b72efd000 r--p 00014000 08:08 757853 /usr/lib64/libgcc_s-4.8.5-20150702.so.1 7f0b72efd000-7f0b72efe000 rw-p 00015000 08:08 757853 /usr/lib64/libgcc_s-4.8.5-20150702.so.1 7f0b72efe000-7f0b72f0a000 r-xp 00000000 08:08 758866 /usr/lib64/libnss_files-2.17.so 7f0b72f0a000-7f0b73109000 ---p 0000c000 08:08 758866 /usr/lib64/libnss_files-2.17.so 7f0b73109000-7f0b7310a000 r--p 0000b000 08:08 758866 /usr/lib64/libnss_files-2.17.so 7f0b7310a000-7f0b7310b000 rw-p 0000c000 08:08 758866 /usr/lib64/libnss_files-2.17.so 7f0b7310b000-7f0b731d1000 rw-p 00000000 00:00 0 7f0b731d1000-7f0b731d3000 r-xp 00000000 08:08 804984 /usr/lib64/python2.7/lib-dynload/syslog.so 7f0b731d3000-7f0b733d2000 ---p 00002000 08:08 804984 /usr/lib64/python2.7/lib-dynload/syslog.so 7f0b733d2000-7f0b733d3000 r--p 00001000 08:08 804984 /usr/lib64/python2.7/lib-dynload/syslog.so 7f0b733d3000-7f0b733d4000 rw-p 00002000 08:08 804984 /usr/lib64/python2.7/lib-dynload/syslog.so 7f0b733d4000-7f0b733d6000 r-xp 00000000 08:08 804903 /usr/lib64/python2.7/lib-dynload/resource.so 7f0b733d6000-7f0b735d5000 ---p 00002000 08:08 804903 /usr/lib64/python2.7/lib-dynload/resource.so 7f0b735d5000-7f0b735d6000 r--p 00001000 08:08 804903 /usr/lib64/python2.7/lib-dynload/resource.so 7f0b735d6000-7f0b735d7000 rw-p 00002000 08:08 804903 /usr/lib64/python2.7/lib-dynload/resource.so 7f0b735d7000-7f0b735dc000 r-xp 00000000 08:08 804904 /usr/lib64/python2.7/lib-dynload/selectmodule.so 7f0b735dc000-7f0b737db000 ---p 00005000 08:08 804904 /usr/lib64/python2.7/lib-dynload/selectmodule.so 7f0b737db000-7f0b737dc000 r--p 00004000 08:08 804904 /usr/lib64/python2.7/lib-dynload/selectmodule.so 7f0b737dc000-7f0b737de000 rw-p 00005000 08:08 804904 /usr/lib64/python2.7/lib-dynload/selectmodule.so 7f0b737de000-7f0b73b5e000 rw-p 00000000 00:00 0 7f0b73b5e000-7f0b73b62000 r-xp 00000000 08:08 804535 /usr/lib64/python2.7/lib-dynload/_localemodule.so 7f0b73b62000-7f0b73d61000 ---p 00004000 08:08 804535 /usr/lib64/python2.7/lib-dynload/_localemodule.so 7f0b73d61000-7f0b73d62000 r--p 00003000 08:08 804535 /usr/lib64/python2.7/lib-dynload/_localemodule.so 7f0b73d62000-7f0b73d63000 rw-p 00004000 08:08 804535 /usr/lib64/python2.7/lib-dynload/_localemodule.so 7f0b73d63000-7f0b73e23000 rw-p 00000000 00:00 0 7f0b73e23000-7f0b73e25000 r-xp 00000000 08:08 804664 /usr/lib64/python2.7/lib-dynload/grpmodule.so 7f0b73e25000-7f0b74024000 ---p 00002000 08:08 804664 /usr/lib64/python2.7/lib-dynload/grpmodule.so 7f0b74024000-7f0b74025000 r--p 00001000 08:08 804664 /usr/lib64/python2.7/lib-dynload/grpmodule.so 7f0b74025000-7f0b74026000 rw-p 00002000 08:08 804664 /usr/lib64/python2.7/lib-dynload/grpmodule.so 7f0b74026000-7f0b74066000 rw-p 00000000 00:00 0 7f0b74066000-7f0b7408d000 r-xp 00000000 08:08 754673 /usr/lib64/libexpat.so.1.6.0 7f0b7408d000-7f0b7428d000 ---p 00027000 08:08 754673 /usr/lib64/libexpat.so.1.6.0 7f0b7428d000-7f0b7428f000 r--p 00027000 08:08 754673 /usr/lib64/libexpat.so.1.6.0 7f0b7428f000-7f0b74290000 rw-p 00029000 08:08 754673 /usr/lib64/libexpat.so.1.6.0 7f0b74290000-7f0b7429b000 r-xp 00000000 08:08 803410 /usr/lib64/python2.7/lib-dynload/pyexpat.so 7f0b7429b000-7f0b7449a000 ---p 0000b000 08:08 803410 /usr/lib64/python2.7/lib-dynload/pyexpat.so 7f0b7449a000-7f0b7449b000 r--p 0000a000 08:08 803410 /usr/lib64/python2.7/lib-dynload/pyexpat.so 7f0b7449b000-7f0b7449d000 rw-p 0000b000 08:08 803410 /usr/lib64/python2.7/lib-dynload/pyexpat.so 7f0b7449d000-7f0b744ae000 r-xp 00000000 08:08 804584 /usr/lib64/python2.7/lib-dynload/datetime.so 7f0b744ae000-7f0b746ad000 ---p 00011000 08:08 804584 /usr/lib64/python2.7/lib-dynload/datetime.so 7f0b746ad000-7f0b746ae000 r--p 00010000 08:08 804584 /usr/lib64/python2.7/lib-dynload/datetime.so 7f0b746ae000-7f0b746b2000 rw-p 00011000 08:08 804584 /usr/lib64/python2.7/lib-dynload/datetime.so 7f0b746b2000-7f0b746b6000 r-xp 00000000 08:08 805277 /usr/lib64/python2.7/lib-dynload/zlibmodule.so 7f0b746b6000-7f0b748b5000 ---p 00004000 08:08 805277 /usr/lib64/python2.7/lib-dynload/zlibmodule.so 7f0b748b5000-7f0b748b6000 r--p 00003000 08:08 805277 /usr/lib64/python2.7/lib-dynload/zlibmodule.so

    opened by yq1320 62
  • Restrict Mode Examples?

    Restrict Mode Examples?

    Hi @jondy,

    I know your pretty busy resolving the issues that came about with 6.3.0, I was just wondering if i could get some clear proper examples of how to use the restrict modes..

    What im trying to do

    if i have a dir

    __init__.py
    packer.py
    

    I want __init__.py to be import-able with restrict 1, but how do i then also have packer.py restrict 3 so it cant be imported outside of the __init__.py?

    You doc doesn't cover proper examples things like this, it just doesn't make it clear enough , sorry

    opened by VeNoMouS 56
  • Issue with the pytransform and NameError:  '__pyarmor__'

    Issue with the pytransform and NameError: '__pyarmor__'

    Hello,

    Firstly, I should appreciate the work that you have put in here. It's pretty cool. It works great, however, I have some concerns for this package to use in some usual cases.

    1. This package works pretty good, If you want to secure a single python file, which again is not a usual case out in the production or in normal cases.
    2. If I tend to try the obfuscation on the python executables in a folder, one among all the files present in the folder work well, but the others throw NameError: name '__pyarmor__' is not defined, as they miss bootstrap-code. This is concerning.
    3. If I use pyarmor obfuscation on the python libraries as well as the executable, It turns out with the error : exception: _pytransform can not be loaded twice. Usually, It is equally important to secure both the libraries and its executable in python. Libraries are the place where you have most of the important info is present.
    4. So, It is likely impossible to completely secure the complete python package, such as below:
    packagename
     |- src/
        |- packagename/
          |- __init__.py
          |- yourfiles.py
     |- scripts/
        |- non-exported python files
    
    1. Moreover, the files that get generated when you obfuscate the code, _pytransform.so license.lic pytransform.key pytransform.py. These files are pretty much similar in most of the case, irrespective of the file you use to obfuscate, so why not to have them in a library, so that you don't need to have a huge duplication in the case of the packages with the libraries as above.

    Let me know your view on this, Thank you.

    opened by saikishor 51
  • Can't build a working exe when using super mode

    Can't build a working exe when using super mode

    • Happens only when we use super mode to obfuscate the project, when built with advanced 0 the obfuscated and packaged code works without any issue.
    • Packaged with pyinstaller (not pyarmor pack), spec file is changed to include different pytransform generated by super mode Datas = [('pytransform.pyd','.')...]

    Not sure how I can get more info that would be useful to find the issue, any ideas ?

    {
      "version": "2.0",
      "name": "Prod super mode build",
      "title": "Prod super mode build",
      "src": ".",
      "is_package": null,
      "manifest": "global-include *.py",
      "entry": "main.py",
      "output": "dist",
      "runtime_path": null,
      "restrict_mode": 2,
      "obf_code": 2,
      "obf_mod": 1,
      "wrap_mode": 1,
      "advanced_mode": 2,
      "bootstrap_code": 1,
      "cross_protection": 0,
      "plugins": null,
      "platform": "windows.x86_64.11.py37",
      "package_runtime": 1,
      "enable_suffix": 0,
      "license_file": null,
      "build_time": 1595425907.0985913
    }
    

    Debug

    Microsoft Windows [Version 10.0.18362.959]
    (c) 2019 Microsoft Corporation. Alle rechten voorbehouden.
    
    C:\Users\user\Desktop\O Prod super mode build\dist\dist>"C:\Users\user\Desktop\O Prod super mode build\dist\dist\OAIO V1.1.2.exe"
    [21812] PyInstaller Bootloader 3.x
    [21812] LOADER: executable is C:\Users\user\Desktop\O Prod super mode build\dist\dist\OAIO V1.1.2.exe
    [21812] LOADER: homepath is C:\Users\user\Desktop\O Prod super mode build\dist\dist
    [21812] LOADER: _MEIPASS2 is NULL
    [21812] LOADER: archivename is C:\Users\user\Desktop\O Prod super mode build\dist\dist\OAIO V1.1.2.exe
    [21812] LOADER: Extracting binaries
    [21812] LOADER: Executing self as child
    [21812] LOADER: set _MEIPASS2 to C:\Users\user\AppData\Local\Temp\_MEI218122
    [21812] LOADER: Setting up to run child
    [21812] LOADER: Creating child process
    [21812] LOADER: Waiting for child process to finish...
    [26280] PyInstaller Bootloader 3.x
    [26280] LOADER: executable is C:\Users\user\Desktop\O Prod super mode build\dist\dist\OAIO V1.1.2.exe
    [26280] LOADER: homepath is C:\Users\user\Desktop\O Prod super mode build\dist\dist
    [26280] LOADER: _MEIPASS2 is C:\Users\user\AppData\Local\Temp\_MEI218122
    [26280] LOADER: archivename is C:\Users\user\Desktop\O Prod super mode build\dist\dist\OAIO V1.1.2.exe
    [26280] LOADER: SetDllDirectory(C:\Users\user\AppData\Local\Temp\_MEI218122)
    [26280] LOADER: Already in the child - running user's code.
    [26280] LOADER: manifestpath: C:\Users\user\AppData\Local\Temp\_MEI218122\OAIO V1.1.2.exe.manifest
    [26280] LOADER: Error activating the context: ActivateActCtx:
    An attempt to set the default context for activating a process failed because it has already been set.
    
    [26280] LOADER: Python library: C:\Users\user\AppData\Local\Temp\_MEI218122\python37.dll
    [26280] LOADER: Loaded functions from Python library.
    [26280] LOADER: Manipulating environment (sys.path, sys.prefix)
    [26280] LOADER: sys.prefix is C:\Users\user\AppData\Local\Temp\_MEI218122
    [26280] LOADER: Pre-init sys.path is C:\Users\user\AppData\Local\Temp\_MEI218122\base_library.zip;C:\Users\user\AppData\Local\Temp\_MEI218122
    [26280] LOADER: Setting runtime options
    [26280] LOADER: Bootloader option: pyi-windows-manifest-filename OAIO V1.1.2.exe.manifest
    [26280] LOADER: Initializing python
    [26280] LOADER: Overriding Python's sys.path
    [26280] LOADER: Post-init sys.path is C:\Users\user\AppData\Local\Temp\_MEI218122\base_library.zip;C:\Users\user\AppData\Local\Temp\_MEI218122
    [26280] LOADER: Setting sys.argv
    [26280] LOADER: setting sys._MEIPASS
    [26280] LOADER: importing modules from CArchive
    [26280] LOADER: extracted struct
    [26280] LOADER: callfunction returned...
    [26280] LOADER: extracted pyimod01_os_path
    [26280] LOADER: callfunction returned...
    [26280] LOADER: extracted pyimod02_archive
    [26280] LOADER: callfunction returned...
    [26280] LOADER: extracted pyimod03_importers
    [26280] LOADER: callfunction returned...
    [26280] LOADER: Installing PYZ archive with Python modules.
    [26280] LOADER: PYZ archive: PYZ-00.pyz
    [26280] LOADER: Running pyiboot01_bootstrap.py
    [26280] LOADER: Running pyi_rth_multiprocessing.py
    [26280] LOADER: Running pyi_rth__tkinter.py
    [26280] LOADER: Running pyi_rth_pkgres.py
    [26280] LOADER: Running pyi_rth_pyqt5webengine.py
    [26280] LOADER: Running pyi_rth_pyqt5.py
    [26280] LOADER: Running pyi_rth_certifi.py
    [26280] LOADER: Running pyi_rth_win32comgenpy.py
    [26280] LOADER: Running Main.py
    [21812] LOADER: Back to parent (RC: -1073741571)
    [21812] LOADER: Doing cleanup
    [21812] LOADER: Freeing archive status for C:\Users\user\Desktop\O Prod super mode build\dist\dist\OAIO V1.1.2.exe
    
    opened by martyur 45
  •  Pack command, causes unknown behaviour of the app

    Pack command, causes unknown behaviour of the app

    Using the following commands to pack our applciation. pyarmor init --entry "MRT.py,MRTFiles/attack_controller.py,MRTFiles/attack_dict.py,MRTFiles/cleanup.py,MRTFiles/play.py,MRTFiles/player.py,MRTFiles/vcspam.py,MRTFiles/ServerSmasher/serversmasher.py,MRTFiles/ServerSmasher/serversmasherGUI.py,MRTFiles/ServerSmasher/smconfig.py,plugins/Ghost Ping.py,plugins/helper.py,plugins/Additional/ghostpingmenu.py"

    pyarmor pack -e " --clean -F -p MRTFiles -p plugins --noupx --onefile" .

    Note, that in MRT.py, there are calls, that will start a python file located in the MRTFiles folder(subprocess.popen(executeable, "./MRTFiles/attack_controller", ...)

    The main app does start but once I start a feature it will just start the main application again.

    opened by sla-te 45
  • Segmentation fault with python 3.8.0

    Segmentation fault with python 3.8.0

    Getting segmentation fault with python 3.8.0

    opened by simonsruggi 35
  • Advanced mode 1 Failing with Pyenv environment on Pyarmor(6.2.1)

    Advanced mode 1 Failing with Pyenv environment on Pyarmor(6.2.1)

    Hi Again,

    Environment

    Python - 3.6.9 OS - Ubuntu 20.04 Pyarmor - 6.2.0

    Project structure

    mypkg ├── bar.py ├── foo.py └── init.py

    Configuration files

    I am using the child project structure to demonstrate a use-case for a large package. Here we are just obfuscating everything else with restrict mode 4 and using restrict mode 1 for __init__.py. As is recommended for a package.

    # Content .pyarmor_config
    { 
      "version": "2.0",
      "name": "mypkg",
      "title": "mypkg",
      "src": ".",
      "is_package": 1,
      "manifest": "include __init__.py",
      "entry": "__init__.py",
      "output": "dist",
      "runtime_path": null,
      "restrict_mode": 1,
      "obf_code": 2,
      "obf_mod": 1,
      "wrap_mode": 1,
      "advanced_mode": 0,
      "bootstrap_code": 1,
      "cross_protection": 1,
      "plugins": null,
      "platform": null,
      "package_runtime": 1,
      "enable_suffix": 0,
      "license_file": null,
      "build_time": 1589994512.6738808
    }
    
    # Content .pyarmor_config_pkg
    {
      "version": "2.0",
      "name": "mypkg",
      "title": "mypkg",
      "src": ".",
      "is_package": 1,
      "manifest": "global-include *.py, exclude __init__.py",
      "entry": "",
      "output": "dist",
      "runtime_path": null,
      "restrict_mode": 4,
      "obf_code": 2,
      "obf_mod": 1,
      "wrap_mode": 1,
      "advanced_mode": 0,
      "bootstrap_code": 1,
      "cross_protection": 1,
      "plugins": null,
      "platform": null,
      "package_runtime": 1,
      "enable_suffix": 0,
      "license_file": null,
      "build_time": 1589994515.6668053
    }
    

    Command :

    pyarmor build -B
    pyarmor build --no-runtime -B .pyarmor_config_pkg
    

    The build completes successfully.

    Behaviour/Expectation

    If we try to import the obfuscated mykg then we get the following error

    Python 3.6.9 (default, May 20 2020, 20:21:06) 
    [GCC 9.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import mypkg
    XXX lineno: 8, opcode: 228
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "</media/e0lithic/D/GameX/pyarmor_test/mypkg/dist/mypkg/__init__.py>", line 3, in <module>
      File "<frozen mypkg>", line 8, in <module>
    SystemError: unknown opcode
    

    If we just turn advanced_mode 0 in both configuration files and rerun the build. I am able to import the package.

    I read the documentation but the python 3.6 limitation was only mentioned for advanced_mode 2 / a.k.a super mode. Is the support for advanced mode 1 on python 3.6 also depreciated? Kindly let me know if I am missing something.

    Thanks

    opened by e0lithic 34
  • [Query/Bug] Getting failures in project when using restrict mode 3

    [Query/Bug] Getting failures in project when using restrict mode 3

    HI,

    First of all I would like to thank you for the brilliant work you have done. Kudos!

    Configuration

    INFO     PyArmor Version 5.9.6
    INFO     Project  information
                   version: 2.0
                      name: encrypted_backend
                     title: encrypted_backend
                       src: ../backend
                is_package: None
                  manifest: global-include *.py
                     entry: manage.py
                    output: .
              runtime_path: None
             restrict_mode: 3
                  obf_code: 1
                   obf_mod: 1
                 wrap_mode: 1
             advanced_mode: 1
            bootstrap_code: 1
          cross_protection: 1
                   plugins: None
                  platform: None
           package_runtime: 1
             enable_suffix: 0
              license_file: None
                build_time: Mon Apr 13 14:24:03 2020
    

    Expectation

    • The project has multiple packages and sub packages. However intent is to obfuscate all under one umbrella, hence using a single recursive build.
    • The project being a django backend, has an entry script manage.py, which is only supposed to be executed and not imported anywhere. As such restrict mode 3 seemed to be an ideal fit.

    Error

    • The project obfuscates successfully, however, I get random failures when i try to execute it. Errors like the following - Pytransform Error: This function could not be called from the plain script when running < frozen x.y.z >

    My understanding is that since all the functions are being called from obfuscated files, the error should not pop up. I did some hit and trials in the x.y.z file path and it appears that commenting code like the following makes the error go away (doesn't make sense!).

    if not os.path.exists(root):
            os.makedirs(root)
    if not os.path.exists(dir_path):
            os.makedirs(dir_path)
    

    But then it pops up somewhere in other file. Considering the sheer size of the project and not knowing the underlying code for pyarmor, I am unable to create a directed reproducible example for you unfortunately. Please let me know if I am missing something, or any heads up so that I can provide you with a better reproducible example.

    PS - I am able to successfully run the project with restrict mode 1 and 2.

    Thanks.

    opened by e0lithic 34
  • Target platform string ['linux.x86_64.11.py37'] being read as a list of characters

    Target platform string ['linux.x86_64.11.py37'] being read as a list of characters

    I am using this method https://pyarmor.readthedocs.io/en/latest/advanced.html#distributing-obfuscated-package-with-pip

    My script for obsfucation, run from project/shell directory:

    #!/usr/bin/env bash
    # Prepare the obsfucation, run from shell directory
    rm -rf ../obsfucated
    mkdir -p ../obsfucated
    pyarmor  runtime -O obsfucated --enable-suffix 1 --advanced 2
    pyarmor obfuscate  -r --with-runtime @obsfucated  --exclude package.py,setu*.py,test,test_data,dist,build ../
    

    I am having this issue with the approach

    l$ /bin/bash /home/david/projects/product/shell/obsfucate.sh
    INFO     PyArmor Version 6.5.5
    INFO     Update target platforms to: ['linux.x86_64.11.py37']
    INFO     Generating super runtime library to obsfucated
    INFO     Extract pytransform.key
    INFO     Generate default license file
    INFO     Copying /home/david/.pyarmor/platforms/linux/x86_64/11/py37/pytransform.cpython-37m-x86_64-linux-gnu.so
    INFO     Rename extension to pytransform_vax_000925.cpython-37m-x86_64-linux-gnu.so
    INFO     Patch extension obsfucated/pytransform_vax_000925.cpython-37m-x86_64-linux-gnu.so
    INFO     Patch library file OK
    INFO     Generate runtime files OK
    INFO     Generating protection script ...
    INFO     Generating bootstrap script ...
    INFO     Generating bootstrap script obsfucated/pytransform_bootstrap.py OK
    INFO     PyArmor Version 6.5.5
    INFO     Got settings from --runtime: obsfucated
    INFO         Platforms: linux.x86_64.11.py37
    INFO         Advanced: 2
    INFO         Suffix: _vax_000925
    INFO         License: embedded
    INFO     Target platforms: ['l', 'i', 'n', 'u', 'x', '.', 'x', '8', '6', '_', '6', '4', '.', '1', '1', '.', 'p', 'y', '3', '7']
    ERROR    No available dynamic library for l with features ['11']
    

    Why is it detecting my Target platform and reading it as an array rather than a string?

    opened by davidwynter 33
  • Obfuscate such that only one script can be called

    Obfuscate such that only one script can be called

    Hello, thank you for this nice and useful library.

    I would like to obfuscate my code in a certain way but I have trouble to make it work. I looked at the documentation, especially restrict modes, but I still can't figure it out.

    The architecture of the code I want to obfuscate is the following :

    exec
        launch.py
        utils.py
    pkg1
    pkg2
    

    pkg1 and pkg2 are two packages and pkg1 calls some functions of pkg2. exec is a folder which contains the two scripts launch.py and utils.py. launch.py is the only script that will be called (python launch.py), that calls function/modules from utils.py, pkg1 and pkg2.

    I would like to obfuscate the code such that the user can't call any functions/modules from pkg1, pkg2 utils, or launch.py, and can only run python launch.py.

    How can I do this with pyarmor ?

    question 
    opened by CharlieCheckpt 1
  • 加密django项目,项目中使用到了celery

    加密django项目,项目中使用到了celery

    mkdir /code/developer_backend_bak cp -a /code/developer_backend/* /code/developer_backend_bak cd /code/developer_backend pyarmor obfuscate --src="." -r --output=/code/test/developer_backend_bak application/wsgi.py application/celery.py manage.py 在我加密后我无法在使用celery -A application worker -B --loglevel=info来运行celery任务

    question 
    opened by sxiaoy 1
  • Running merge: 'RuntimeError: No runtime files found'

    Running merge: 'RuntimeError: No runtime files found'

    relates_to: https://github.com/dashingsoft/pyarmor/issues/663

    Title When running the merge tool on a package with multiple versions of python obfuscated with --no-runtime I can't merge the output into one. I don't need a runtime for these packages as they use a common library which includes the pytransform library within.

    Description

    1. run python -m pyarmor.helper.merge -d py38 py39 py310
    INFO     Merge 'dist/3.8.12', 'dist/3.9.9', 'dist/3.10.0'...
    INFO     Merging obfuscated scripts...
    ... REDACTED ...
    INFO     Merging runtime files...
    DEBUG    Found runtimes: []
    Traceback (most recent call last):
      File "PATH/.pyenv/versions/3.10.0/lib/python3.10/runpy.py", line 196, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "PATH/.pyenv/versions/3.10.0/lib/python3.10/runpy.py", line 86, in _run_code
        exec(code, run_globals)
      File "/tmp/venv_3.10.0/lib/python3.10/site-packages/pyarmor/helper/merge.py", line 293, in <module>
        main()
      File "/tmp/venv_3.10.0/lib/python3.10/site-packages/pyarmor/helper/merge.py", line 282, in main
        merge_runtimes(args.path, output)
      File "/tmp/venv_3.10.0/lib/python3.10/site-packages/pyarmor/helper/merge.py", line 168, in merge_runtimes
        raise RuntimeError('No runtime files found')
    RuntimeError: No runtime files found
    

    Adding a new option which is defaulted to true so that https://github.com/dashingsoft/pyarmor/blob/89c4df8a6624bb89cb14f633aead7f8448f75b39/src/helper/merge.py#L284

    is only run when this flag is enabled would ensure that i can pass --no-runtime or similar to this script and have it work as expected and is consistent with other flags that pyarmor obfuscate consumes

    bug 
    opened by jack1902 1
  • Running merge: 'RuntimeError: Too many runtime files'

    Running merge: 'RuntimeError: Too many runtime files'

    Title Runtime detection with the merge command doesn't work as expected and results in detection of numerous files that are created by the runtime command itself.

    Description

    1. Run the following commands:
    # PLATFORMS as a csv string
    PLATFORMS=""
    
    for PY_VERSION in "38" "39"; do
      # Generate runtime for version (assumes pyarmor is installed for the relevant version of python specified) [Uses pyenv and a venv to install the relevant version of pyarmor]
    
      # Using the `src` directory to output the pytransform package means that pytransform is included as part of the overall package and I use `package_data` to bundle the relevant .so / .pyd files
      pyarmor runtime -O "dist/src" --enable-suffix 1 --platform "${PLATFORMS}"
      
      # Generate the obfuscated scripts for the relevant version (using `--no-runtime` as I don't always need it for other packages that use a common base package which includes the runtime
      pyarmor obfuscate --enable-suffix --no-runtime --recursive --bootstrap 2  --output "${PY_VERSION}/src/myapp" src/myapp/__init__.py
    done
    
    # Merge the obfuscated scripts and runtimes into one (observe error)
    python -m pyarmor.helper.merge -d py38 py39
    

    Observe the error below (vax_xxxxxx contains my unique id for the registered version):

    INFO     Merging runtime files...
    DEBUG    Found runtimes: ['src/pytransform_bootstrap.py', 'src/pytransform_protection.py', 'src/pytransform_vax_xxxxxx']
    Traceback (most recent call last):
      File "PATH/python3.8/runpy.py", line 194, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "PATH/python3.8/runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "PATH/.venv/lib/python3.8/site-packages/pyarmor/helper/merge.py", line 293, in <module>
        main()
      File "PATH/.venv/lib/python3.8/site-packages/pyarmor/helper/merge.py", line 282, in main
        merge_runtimes(args.path, output)
      File "PATH/.venv/lib/python3.8/site-packages/pyarmor/helper/merge.py", line 170, in merge_runtimes
        raise RuntimeError('Too many runtime files')
    RuntimeError: Too many runtime files
    
    1. This becomes an sdist and bdist using a setup.py with python -m build merged_dist and is then distributed as a normal python package. See my setup.py below:
    setup.py
    from setuptools import find_namespace_packages, setup
    from pathlib import Path
    
    def getreadme():
      with open("README.md") as f:
          return f.read()
    
    def get_package_data(path):
      # Returns a list of files excluding the `__init__` from the given path
      p = Path(path)
      return [
          str(f.relative_to(path))
          for f in p.glob("**/*")
          if f.is_file() and "__init__" not in str(f)
      ]
    
    setup(
      name="myapp",
      version="1.0.0",
      description="description",
      long_description=getreadme(),
      author="author",
      author_email="author_email",
      packages=find_namespace_packages(where="src"),
      package_dir={"": "src"},
      install_requires=["jwt"],
      package_data={
          "pytransform_vax_xxxxxx": get_package_data("src/pytransform_vax_xxxxxx")
      },
      include_package_data=False,
      zip_safe=True,
    )
    

    The reason behind this is https://github.com/dashingsoft/pyarmor/blob/82ec16c69ee61b19c0a0c0fe34c815a0e89e770f/src/helper/merge.py#L148 as it simply checks if the given file includes a string but the output of runtime results in two files and a folder which match this. A simple hack I have done at the moment is to remove pytransform_bootstrap.py and pytransform_protection.py after generating the runtime within my script above. Ideally a licensed version of pyarmor would work with the merge command and not detect the other files that are created when creating a runtime with multiple versions of python.

    bug 
    opened by jack1902 3
  • --advance bugs code

    --advance bugs code

    hi i am running pyarmor o --exact --platform linux.x86 --platform linux.x86_64 --advanced 2 --obf-code 2 --obf-mod 2

    and will get

    [email protected]:~# python3 test.py
    Traceback (most recent call last):
      File "test.py", line 1, in <module>
        from pytransform import pyarmor
      File "/root/pytransform/__init__.py", line 58, in <module>
        import_names()
      File "/root/pytransform/__init__.py", line 54, in import_names
        m = __import__(name, globals(), locals(), ['*'])
    ImportError: libpython3.9.so.1.0: cannot open shared object file: No such file or directory
    

    but if i run

    pyarmor o --exact --platform linux.x86 --platform linux.x86_64 --obf-code 2 --obf-mod 2

    script works fine

    contents of script

    import time print("test") time.sleep(10)

    i am running python 3.9.9 and pyarmor 7.4.2. and yes i am uploading the pytransform folder

    Screenshot_2 Screenshot_1

    im running the test on Ubuntu 20.04.3 LTS (GNU/Linux 5.13.19-2-pve x86_64)

    opened by itzguno 1
  • Privileged Instruction

    Privileged Instruction

    I just tried to compile my code with the command: 'pyarmor pack --clean -e" --onefile --noconsole --icon icon.ico" -x"--advanced 4 --obf-code 2 --restrict=2" main.py'.

    I am getting an error with pyarmor which stops the code from compiling and packing to an exe. image

    This code is an anti-debugger which checks for known debuggers in a while true statement. Line 162 is a "While True:" statement However I am getting this error in pyarmor meaning that the code doesn't compile.

    Please let me know if there is a fix for this,

    Thanks

    question 
    opened by Dxjq 1
  • NameError: name '__armor_enter__' is not defined for __del__  destructors for python 3.6

    NameError: name '__armor_enter__' is not defined for __del__ destructors for python 3.6

    Context Building obfuscated python wheels with several modules and classes.

    Platforms

    Currently need to support several platforms (aarch64, x86) for different python versions (py3.6, py3.7 and py3.8)

    Pyarmor versions tested: 6.7.1, 6.8.1

    Description

    The un-obfuscated wheels work fine, but when running the same code after installation of an obfuscated wheel errors like the following appear:

    Exception ignored in: <function ArtifactRegistry.__del__ at 0x7fb61e32dc10>
    Traceback (most recent call last):
    File "<frozen src.eff.core.artifact_registry>", line 91, in __del__
    NameError: name '__armor_enter__' is not defined
    Exception ignored in: <function Artifact.__del__ at 0x7fb61e3981f0>
    Traceback (most recent call last):
    File "<frozen src.eff.core.artifact>", line 177, in __del__
    NameError: name '__armor_enter__' is not defined
    Exception ignored in: <function Artifact.__del__ at 0x7fb61e3981f0>
    Traceback (most recent call last):
    File "<frozen src.eff.core.artifact>", line 177, in __del__
    NameError: name '__armor_enter__' is not defined
    Exception ignored in: <function Artifact.__del__ at 0x7fb61e3981f0>
    Traceback (most recent call last):
    File "<frozen src.eff.core.artifact>", line 177, in __del__
    NameError: name '__armor_enter__' is not defined
    Exception ignored in: <function Artifact.__del__ at 0x7fb61e3981f0>
    Traceback (most recent call last):
    

    The core of the problem lies in PyArmor, precisely in bad handling of destructor del methods.

    I have found references to this error in PyArmor docs: https://buildmedia.readthedocs.org/media/pdf/pyarmor/stable/pyarmor.pdf It is described in “14.6.12 Object method del raise NameError exception” “If the scripts is obfuscated by non super mode and python is 3.7 and later, please obfuscate the scrits by super mode. Or refine the scripts, do not obfuscate the object method del. For example”

    First tried the lambda_ trick, didn’t worked.

    So then tried to switch to “Super Mode”: https://pyarmor.readthedocs.io/en/latest/mode.html#super-mode

    It didn’t worked OOTB, had to fix dozens of problems along the way, with building the obfuscated wheel with that new mode, finally got it working locally, pushed it to gitlab CI and…

    ERROR No available dynamic library for linux.aarch64.11.py36 with features ['11']

    Just tracked it down: https://pyarmor.readthedocs.io/en/latest/platforms.html

    and "Table-3. The Prebuilt Extensions For Super Mode" clearly indicates that python 3.6 is not supported for both platforms that I need to support!

    How can I handle this issue?

    bug 
    opened by tkornuta-nvidia 9
  • Segmentation fault under QEMU / armv7l

    Segmentation fault under QEMU / armv7l

    Been using pyarmor for the last couple of years without any issues. Recently, I moved all code to a new machine (Ryzen 5900X) and install QEMU with Debian buster on it with armv7 architecture. This actually did work for a while but today I started receiving all kinds of segmentation faults when running pyarmor.

    I purchased pyarmor.

    Version: Tried both release (6.7.4) and From Github (6.7.5)

    uname -a: Linux workshop 5.13.6-051306-generic #202107291324-Ubuntu SMP Thu Jul 29 13:34:02 UTC 2021 armv7l GNU/Linux

    I deleted .pyarmor directory and then ran:

    [email protected]:~$ pyarmor -d register pyarmor-regfile-1.zip 
    DEBUG    PyArmor installation path: /usr/local/lib/python3.7/dist-packages/pyarmor-6.7.5-py3.7.egg/pyarmor
    DEBUG    PyArmor home path: /home/jasem/.pyarmor
    INFO     Create pyarmor home path: /home/jasem/.pyarmor
    INFO     Create trial license file: /home/jasem/.pyarmor/license.lic
    DEBUG    Native platform is linux.armv7
    DEBUG    Search dynamic library in the path: /usr/local/lib/python3.7/dist-packages/pyarmor-6.7.5-py3.7.egg/pyarmor/platforms
    DEBUG    Search dynamic library in the path: /home/jasem/.pyarmor/platforms
    INFO     Create cross platform libraries path /home/jasem/.pyarmor/platforms
    INFO     Search library for platform: linux.armv7
    DEBUG    Load platform list from /home/jasem/.pyarmor/platforms/index.json
    WARNING  The trial version could not download the latest platform library
    INFO     Getting remote file: https://github.com/dashingsoft/pyarmor-core/raw/r41.15a/platforms/index.json
    INFO     Write cached platform list file /home/jasem/.pyarmor/platforms/index.json
    WARNING  The trial version could not download the latest core libraries, tag r41.15a is always used
    WARNING  The core library excepted version is r44.18, but got r41.15a from platform list file /home/jasem/.pyarmor/platforms/index.json
    INFO     Found available libraries: ['linux.armv7.3']
    INFO     Target path for linux.armv7.3: /home/jasem/.pyarmor/platforms/linux/armv7/3
    INFO     Downloading library file for linux.armv7.3 ...
    WARNING  The trial version could not download the latest platform library
    INFO     Getting remote file: https://github.com/dashingsoft/pyarmor-core/raw/r41.15a/platforms/armv7/_pytransform.so
    INFO     Writing target file: /home/jasem/.pyarmor/platforms/linux/armv7/3/_pytransform.so
    INFO     Download dynamic library linux.armv7.3 OK
    qemu: uncaught target signal 11 (Segmentation fault) - core dumped
    Segmentation fault
    

    After this, any command (except for pyarmor -h) results in a segmentation fault:

    [email protected]:~$ pyarmor -d -v
    qemu: uncaught target signal 11 (Segmentation fault) - core dumped
    Segmentation fault
    
    bug 
    opened by knro 4
  • Illegal operations on a Raspberry Pi Zero W (ARMv6)

    Illegal operations on a Raspberry Pi Zero W (ARMv6)

    Describe the bug Using a Raspberry pi zero (armv6) most commands will fail with "Illegal instruction" and terminate.

    To Reproduce

    1. Running latest pyarmor from pip using the trial version on a Raspberry Pi Zero W running Raspbian 10 (buster) and python 3.7.3
    2. Commands used obfuscate, pack, download, hdinfo and -v
    3. Manually downloading armv6.0 and replacing the .3 version works Output from trying to obfuscate main.py
    pyarmor -d obfuscate main.py
    DEBUG    PyArmor installation path: /home/pi/.local/lib/python3.7/site-packages/pyarmor
    DEBUG    PyArmor home path: /home/pi/.pyarmor
    DEBUG    Native platform is linux.armv6
    DEBUG    Search dynamic library in the path: /home/pi/.local/lib/python3.7/site-packages/pyarmor/platforms
    DEBUG    Search dynamic library in the path: /home/pi/.pyarmor/platforms
    DEBUG    Found available dynamic library linux/armv6/3
    Illegal instruction
    
    

    Additional context Tested on a Windows machine and had no problem running the pack option with our .spec file

    bug 
    opened by shedstrom 17
  • [Query] OpenCV error on running obfuscated script on RaspPi 3B

    [Query] OpenCV error on running obfuscated script on RaspPi 3B

    Hi,

    I have a library which I am trying to obfuscate on the RaspPi 3B. Here are the commands being run to obfuscate:

    pyarmor obfuscate --exact __init__.py  --plugin ~/.pyarmor/plugins/check_ntp_time
    pyarmor obfuscate --restrict 4 --recursive --exclude __init__.py . --with-license licenses/rcode-001/license.lic 
    

    The obfuscation happens sucessfully. However, the following exception occurs while using a certain function of the library.

    Python 3.7.3 (default, Dec 20 2019, 18:57:59) 
    [GCC 8.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from abc import xyz
    
    ******************************************************************
    * FATAL ERROR:                                                   *
    * This OpenCV build doesn't support current CPU/HW configuration *
    *                                                                *
    * Use OPENCV_DUMP_CONFIG=1 environment variable for details      *
    ******************************************************************
    
    Required baseline features:
    NEON - NOT AVAILABLE
    terminate called after throwing an instance of 'cv::Exception'
      what():  OpenCV(4.1.0) /home/pi/opencv-python/opencv/modules/core/src/system.cpp:538: error: (-215:Assertion failed) Missing support for required CPU baseline features. Check OpenCV build configuration and required CPU/HW setup. in function 'initialize'
    
    Aborted
    

    However, if I run the library without obfuscation it runs perfectly fine. Please let me know what I am missing.

    Thanks

    opened by e0lithic 1
Releases(v7.3.0)
  • v7.3.0(Jan 2, 2022)

    • Change core version to r48.2
    • Fix Apple Silcon crash issue: use darwin.aarch64.0 as default library
    • Add 2 super mode libraries: darwin.aarch64.8.py38, darwin.aarch64.8.py39
    Source code(tar.gz)
    Source code(zip)
  • v7.2.4(Dec 27, 2021)

  • v7.2.3(Dec 15, 2021)

  • v7.2.0(Dec 10, 2021)

  • v7.1.0(Dec 1, 2021)

    • Check the conflicts of option --restrict 0 and --with-license
    • Fix issue (#628): super plus mode crashes if any function is patched
    • Fix link errors in documentation
    • Change core version to r47.1
    • Support Python 3.10. For super mode, now only 3 platforms: windows.x86_64, linux.x86_64, darwin.x86_64
    Source code(tar.gz)
    Source code(zip)
  • v7.0.2(Nov 2, 2021)

  • v7.0.1(Oct 31, 2021)

    A big feature Super Plus Mode is introduced in this version, and the format of license file for obfuscated scripts is changed.

    Because the trial version uses the old core libraries, so it doesn't work with new license. When running the scripts which are obfuscated by trial version with option --platform or --advanced, it will raise exception: Check license failed, Invalid input packet.

    • Fix issue (#584): failed to run pyarmor in Cygwin
    • Fix issue (#586): In linux combining options both --enable-suffix and --advanced 1 doesn't work
    • Increase core version to r46.20
    • Add sppmode, refer to Super Plus Mode
    • Change the format of license file for obfuscated scripts and the old core libraries (before r46.20) doesn't work with new licenses.
    Source code(tar.gz)
    Source code(zip)
  • v6.8.1(Oct 1, 2021)

  • v6.8.0(Sep 1, 2021)

    • Fix issue (#557): Invalid platform name for VM mode
    • Change core version to r45.19
    • In Linux support to get the serial number of mmc/sd card
    • In Linux refine the code of getting default harddisk
    • Supprot to run obfuscated scripts by multiple Python versions, refer to https://pyarmor.readthedocs.io/en/latest/advanced.html#run-obfuscated-scripts-by-different-python-versions
    • Fix Apple Silicon doesn't work issue
    Source code(tar.gz)
    Source code(zip)
  • v6.7.4(Aug 1, 2021)

    • Fix issue (#547): in MacOS the repack script fails if the executable is signed.
    • Add option --code-identity for repack script
    • Fix issue (#549): refine repack script to wait for the termination of objcopy
    • Change core version to r44.18
    • Fix issue: in super mode object.__del__ raises exception NameError: name '__armor_wrap__' is not defined
    • Fix issue (#530): in non-super mode object.__del__ raises exception NameError: name '__armor_enter__' is not defined. Note that for Python 3.7 and later, this issue still exists in non-super mode. Use super mode for these Python versions to solve this issue.
    • Add restrict mode 100+, refer to Restrict Mode
    • Check sys.PYARMOR_LICENSE for outer license, and refine outer license search policy. Refer to :ref:How to use outer license file
    • Fix issue (#539): runtime command generates wrong protection code for super mode
    • Fix issue (#550): memory leak of builtin function locals in super mode
    Source code(tar.gz)
    Source code(zip)
  • v6.7.3(Jul 2, 2021)

  • v6.7.2(Jun 7, 2021)

    • Fix issue (#518): remove platform part from extension name for super mode, now the final name is always pytransform.so or pytransform.pyd
    • Change core version to r43.17
    • Fix issue: the platform "android.aarch64" always raises exception Check license failed, Invalid input packet
    Source code(tar.gz)
    Source code(zip)
  • v6.7.1(May 20, 2021)

    • Support environment variable PYARMOR_TIMEOUT to set the timeout of any network connection.
    • Fix issue (#503): repack complains of too many pytransform
    • Support platform isilon onefs, alias of freebsd
    • Print the version of Python in the console when running pyarmor sub-command
    Source code(tar.gz)
    Source code(zip)
  • v6.7.0(Apr 28, 2021)

    There is a big change in this version is that the trial version could not download the latest extra core libraries. Except the core libraries distributed with soure package, for trial version all the other core libraries will always use the ones same as v6.6.2 (tag: r41.15).

    • Remove platform data file index.json from source package
    • The trial version could not download the latest platform libraries, it always uses core version r41.15
    • Fix super mode for Python39-32 in Windows issue(#489): Dll load failed (The specified procedure could not be found)

    Only fixed in purchased version

    • Improve the security of check_armored for super mode
    • Fix memory leak issue for core dynamic libraries
    Source code(tar.gz)
    Source code(zip)
  • v6.6.2(Feb 28, 2021)

    • Improve the security of restrict mode and assert_armored for super mode
    • Add new api pytransform.check_armored for super mode, it could be used to check module/function/method https://pyarmor.readthedocs.io/en/latest/pytransform.html#check_armored
    • Build super mode core libraries with rpath dependent in MacOS
    • Fix Python3.9 pack issue for MacOS: check_lib_pytransform failed
    • Fix Apple Silicon platform issue: the binary libraries doesn't work
    • Fix issue (#471): in super mode get_license_info can't get the updated license information.
    Source code(tar.gz)
    Source code(zip)
  • v6.6.1(Feb 1, 2021)

    • Fix issue (#429): the new license doesn't work if replace the old license with it in enable-period-mode
    • Fix extension filenames conflict for multiple platforms in super mode
    • Fix issue (#442): the target platforms in the runtime settings is read as a list
    • Fix issue (#452): when enable suffix for super mode in Linux, the obfuscated scripts raise ImportError: dynamic module does not define module export function
    • Fix issue (#460): the obfuscated scripts crash if they're obfucated by --advanced 2 and --obf-code 0
    • Add new platforms: android.x86, android.x86_64
    Source code(tar.gz)
    Source code(zip)
  • v6.6.0(Jan 4, 2021)

    • Add helper script buildext.py to build obfuscated scripts to extension modules, refer to https://pyarmor.readthedocs.io/en/latest/advanced.html#build-obfuscated-scripts-to-extensions
    • Add super mode libraries for platform musl.x86_64
    • Fix python3.8/3.9 crash issues
    Source code(tar.gz)
    Source code(zip)
  • v6.5.6(Dec 27, 2020)

    • Rename option --runtime-path to -rpath in command config
    • Fix issue (#403): the obfuscated scripts raise unexpected exception in Python 2.7 (non-super mode)
    • Add new platform centos6.x86_64.11.py27 for Python 2.7 built with UCS2 and platform glibc < 2.14
    • Add new command help to open online documentation in the web browser
    • Fix issue (#408): undefined symbol PyUnicodeUCS2_AsUTF8String in arm platforms for Python 2.7
    • Rename platform name darwin.arm64 to darwin.aarch64
    • Add new platform darwin.aarch64.3, darwin.aarch64.11.py38 and darwin.aarch64.11.py39
    • In project copy non .py files to output directly if they're specified in the project manifest
    • Fix issue (#414): repack doesn't patch the final bundle in some platforms
    • Fix issue (#415): when repacking an executable where the embedded PKG archive contains subdirectories, the repack script fails
    Source code(tar.gz)
    Source code(zip)
  • v6.5.5(Dec 2, 2020)

    • Add helper script repack.py, refer to https://pyarmor.readthedocs.io/en/latest/advanced.html#repack-pyinstaller-bundle-with-obfuscated-scripts
    • Add more log message when downloading dynamic library failed
    • Fix bug: it raises 'str' object has no attribute 'starswith' when obfuscating scripts with some platforms
    • Fix pyarmor_runtime reentrant issue
    Source code(tar.gz)
    Source code(zip)
  • v6.5.3(Nov 16, 2020)

    • Refine output message when checking registration information by command pyarmor register
    • Runtime function get_hd_info accepts keyword parameters name to get hardware information of named device
    • Command hdinfo accepts optional parameter name
    • Command licenses could bind obfuscated scripts to named hard disk
    • Print pretty error message if checking license or loading core dynamic library fails when running non-super mode obfuscated scripts
    • Fix issue (#387): exception Function does not end with "):" is raised when obfuscating the scripts
    Source code(tar.gz)
    Source code(zip)
  • v6.5.2(Nov 9, 2020)

    • The command register also could register any text file only if it includes registration code in one single line
    • Add new option --buy for command register, which used to open shopping cart of PyArmor: pyarmor register --buy
    Source code(tar.gz)
    Source code(zip)
  • v6.5.1(Oct 30, 2020)

  • v6.5.0(Oct 28, 2020)

    • Support super mode for Python3.9
    • Show deprecation warning for --advanced 1 and --advanced 3 if super mode is available, use --advanced 2 and --advanced 4 instead.
    • Both registration code and file are supported by the command register
    Source code(tar.gz)
    Source code(zip)
  • v6.4.4(Oct 20, 2020)

    • Fix issue (#355): the obfuscated script raises DeprecationWarning when getting user data from license file in super mode with Python3.8
    • Fix issue (#357): Python3.9 doesn't work, the obfuscated scripts raise unknow opcode 53/88 and segmentation fault
    Source code(tar.gz)
    Source code(zip)
  • v6.4.3(Oct 10, 2020)

    • Fix issue(#337): project can't be configured with outer license
    • Fix issue(#342): in Windows command pack doesn't work if the project isn't in the same drive of entry script
    Source code(tar.gz)
    Source code(zip)
  • v6.4.2(Sep 19, 2020)

    • Support binding multiple mac addresses in one machine by format <Mac1,Mac2,Mac3...> in Windows and Linux
    • For platform linux.x86_64 and linux.x86, the core libraries of super mode for Python2.7 are linked to usc4, the old ones are linked to ucs2
    • Fix pack command issue: outer license may not work in some cases
    • The platform linux.armv6 supports super mode
    Source code(tar.gz)
    Source code(zip)
  • v6.4.1(Sep 17, 2020)

    • Fix bug: for big endian platform, it raises RuntimeError: Invalid extension, no data found when obfuscating scripts (#323)
    • Fix bug: when obfuscating some special scripts in super mode, it raises RuntimeError: Patch function "xxx" failed (#326)
    • Fix serial number of hard disk issue in Windows: the last character is missed in some special cases
    Source code(tar.gz)
    Source code(zip)
  • v6.4.0(Aug 27, 2020)

    • Command obfuscate accepts multiple arguments as entry scripts
    • Fix restrict mode crash issue for Python3.5~3.8 in 32-bit Windows
    • Fix super mode issue: attempted relative import beyond top-level package
    • Improve security of restrict mode
    • For restrict mode 2, do not protect module attributes for performance
    • Add restrict mode 5 to protect globals in functions
    • Refine the documentation of restrict mode: https://pyarmor.readthedocs.io/en/latest/mode.html#restrict-mode
    • Fix platform centos6.x86_64 not found issue (#312)
    • On Linux for command licenses the option --bind-mac supports new format: IfName/MacAddress, for example, eth0/00:28:54:af:28
    Source code(tar.gz)
    Source code(zip)
  • v6.3.7(Aug 14, 2020)

    • A big improvement for restrict mode, the plain script couldn't visit any module attribute if this module is obfuscated by restrict mode 2, 3 or 4
    • Add option --runtime for command obfuscate, build
    • In command runtime, deprecate option --super-mode and --vm-mode, use --advanced instead.
    • Fix encoding issue: couldn't get the right encoding if source encoding is in the second line
    • Refine example scripts
    Source code(tar.gz)
    Source code(zip)
  • v6.3.6(Aug 5, 2020)

    • Fix pack issue: if pyi-makespec could not be found, it will complain of OSError: [WinError 2] The system cannot find the file specified.
    • Fix PYTHONOPTIMIZE=2 doesn't work issue
    • Fix super mode issue: auto patch failed if there are multiple lines in function header
    • Fix command register issue: it could not show registration information even if register successfully. It's introduced in v6.3.5.
    Source code(tar.gz)
    Source code(zip)
Owner
Dashingsoft
Focus on how to obfuscate python scripts for more than ten years, Pyarmor has been a powerful tool in the field of protecting and distributing python scripts.
Dashingsoft
Log4j-Scanner with Bind-Receipt and custom hostnames

Hrafna - Log4j-Scanner for the masses Features Scanning-system designed to check your own infra for vulnerable log4j-installations start and stop scan

null 17 Jan 7, 2022
Obfuscate ip address using different encodings

ipobfuscator How it works? Single ip address can be written in multiple ways. The most popular way is to represent ip as 4 octets separated with dots.

Piotr Warmke 1 Nov 2, 2021
This collection of tools that makes it easy to secure and/or obfuscate messages, files, and data.

Scrambler App This collection of tools that makes it easy to secure and/or obfuscate messages, files, and data. It leverages encryption tools such as

Mystic 1 Jan 7, 2022
OLOP: One-Line & Obfuscated Python

OLOP: One-Line & Obfuscated Python This repository contains useful python modules for one-line and obfuscated python. pip install olop-ShadowLugia650

null 1 Jan 9, 2022
Generate obfuscated meterpreter shells

Generator Evade AV with obfuscated payloads Installation must install dotnet prior to running the script with net45 Running ./generator.py -ip <Your-I

Fawaz Al-Mutairi 205 Jan 6, 2022
Convert a collection of features to a fixed-dimensional matrix using the hashing trick.

FeatureHasher Convert a collection of features to a fixed-dimensional matrix using the hashing trick. Note, this requires Jina>=2.2.4. Example Here I

Jina AI 4 Nov 4, 2021
labsecurity is a tool that brings together python scripts made for ethical hacking, in a single tool, through a console interface

labsecurity labsecurity is a tool that brings together python scripts made for ethical hacking, in a single tool, through a console interface. Warning

Dylan Meca 11 Jan 2, 2022
FTP-Exploits is a tool made in python that contains 4 diffrent types of ftp exploits that can be used in Penetration Testing.

FTP-exploits FTP-exploits is a tool which is used for Penetration Testing that can run many kinds of exploits on port 21(FTP) Commands and Exploits Ex

null 1 Dec 26, 2021
This tool ability to analyze software packages of different programming languages that are being or will be used in their codes, providing information that allows them to know in advance if this library complies with processes.

This tool gives developers, researchers and companies the ability to analyze software packages of different programming languages that are being or will be used in their codes, providing information that allows them to know in advance if this library complies with processes. secure development, if currently supported, possible backdoors (malicious embedded code), typosquatting analysis, the history of versions and reported vulnerabilities (CVEs) of the package.

Telefónica 58 Jan 5, 2022
This tool help you to check if your Windows machine has hidden miner.

Hidden Miner Detector This tool help you to check if your Windows machine has hidden miner. Miners track when you open antivirus software or task mana

Николай Борщёв 1 Nov 15, 2021
Big-Papa Integrates Javascript and python for remote cookie stealing which then can be used for session hijacking

Big-Papa is a remote cookie stealer which can then be used for session hijacking and Bypassing 2 Factor Authentication

null 40 Dec 25, 2021
This is python script that will extract the functions call in all used DLL in an executable and then provide a mapping of those functions to the attack classes defined and curated malapi.io.

F2Amapper This is python script that will extract the functions call in all used DLL in an executable and then provide a mapping of those functions to

Ajit Kumar 2 Nov 27, 2021
A local Socks5 server written in python, used for integrating Multi-hop

proxy-Zata proxy-Zata v1.0 This is a local Socks5 server written in python, used for integrating Multi-hop (Socks4/Socks5/HTTP) forward proxy then pro

null 2 Dec 24, 2021
Vulnerability Scanner & Auto Exploiter You can use this tool to check the security by finding the vulnerability in your website or you can use this tool to Get Shells

About create a target list or select one target, scans then exploits, done! Vulnnr is a Vulnerability Scanner & Auto Exploiter You can use this tool t

Nano 108 Dec 4, 2021
All in One CRACKER911181's Tool. This Tool For Hacking and Pentesting. 🎭

All in One CRACKER911181's Tool. This Tool For Hacking and Pentesting. ??

Cracker 95 Jan 18, 2022
Facebook account cloning/hacking advanced tool + dictionary attack added | Facebook automation tool

loggef Facebook automation tool, Facebook account hacking and cloning advanced tool + dictionary attack added Warning Use this tool for educational pu

Md Josif Khan 4 Jan 13, 2022
All in One CRACKER911181's Tool. This Tool For Hacking and Pentesting.🎭

This is A Python & Bash Programming Based Termux-Tool Created By CRACKER911181. This Tool Created For Hacking and Pentesting. If You Use This Tool To Evil Purpose,The Owner Will Never be Responsible For That.

CRACKER911181 1 Jan 10, 2022
A tool to brute force a gmail account. Use this tool to crack multiple accounts

A tool to brute force a gmail account. Use this tool to crack multiple accounts. This tool is developed to crack multiple accounts

Saad 1 Jan 17, 2022