A generic static Python deobfuscator based on AST transformations
Project description
Noctyra
Noctyra is an AST-based framework designed for code transformation and deobfuscation. It provides a modular pipeline to analyze and simplify Python source code by resolving complex expressions and logic.
Overview
The project aims to provide a flexible environment for processing Python's Abstract Syntax Tree. By employing a sequence of pluggable transformers, Noctyra can:
- Simplify nested logic and conditions.
- Resolve static values and common encoding patterns.
- Unroll dynamic execution blocks into readable code.
- Optimize and clean up obfuscated constructs.
Getting Started
Prerequisites
Ensure you have uv installed for dependency management.
uv sync
Running the Pipeline
To process a target script, use the following command:
python main.py <input_file> [options]
Options:
file: Path to the input Python file (required).--output: File name for the transformed code (default:out.py).--iterations: Set a fixed number of transformation passes (default:0for auto-detect).--max-iterations: Limit the passes in auto mode (default:100).--debug: Enable verbose logging for debugging transformations. (look sick)
Development
This project uses uv for dependency management and a Makefile for common tasks.
Setup
uv sync --all-extras --dev
Quality Control
Before submitting a PR or pushing changes, ensure all checks pass:
- Run Tests:
make test - Lint & Format:
make format - Type Check:
make typecheck
(Windows users: These commands work automatically via make.bat.)
CI/CD
Automated checks are performed on every push via GitHub Actions, including linting with Ruff, type checking with Mypy, and unit testing with Pytest.
Security Notice
Noctyra includes an internal evaluation engine with basic resource limits. However, when dealing with untrusted code, it is highly recommended to run the pipeline within an isolated environment (such as a container or sandbox) to prevent potential side effects or resource exhaustion.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file noctyra-0.1.4.tar.gz.
File metadata
- Download URL: noctyra-0.1.4.tar.gz
- Upload date:
- Size: 489.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a29fc67a26aa8710b2565ff864cede5711d984afe84b171619dba7b2304bb611
|
|
| MD5 |
32c1dd968b6b3d68528dd6a593474d61
|
|
| BLAKE2b-256 |
d336ab9380ec3f2f0f1f93977942095f14f70cdec8d2fff289c549c79d3546ea
|
File details
Details for the file noctyra-0.1.4-py3-none-any.whl.
File metadata
- Download URL: noctyra-0.1.4-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
914b8e5441a5e3e77160dffdd75da685358d284dd4b9d341c1d3b3e1b9c34e5c
|
|
| MD5 |
372eaea4f7aa8d7030056aad2efab190
|
|
| BLAKE2b-256 |
748cc8bbcd50f410446932ef1789b5dda1e38c6085542df08987229ab748870a
|