Skip to main content

An in-place obfuscator for python 3.11

Project description

PyObf 2

A "continuation" of sorts of the old, private pyobf.

Usage

The obfuscator has 2 modes of operation.

  1. Standalone
    The obfuscator runs on its own, with it's own config system. This is the default. Run with python3.11 main.py in the src directory. A configuration file, config.toml, will be generated with the default values. Edit it, and run main.py again to run the obfuscator with the config.
  2. API
    The obfuscator has an API, to allow you to integrate it into your own projects. For example, it can be used to obfuscate the output of a code generator automatically. An example of this API being used can be seen in api_example.py.
    If you end up using the API, please credit this repository.

API usage

As previously mentioned, the api_example.py file contains examples on how the api works. Some notes are required, though:

  • When obfuscating multiple files that depend on each other, use do_obfuscation_batch_ast, instead of calling do_obfuscation_single_ast on all of them separately. This will allow the obfuscator to draw conclusions on which file depends on which other file, and allows it to understand the structure between them.
  • do_obfuscation_batch_ast is a generator. It will progressively yield each step it does, to allow for progress bar rendering. It will do nothing when not iterated through.
  • Some transformers (eg. packInPyz, compileFinalFiles) only act on the output files of the obfuscation process, and do nothing in the standard run. To invoke them, use do_post_run. This will require you to write the obfuscated AST into a file, though.

Feedback & bugs

The obfuscator is in no way perfect as of now, so feedback is encouraged. Please tell me how bad my code is in the issues tab.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyobf2-1.0.0.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

pyobf2-1.0.0-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

Details for the file pyobf2-1.0.0.tar.gz.

File metadata

  • Download URL: pyobf2-1.0.0.tar.gz
  • Upload date:
  • Size: 26.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for pyobf2-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8e20e6f03e9803f7eee670de8ef033366b37017a82a95b5056678ccd14015ac1
MD5 6c3aff1498808b39bd3fa02c9aea97d2
BLAKE2b-256 da24b144663e2539a358c965955f5bc5b8fdce66f0d5059cb997cca6ac4fda37

See more details on using hashes here.

File details

Details for the file pyobf2-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyobf2-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 32.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for pyobf2-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a1ec933df125037b4ee6f7d971bf67e6000986a897d6feca99c0a3a755791c3
MD5 2f62fad2b10989356c839d24ba1be165
BLAKE2b-256 a8c23d8cb58af316f8dfb84f3b627285cd666b405021b138bd98221b3d8a47e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page