DuckyScript compiler that transpiles payloads into multiple targets such as Arduino and Python.
Project description
Duckymorph
DuckyScript transpiler framework — transpiles DuckyScript payloads into multiple targets (Arduino, Python, etc.).
Status: Prototype. This project provides a parser, generator scaffold, and a CLI for experimenting with DuckyScript transpilation.
Features
- Parse DuckyScript into an AST
- Pluggable code generators (Arduino included as example)
- CLI for parsing, listing transpilers, and generating target code
Quickstart
Clone and install locally:
git clone https://github.com/0xLava101/duckymorph.git
cd duckymorph
pip install -e .
install with pip :
pip install duckymorph
Note: Package metadata is defined in
pyproject.toml. You can also run the CLI directly from source during development.
CLI Usage
The project exposes a Typer-based CLI:
- Show help:
duckymorph --help
- Parse a DuckyScript file to an AST:
duckymorph parse path/to/payload.ds
- List available transpilers:
duckymorph transpilers
- Generate code using a transpiler (example: Arduino):
duckymorph generate path/to/payload.ds --transpiler arduino --output out.ino
Use --cp to copy generated code to clipboard (requires pyperclip).
Programmatic Usage
You can use the library from Python:
from duckymorph.core.ducky_parser import DuckyParser
from duckymorph.core.code_generators.factory import CodeGeneratorsFactory
parser = DuckyParser()
parser.parse("REM Example\nSTRING Hello World")
ast = parser.get_ast()
generator = CodeGeneratorsFactory.get_generator("arduino")
code = generator.generate_code(ast)
print(code)
Note: The public API is still evolving and may change during the prototype stage.
Contributing
Thanks for your interest in contributing. This project is intentionally minimal at this stage. You can help by:
-
Improving the parser (lexer/tokenizer, source tracking)
-
Writing unit and integration tests (pytest)
-
Designing a stable generator interface + templates
Security & Safety
Generators are executed as Python code and run with the same privileges as the process. Do not load or execute untrusted third-party generators.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
Repository: https://github.com/0xLava101/duckymorph
Project details
Release history Release notifications | RSS feed
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 duckymorph-0.1.0.tar.gz.
File metadata
- Download URL: duckymorph-0.1.0.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f50c8c7d189dd9414f98c25083be2ccf9afde8901acad1bd9f8a9a00605ee99
|
|
| MD5 |
12b4b1f3d83908a8740f57141204be56
|
|
| BLAKE2b-256 |
6e1fd2efbeb36a7129ea092a62b574f92b2786b059ebe16c40b1440bbe07a950
|
File details
Details for the file duckymorph-0.1.0-py3-none-any.whl.
File metadata
- Download URL: duckymorph-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8c7fd30d8b46d8291ba89e9fab3a59354fdfb74084e130863aa36c3e9734a0b
|
|
| MD5 |
038f3ea792ae555d38627484db6fce11
|
|
| BLAKE2b-256 |
e13e582d90cec5e184cfe8540c76deb40d29aa1b8eaccb770b8e645ece85fa2a
|