Skip to main content

A generic static Python deobfuscator based on AST transformations

Project description

Noctyra

Noctyra Demo

Python Version Status

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: 0 for 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

noctyra-0.1.1.tar.gz (492.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

noctyra-0.1.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file noctyra-0.1.1.tar.gz.

File metadata

  • Download URL: noctyra-0.1.1.tar.gz
  • Upload date:
  • Size: 492.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for noctyra-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0900041b1c50945967745abf2f58d49238b26b04f8ad9da4e1cd4108a226b53a
MD5 fd2e8c83a484214afcba46e364c9c9b1
BLAKE2b-256 1feb39bf9774e03464dfd768ff45f1c1463d0bc73b53863a780c7d793f72bf8f

See more details on using hashes here.

File details

Details for the file noctyra-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: noctyra-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for noctyra-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 085f3a58c130f626c6fe1e3a5bd44a9af21bfaa8b42758a96c6de26e627a6a4f
MD5 d73af27a069b837a17fbe9dc6f1ef347
BLAKE2b-256 a6787f7bbdca361c576dfece72240ce68fc5bf12a1bca1d4e3a462c73a558b79

See more details on using hashes here.

Supported by

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