Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where obfuscated *.pyc files? Only *.py files obfuscated. #10

Closed
KomarovAlea opened this issue Mar 1, 2018 · 2 comments
Closed

Where obfuscated *.pyc files? Only *.py files obfuscated. #10

KomarovAlea opened this issue Mar 1, 2018 · 2 comments

Comments

@KomarovAlea
Copy link

KomarovAlea commented Mar 1, 2018

In Mechanism https://github.com/dashingsoft/pyarmor/blob/master/src/mechanism.md
described 2 ways to protect Python Scripts by Pyarmor:

  • Obfuscate byte code of each code object (*.pyc files)
  • Obfuscate whole(source) code object of python module (*.py files)

I build project and get obfuscated py-files
__pyarmor__(__name__, b'${obfuscated_code}')

But I want to get obfuscated pyc-files, because they march more secure.
How to get obfuscated byte code?

This is my project .pyarmor_conf:
{
"version": "1.0.1",
"name": "my_mod",
"title": "my_mod",
"src": "/opt/odoo/addons/my_mod",
"manifest": "global-include *.py, exclude __manifest__.py",
"entry": "__init__.py",
"output": "dist/my_mod",
"capsule": ".pyarmor_capsule.zip",
"runtime_path": null,
"disable_restrict_mode": 1,
"obf_module_mode": "des",
"obf_code_mode": "des",
"build_time": 1519901163.5200913
}

@jondy
Copy link
Contributor

jondy commented Mar 1, 2018

What you got now is exactly obfuscated pyc-files, the second way is to obfuscate whole code object of python module, not source of python module(*.py). Actually,

.pyc file == .pyc header + **whole code object**

Pyarmor first compile .py file to code object, then obfuscate byte-code of this code object and all the descendant code object.
Second serialize this code object and obfuscate the result string again.

@KomarovAlea
Copy link
Author

KomarovAlea commented Mar 4, 2018

Thank you for explanation.
I will try to uncompyle obfuscated .pyc files with uncompyle6 and made sure that pyarmor is work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants