Skip to content

Bad Duck3: DuckyScript 3.0 Interpreter#203

Open
dutchpatriot wants to merge 4 commits intoxMasterX:devfrom
dutchpatriot:feature/bad-duck3
Open

Bad Duck3: DuckyScript 3.0 Interpreter#203
dutchpatriot wants to merge 4 commits intoxMasterX:devfrom
dutchpatriot:feature/bad-duck3

Conversation

@dutchpatriot
Copy link

Summary

Bad Duck3 - The first DuckyScript 3.0 implementation for Flipper Zero with USB and BLE HID support.

Features

DuckyScript 3.0 Language

  • LOOP / END_LOOP - Execute blocks N times
  • WHILE / END_WHILE - Conditional loops
  • VAR - Variable declaration and assignment
  • IF / ELSE / END_IF - Conditional execution
  • BREAK / CONTINUE - Loop control
  • Expression evaluation with arithmetic and comparison operators
  • Built-in variables ($_RANDOM, $_LINE)

Transport Support

  • USB HID - Configurable VID/PID, manufacturer, product name
  • BLE HID - Configurable device name, MAC address, pairing mode

Backward Compatibility

  • All DuckyScript 1.0 commands remain fully supported
  • Existing scripts work without modification

Example

Before (DS 1.0):

ENTER
DELAY 500
ENTER
DELAY 500
... (repeat 98 more times)

After (DS 3.0):

LOOP 100
    ENTER
    DELAY 500
END_LOOP

Testing

  • USB HID tested
  • BLE HID tested
  • Nested loops (8 levels)
  • Variable operations
  • Conditional execution
  • Backward compatibility with DS1.0

Credits

  • Author: @dutchpatriot
  • AI-assisted development with Claude Code (design decisions, testing, debugging done by human)
  • DuckyScript 3.0 spec by Hak5

dutchpatriot and others added 4 commits January 30, 2026 16:41
First DuckyScript 3.0 implementation for Flipper Zero:

Features:
- LOOP/END_LOOP, WHILE/END_WHILE - loop constructs
- VAR - variables with integers and strings
- IF/ELSE/END_IF - conditional execution
- BREAK/CONTINUE - loop control
- Expression evaluation (arithmetic, comparison, logical)
- Built-in variables ($_RANDOM, $_LINE)

Transport:
- USB HID with configurable VID/PID
- BLE HID with configurable name/MAC/pairing

Full backward compatibility with DuckyScript 1.0 scripts.

Author: @dutchpatriot
AI-assisted development with Claude Code
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

Successfully merging this pull request may close these issues.

2 participants